【问题标题】:Entropy and Information Gain熵和信息增益
【发布时间】:2011-07-24 20:09:48
【问题描述】:

我希望是个简单的问题。

如果我有这样一组数据:

Classification  attribute-1  attribute-2

Correct         dog          dog 
Correct         dog          dog
Wrong           dog          cat 
Correct         cat          cat
Wrong           cat          dog
Wrong           cat          dog

那么attribute-2相对attribute-1的信息增益是多少?

我计算了整个数据集的熵:-(3/6)log2(3/6)-(3/6)log2(3/6)=1

那我就卡住了!我认为您也需要计算属性 1 和属性 2 的熵吗?那么在一次信息增益计算中使用这三个计算呢?

任何帮助都会很棒,

谢谢你:)。

【问题讨论】:

    标签: statistics machine-learning information-theory


    【解决方案1】:

    首先,您必须计算每个属性的熵。之后,您计算信息增益。请给我一点时间,我会告诉你应该怎么做。

    对于属性 1

    attr-1=dog:
    info([2c,1w])=entropy(2/3,1/3)
    
    attr-1=cat
    info([1c,2w])=entropy(1/3,2/3)
    

    属性 1 的值:

    info([2c,1w],[1c,2w])=(3/6)*info([2c,1w])+(3/6)*info([1c,2w])
    

    属性 1 的增益:

    gain("attr-1")=info[3c,3w]-info([2c,1w],[1c,2w])
    

    你必须为下一个属性做同样的事情。

    【讨论】:

      猜你喜欢
      • 2010-12-27
      • 2010-12-23
      • 2016-02-23
      • 1970-01-01
      • 2016-06-23
      • 1970-01-01
      • 2014-01-07
      • 2011-06-01
      • 2017-06-27
      相关资源
      最近更新 更多