决策树 - 节点的熵可以为零吗?

Decision Tree - Can the Entropy of a Node be Zero?

信息增益的公式为,

Information Gain = entropy(parent) – [average entropy(children)]

熵可以为零吗,这意味着在某些情况下:

entropy(parent) == [average entropy(children)]

"When H(S) = 0, the set S is perfectly classified (i.e. all elements in S are of the same class)." -- https://en.wikipedia.org/wiki/ID3_algorithm

H(S) = 熵 ;)

Guiem给出了正确答案,即当一个集合的所有元素都属于同一个class时,熵为零。但是关于你的问题,还有两点值得注意:

首先,在实现决策树时,如果 entropy(parent) 为零,则没有理由计算 children 的信息增益,因为数据已经完美 class 化(即,您位于树的叶节点处)。

其次,entropy(parent) == [average entropy(children)]的情况不一定只发生在parent的熵为零时。当 parent 具有非零熵时也会发生这种情况(即 children 上分裂的信息增益为零),这表明 children 上的分裂不会改善 class 化表现。