SlideShare a Scribd company logo
1 of 3
Download to read offline
Decision Tree Working Example
Rec Age Income Student Credit_rating Buys_computer
R1 <=30 High No Fair No
R2 <=30 High No Excellent No
R3 31..40 High No Fair Yes
R4 >40 Medium No Fair Yes
R5 >40 Low Yes Fair Yes
R6 >40 Low Yes Excellent No
R7 31..40 Low Yes Excellent Yes
R8 <=30 Medium No Fair No
R9 <=30 Low Yes Fair Yes
R10 >40 Medium Yes Fair Yes
R11 <=30 Medium Yes Excellent Yes
R12 31..40 Medium No Excellent Yes
R13 31..40 High Yes Fair Yes
R14 >40 Medium No Excellent No
Expected information (entropy) needed to classify a tuple in Database „D‟:
Info (D) = -9/14 log (9/14) -5/14 log (5/14)
= -0.64286 * log (0.64286)-0.35714 * log (0.35714)
=-0.64286* (-0.6373)-0.35714*(-1.485438)
Info (D) = 0.40976 + 0.530496=0.940256 bits
)
(
log
)
( 2
1
i
m
i
i p
p
D
Info 



Information needed (after using attribute „A‟ to split database „D‟ into „V‟ partitions) to
classify D:
For Attribute “Age”
Info Age (D) = 5/14 I(2,3) + 4/14 I (4,0) + 5/14 I(3,2)
= 5/14[-2/5 log (2/5)-3/5 log (3/5)] +4/14[-4/4 log(4/4)-0/4* log (0/4)] +5/14[-3/5 log (3/5)-
2/5log(2/5)]
= 0.35714[-0.4*(-1.321928)-0.6*(-0.736966)]+
0.28571[-1*0]+
0.35714 * [-0.6*(-0.736966)-0.4*(-1.321928)]
=0.35714 *[0.528771+0.44218]+0.35714 *[0.44218+0.528771]
Info Age (D) =0.34676+0.34676=0.693531 bits
Information gained by branching on attribute Age
Gain (age) = 0.940256-0.693531=0.2467 bits
Similarly for Attribute “Income”
Info income (D) =4/14[-2/4 log(2/4)-2/4 log (2/4)] +6/14[-4/6 log (4/6)-2/6 log (2/6)] +4/14[-3/4
log (3/4)-1/4 log (1/4)]
=0.2857 *[-0.5*log(0.5)-0.5 *log (0.5)] + 0.4285 *[-0.66 * log(0.66)-0.33 log(0.33)]
+0.2857[-0.75* log(0.75)-0.25 log (0.25)]
=0.2857[0.5+0.5] +0.4285[0.395645+0.5278]+0.2857[0.311278+0.5]
=0.2857*1+0.4285*0.923445+0.2857*0.811278
Info income (D ) =0.2857+0.3956+0.23178=0.91308 bits
Gain (income) = 0.940256-0.91308=0.027 bits
)
(
|
|
|
|
)
(
1
j
v
j
j
A D
Info
D
D
D
Info 
 

(D)
Info
Info(D)
Gain(A) A


For Attribute “Student”
Info student (D) =7/14[-6/7log(6/7)-1/7log(1/7)] +7/14[-3/7log (3/7)-4/7log (4/7)]
=0.50 *[-0.86-0.22-0.14-0.281] +0.50[-0.43-1.22-0.57-0.81]
=0.50*[0.19+0.39]+0.50[0.52+0.46]
=0.50*0.58+0.5*0.98
Info student (D) = =0.29+0.49=0.78 bits
Gain (Student) =0.940256-0.78=0.16 bits
For Attribute “Credit Rating”
Info Credit Rating(D)=8/14[-6/8 log(6/8)-2/8 log(2/8)] +6/14[-3/6log (3/6)-3/6 log (3/6)]
=0.57*[-0.75*(-0.42)-0.25*(-2.00)]+0.43[-0.50*(-1)-0.50*(-1)]
=0.57*[0.32+0.50] +0.43[0.50*0.50]
=0.57*0.82+0.43*1.00
Info Credit Rating (D) =0.47+0.43=0.90 bits
Gain (Credit Rating) =0.940256-0.90=0.04 bits

More Related Content

Recently uploaded

Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
PirithiRaju
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Lokesh Kothari
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
AlMamun560346
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
Areesha Ahmad
 

Recently uploaded (20)

Pests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdfPests of cotton_Sucking_Pests_Dr.UPR.pdf
Pests of cotton_Sucking_Pests_Dr.UPR.pdf
 
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRLKochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
Kochi ❤CALL GIRL 84099*07087 ❤CALL GIRLS IN Kochi ESCORT SERVICE❤CALL GIRL
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)GBSN - Biochemistry (Unit 1)
GBSN - Biochemistry (Unit 1)
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and SpectrometryFAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
FAIRSpectra - Enabling the FAIRification of Spectroscopy and Spectrometry
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.Proteomics: types, protein profiling steps etc.
Proteomics: types, protein profiling steps etc.
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
Bacterial Identification and Classifications
Bacterial Identification and ClassificationsBacterial Identification and Classifications
Bacterial Identification and Classifications
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

8 decision tree working-sheet-0

  • 1. Decision Tree Working Example Rec Age Income Student Credit_rating Buys_computer R1 <=30 High No Fair No R2 <=30 High No Excellent No R3 31..40 High No Fair Yes R4 >40 Medium No Fair Yes R5 >40 Low Yes Fair Yes R6 >40 Low Yes Excellent No R7 31..40 Low Yes Excellent Yes R8 <=30 Medium No Fair No R9 <=30 Low Yes Fair Yes R10 >40 Medium Yes Fair Yes R11 <=30 Medium Yes Excellent Yes R12 31..40 Medium No Excellent Yes R13 31..40 High Yes Fair Yes R14 >40 Medium No Excellent No Expected information (entropy) needed to classify a tuple in Database „D‟: Info (D) = -9/14 log (9/14) -5/14 log (5/14) = -0.64286 * log (0.64286)-0.35714 * log (0.35714) =-0.64286* (-0.6373)-0.35714*(-1.485438) Info (D) = 0.40976 + 0.530496=0.940256 bits ) ( log ) ( 2 1 i m i i p p D Info    
  • 2. Information needed (after using attribute „A‟ to split database „D‟ into „V‟ partitions) to classify D: For Attribute “Age” Info Age (D) = 5/14 I(2,3) + 4/14 I (4,0) + 5/14 I(3,2) = 5/14[-2/5 log (2/5)-3/5 log (3/5)] +4/14[-4/4 log(4/4)-0/4* log (0/4)] +5/14[-3/5 log (3/5)- 2/5log(2/5)] = 0.35714[-0.4*(-1.321928)-0.6*(-0.736966)]+ 0.28571[-1*0]+ 0.35714 * [-0.6*(-0.736966)-0.4*(-1.321928)] =0.35714 *[0.528771+0.44218]+0.35714 *[0.44218+0.528771] Info Age (D) =0.34676+0.34676=0.693531 bits Information gained by branching on attribute Age Gain (age) = 0.940256-0.693531=0.2467 bits Similarly for Attribute “Income” Info income (D) =4/14[-2/4 log(2/4)-2/4 log (2/4)] +6/14[-4/6 log (4/6)-2/6 log (2/6)] +4/14[-3/4 log (3/4)-1/4 log (1/4)] =0.2857 *[-0.5*log(0.5)-0.5 *log (0.5)] + 0.4285 *[-0.66 * log(0.66)-0.33 log(0.33)] +0.2857[-0.75* log(0.75)-0.25 log (0.25)] =0.2857[0.5+0.5] +0.4285[0.395645+0.5278]+0.2857[0.311278+0.5] =0.2857*1+0.4285*0.923445+0.2857*0.811278 Info income (D ) =0.2857+0.3956+0.23178=0.91308 bits Gain (income) = 0.940256-0.91308=0.027 bits ) ( | | | | ) ( 1 j v j j A D Info D D D Info     (D) Info Info(D) Gain(A) A  
  • 3. For Attribute “Student” Info student (D) =7/14[-6/7log(6/7)-1/7log(1/7)] +7/14[-3/7log (3/7)-4/7log (4/7)] =0.50 *[-0.86-0.22-0.14-0.281] +0.50[-0.43-1.22-0.57-0.81] =0.50*[0.19+0.39]+0.50[0.52+0.46] =0.50*0.58+0.5*0.98 Info student (D) = =0.29+0.49=0.78 bits Gain (Student) =0.940256-0.78=0.16 bits For Attribute “Credit Rating” Info Credit Rating(D)=8/14[-6/8 log(6/8)-2/8 log(2/8)] +6/14[-3/6log (3/6)-3/6 log (3/6)] =0.57*[-0.75*(-0.42)-0.25*(-2.00)]+0.43[-0.50*(-1)-0.50*(-1)] =0.57*[0.32+0.50] +0.43[0.50*0.50] =0.57*0.82+0.43*1.00 Info Credit Rating (D) =0.47+0.43=0.90 bits Gain (Credit Rating) =0.940256-0.90=0.04 bits