Skip to main content
. Author manuscript; available in PMC: 2011 Apr 10.
Published in final edited form as: Optom Vis Sci. 2005 Dec;82(12):1038–1046. doi: 10.1097/01.opx.0000192350.01045.6f

TABLE A1.

Pseudocode representation of a recursive decision tree algorithm

1 Create the root node of the tree S
2 if all instances belong to the same class C then
3 S= leaf note labeled with class C
4 if attribute list (A l) is empty then
5 S= leaf node labeled with the majority class
6 Otherwise
7 Select test attribute (A t) from A l with the greatest information gain
8 Label node S as A t
9 For each possible value v i of A t
10 grow a branch from S where the test attribute A t = v i
11 Let S v be the subset of S for each value of Attribute A t = v i
12 if S v is empty then
13 label the node S v as a leaf with the most common class
14 Else below this branch add the subtree node