|
ALGORITHM 1: Information gain pseudocode. |
|
Input: Dataset D= { (x1,c1),…,(xN,cN) } |
Output: predicted class Ci. |
for each attribute or node i do |
Calculate the information of each branch |
Average information of all attribute values or branches, avg |
Calculate the information of the unsplit node, unsplitINFO |
Calculate the information gain of the node i: |
Gain[node] = unsplitINFO — avg |
end |
return Gain[node] |
|