lec06decisiontreesandid3algorithm_727c2262eb504a6ee5d0bcf1f5c4d0c3_
lec06decisiontreesandid3algorithm_727c2262eb504a6ee5d0bcf1f5c4d0c3_
Decision Trees
& ID3 Algorithm
INSTRUCTOR: JAWAD RASHEED
Agenda ▪ How Decision-making process evolve?
▪ Decision Trees
▪ ID3 Algorithm
▪ Statistical Test
▪ Entropy, and Information Gain
▪ Finding attributing as best classifier
● If not
● Then, if it’s sunny I’ll play and go to park
● But if it’s windy and I’m rich, I’ll go shopping
● If it’s rainy, I’ll stay in
● Decision tree learning is a method for approximating discrete-valued target functions, in which the
learned function is represented by a decision tree.
● It has been successfully applied to a broad range of tasks from learning to diagnose medical cases to
learning to assess the credit risk of loan applicants.
● Each node in the tree specifies a test of some attribute of the instance.
● An instance is classified by starting at the root node of the tree, testing the attribute specified by this
node, then moving down the tree branch corresponding to the value of the attribute in the given
example.
● We will define a statistical property, called information gain, that measures how well a given
attribute separates the training examples according to their target classification
● ID3 uses this information gain measure to select among the candidate attributes at each step while
growing the tree.
● For Example: Suppose S is a collection of 14 examples of some Boolean concept, including 9 positive
and 5 negative examples
9 9 5 5
𝐸𝑛𝑡𝑟𝑜𝑝𝑦 [9⊕ , 5⊖ ] = − 14
𝑙𝑜𝑔2 14
− 14
𝑙𝑜𝑔2 14
= -(0.6429)(-0.6374) – (0.3571)(-1.4854)
= -0.4098 + 0.5305
= 0.940
𝑆𝑣
𝐺𝑎𝑖𝑛 𝑆, 𝐴 ≡ 𝐸𝑛𝑡𝑟𝑜𝑝𝑦 𝑆 − 𝐸𝑛𝑡𝑟𝑜𝑝𝑦(𝑆𝑣 )
𝑆
𝑣 ∈𝑉𝑎𝑙𝑢𝑒𝑠(𝐴)