2. Hello!
I am Iffat Firozy
I am here because I love to teach.
You can find me at ifirozy@gmail.com
2
3. “A decision tree is a structure that includes a root node, branches, and leaf
nodes. Each internal node denotes a test on an attribute, each branch
denotes the outcome of a test, and each leaf node holds a class label. The
topmost node in the tree is the root node.”
3
5. 5
BUT HOW can WE GENERATE A DECISION TREE FROM Our DATA SET???
6.
7. LET'S SOLVE THIS PROBLEM.
Yellow
Is the color of gold,
butter and ripe lemons.
In the spectrum of
visible light, yellow is
found between green
and orange.
Blue
Is the colour of the
clear sky and the deep
sea. It is located
between violet and
green on the optical
spectrum.
Red
Is the color of blood,
and because of this it
has historically been
associated with
sacrifice, danger and
courage.
7
10. FOR ATTRIBUTE A:
STEP3:GAIN
𝐺𝐴𝐼𝑁 = 𝐼 𝑇 - E
=0.97 - .588
=0.38
Now, will follow these 3 steps to find out the
gain of attribute B.
10
11. FOR ATTRIBUTE B:
STEP1: INFORMATION GAIN
𝐼0 2,4 =0.05
𝐼1 4,0 =0
STEP2: ENTROPY
E=0.03
STEP3: GAIN
𝐼 𝑇 - E
=0.97 – 0.03 =.967
11
B C1/YES C2/NO
0 2 4
1 4 0
12. SEE!
12
B
0.967
A
0.38
SO, B ATTRIBUTE SPLIT THE DECISION TREE
B
A
NO YES
YES
10
10
B C1/YES C2/NO
0 2 4
1 4 0
1 has max no.
of c1(YES)
A C1/YES C2/NO
0 2 3
1 4 1
0 has
max no
of
C2(NO)
1 has max no.
of (YES)