Decision ¡Tree ¡Learning ¡
Debapriyo Majumdar Data Mining – Fall 2014 Indian Statistical Institute Kolkata
August 25, 2014
Example: Age, Income and Owning a flat 250 Training set - - PowerPoint PPT Presentation
Decision Tree Learning Debapriyo Majumdar Data Mining Fall 2014 Indian Statistical Institute Kolkata August 25, 2014 Example: Age, Income and Owning a flat 250 Training set (thousand
Debapriyo Majumdar Data Mining – Fall 2014 Indian Statistical Institute Kolkata
August 25, 2014
2 ¡
0 ¡ 50 ¡ 100 ¡ 150 ¡ 200 ¡ 250 ¡ 0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡
Monthly ¡income ¡ (thousand ¡rupees) ¡ Age ¡ Training ¡set ¡
house ¡
not ¡own ¡ a ¡house ¡
§ If the training data was as above
– Could we define some simple rules by observation?
§ Any point above the line L1 à Owns a house § Any point to the right of L2 à Owns a house § Any other point à Does not own a house
3 ¡
0 ¡ 50 ¡ 100 ¡ 150 ¡ 200 ¡ 250 ¡ 0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡
Monthly ¡income ¡ (thousand ¡rupees) ¡ Age ¡ Training ¡set ¡
house ¡
not ¡own ¡ a ¡house ¡
Root node: Split at Income = 101 Income ≥ 101: Label = Yes Income < 101: Split at Age = 54 Age ≥ 54: Label = Yes Age < 54: Label = No I n g e n e r a l , t h e d a t a w
’ t b e s u c h a s a b
e
4 ¡
0 ¡ 50 ¡ 100 ¡ 150 ¡ 200 ¡ 250 ¡ 0 ¡ 10 ¡ 20 ¡ 30 ¡ 40 ¡ 50 ¡ 60 ¡ 70 ¡
Monthly ¡income ¡ (thousand ¡rupees) ¡ Age ¡ Training ¡set ¡
house ¡
not ¡own ¡ a ¡house ¡
5 ¡
6 ¡
i=1 C
7 ¡
i=1 C
– That is, do not create any further branches for that node – Make that node a leaf – Classify the node with the most frequent class present in the node
8 ¡
This rectangle (node) is still impure
– Does not represent classes well – Overfitting
– Stop earlier, or – Prune back the tree
9 ¡
Root ¡ 1000 ¡ 400 ¡ 600 ¡ 200 ¡ 200 ¡ 240 ¡ 160 ¡ 2 ¡ 1 ¡ 5 ¡
Number ¡
StaOsOcally ¡not ¡ significant ¡
– Lose purity of nodes – But were they really pure or was that a noise? – Too many nodes ≈ noise
10 ¡
Leaf ¡node ¡ (label ¡= ¡Y) ¡ Freq ¡= ¡5 ¡ Decision ¡ node ¡ (Freq ¡= ¡7) ¡ Leaf ¡node ¡ (label ¡= ¡B) ¡ Freq ¡= ¡2 ¡ Leaf ¡node ¡ (label ¡= ¡Y) ¡ Freq ¡= ¡7 ¡
Prune ¡
11 ¡
Leaf ¡node ¡ (label ¡= ¡Y) ¡ Freq ¡= ¡5 ¡ Decision ¡ node ¡ (Freq ¡= ¡7) ¡ Leaf ¡node ¡ (label ¡= ¡B) ¡ Freq ¡= ¡2 ¡ Leaf ¡node ¡ (label ¡= ¡Y) ¡ Freq ¡= ¡7 ¡
Prune ¡
– If α=0, no penalty for bigger tree
– Gordon Kass (1980) – Stop subtree creation if not statistically significant by chi-square test
– Breiman et al. – Decision tree building by Gini’s index
– Ross Quinlan (1986) – Splitting by information gain (difference in entropy)
– Quinlan’s next algorithm, improved over ID3 – Bottom up pruning, both categorical and continuous variables – Handling of incomplete data points
– Ross Quinlan’s commercial version
12 ¡
13 ¡
14 ¡