Decision Tree
Decision Tree
• Is a branch of AI
• Criticism of AI
– Adapt to new situation
– Whatever is told it is done
• Remedy L….L….E….A…R……
R…N
Types of Learning
• Supervised Learning
– No target
– Continuous
– Eg. Predict the Economic growth of India
2004
– Clustering
– Learning by Observation
Supervised Learning –
Classification
Classification
Training Data
Algorithm
Classification
rules
(John Henri ,
31..40, high )
Credit rating ?
excellent
Learning by Decision Tree
Induction
• Tree
– Graphical representation
– Nodes – Rounded rectangle
– Branches
– Leaves - Oval
What is a Decision Tree ?
• Is a flow chart like tree structure
< = 30 > 40
Student ?
Credit_rating ?
no yes no yes
How to choose Root Node ?
• Attribute with the highest Information Gain
• Information Gain
Expected
information to
classify a given
sample
How to choose Root Node ?
• S = { s 1 , s2 , … s m }
• Ci for i=1 to m
Classes
• Pi = S i
-------
S
Entropy & Gain
• E(A) A – Attribute
• Expected Information based on
partitioning into subsets by A
v
• E(A) = s ij +……+smj I (s ij ….. smj)
j=1
S
Entropy & Gain
= 0.971
I ( s12,s22 ) =0
I ( s13,s23 ) = 0.97
Entropy & Gain Calculation
E( age )= 5 I( s11 , s21) + 4 I( s12,s22) + 5 I(s13,s23 )
14 14 14
= 0.694
High No Fair No
31 Medium
t
No Fair
s
Yes
Cannot
Predict???????????????????????!!!!!!!!!!!!
Other Learning Schema