Skip to main content
. 2014 Oct 22;14(10):19806–19842. doi: 10.3390/s141019806

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] = unsplitINFOavg
end
return Gain[node]