SlideShare a Scribd company logo
1 of 25
Atal Bihari Vajpayee Vishwavidyalaya
Bilaspur (C.G.)
Session-2021-22
Subject-AI & ML
Topic- Decision tree type
Guided by:
Mr. Umesh Sir
Presented by:
PurushottamChoudhary
(Mca 2nd sem)
CART(Classification And RegressionTree)
Classification And regression tree algorithm is a
classification and a regression algorithm used
for building a decision tree based on Gini’s
impurity index as splitting criterion
Example:
S.No. Outlook Temperature Humidity Windy Play tennis
1 Sunny Hot High Weak No
2 Sunny Hot High Strong No
3 Overcast Hot High Weak Yes
4 Rain Mild High Weak Yes
5 Rain Cool Normal Weak Yes
6 Rain Cool Normal Strong No
7 Overcast Cool Normal Strong Yes
8 Sunny Mild High Weak No
9 Sunny Cool Normal Weak Yes
10 Rain Mild Normal Weak Yes
11 Sunny Mild Normal Strong Yes
12 Overcast Mild High Strong Yes
13 Overcast Hot Normal Weak Yes
14 Rain Mild High Strong No
Gini index is a metric for classification tasks in CART. It stores sum of squared
probabilties of each class. We can formulate it as illustrated below.
•Gini(Attribute value) = 1 - ∑ (Pi)2 for i= 1 to number of classes
• Gini(Attributue)= ∑ Pi * GI(v) v=value
Outlook:
Outlook Yes No Number of
instances
Sunny 2 3 5
Overcast 4 0 4
Rain 3 2 5
Gini(Outlook=Sunny)= 1 - (2/5)2 – (3/5)2 = 1 - 0.16 - 0.36
= 0.48
Gini(Outlook=Overcast) = 1 – (4/4)2 – (0/4)2 = 1 – 1 – 0
= 0
Gini(Outlook=Rainy) = 1 – (3/5)2 – (2/5)2 = 1 – 0.36 – 0.16
= 0.48
Then we will calculate weighted sum of Gini indexes for outlook feature.
Gini (Outlook)= (5/14)*0.48 + (4/14)*0 + (5/14)*0.48
= 0.342
Temperature:
Temprature Yes No Number of
instances
Hot 2 2 4
Cool 3 1 4
Mile 4 2 6
Gini(temp=hot)= 1 – (2/4)2 – (2/4)2
= 0.5
Gini(temp=cool) = 1 – (3/4)2 – (1/4)2 = 1 – 0.5625 – 0. 0625
= 0.375
Gini(temp=mild) =1 – (4/6)2 – (2/6)2 = 1 – 0.444 – 0.111
= 0.445
Then we will calculate weighted sum of Gini indexes for temperature feature.
Gini(temp)= (4/14) * 0.5 + (4/14) * 0.375 + (6/14) * 0.444
= 0.142 + 0.107 + 0.190
= 0.439
Humidity:
Humidity Yes No Number of
instance
High 3 4 7
Normal 6 1 7
Gini(Humidity=high) = 1 – (3/7)2 – (4/7)2 = 1 – 0.183 – 0. 326
= 0.489
Gini(Humidity=normal) = 1 – (6/7)2 – (1/7)2 = 1 – 0.734 – 0.02
= 0.244
Then we will calculate weighted sum of Gini indexes for Humidity feature.
Gini(Humidity) = (7/14) * 0.489 + (7/14) * 0.244
= 0.367
Wind:
Wind Yes No Number of
instance
Weak 6 2 8
Strong 3 3 6
Gini(wind=weak) = 1 – (6/8)2 – (2/8)2 = 1 – 0.5625 – 0.062
= 0.375
Gini(wind=strong) = 1 – (3/6)2 – (3/6)2 = 1 – 0.25 – 0. 25
= 0.5
Then we will calculate weighted sum of Gini indexes for wind feature.
Gini(Wind) = (8/14) * 0.375 + ( 6/14) * 0. 5
= 0.428
Time to decide:
Feature Gini index
Outlook 0.342
Temperature 0.439
Humidity 0.367
Wind 0.428
We have calculating gini index values for each feature.The winner will be outlook
feature because its cost is the lowest
We’ll put outlook decision at the top of the tree
outlook
Day Outloo
k
temp Humidi
ty
Wind Deci
sion
1 sunny Hot High Weak No
2 Sunny Hot High Strong No
8 Sunny Cool High Weak No
9 Sunny Mind Normal Weak Yes
11 Sunny Cool Normal strong Yes
sunny Rain
Day Outloo
k
temp Humidit
y
Wind Decisio
n
1 Rain Mild High Weak Yes
2 Rain Cool Normal Weak Yes
8 Rain Cool Normal Strong No
9 Rain Mind Normal Weak Yes
11 Rain Mild High strong No
Day Outlook Temp Humidity Wind Decision
3 Overcast Hot High Weak Yes
7 Overcast Cool Normal Strong Yes
12 Overcast Mild High Strong Yes
13 Overcast Hot Normal Weak Yes
overcast
First decision would be outlook feature. You might realize that the over cast leaf has only yes
decision .This mean that overcast leaf is over.
outlook
Da
y
Outlo
ok
tem
p
Humidit
y
Wind Decisio
n
1 Rain Mild High Weak Yes
2 Rain Cool Normal Weak Yes
8 Rain Cool Normal Strong No
9 Rain Mind Normal Weak Yes
11 Rain Mild High strong No
sunny Rain
yes
overcast
Tree is over for overcast outlook leaf
Day Outloo
k
temp Humidit
y
Wind Decisio
n
1 Rain Mild High Weak Yes
2 Rain Cool Normal Weak Yes
8 Rain Cool Normal Strong No
9 Rain Mind Normal Weak Yes
11 Rain Mild High strong No
We will same principal to those sub dataset in the following step:
Day Outlook temp Humidity Wind Decisio
n
1 sunny Hot High Weak No
2 Sunny Hot High Strong No
8 Sunny Cool High Weak No
9 Sunny Mind Normal Weak Yes
11 Sunny Cool Normal strong Yes
Gini of temperature for sunny outlook:-
Temperature Yes No Number of
instance
Hot 0 2 2
Cool 1 0 1
Mind 1 1 2
Gini (Outlook=Sunny andTemp= hot) =1 – (0/2)2 – (2/2)2
= 0
Gini (Outlook=Sunny andTemp= cool)= 1- (1/1)2 – (0/1)2
= 0
Gini (Outlook=Sunny andTemp= mild)= 1 – (1/2)2 – (1/2)2 = 1 – 0.25 – 0.25
= 0.5
Gini (Outlook=Sunny andTemp)= (2/5) * 0 + (1/5) * 0 + (2/5) * 0.5
= 0.2
Gini of humidity for Sunny outlook:-
Humidity Yes No Decision
High 0 3 3
Normal 2 0 2
Gini(outlook=Sunny and Humidity= high) =1 – (0/3)2 – (3/3)2
= 0
Gini(outlook=Sunny and Humidity= normal) = 1 – (2/2)2 – (0/2)2
= 0
Gini(outlook=Sunny and Humidity) = (3/5) * 0 + (2/5) * 0
= 0
Gini of wind for Sunny outlook:-
Wind Yes No Number of
instance
Weak 1 2 3
Strong 1 1 2
Gini (Outlook =Sunny and Wind=Weak) = 1 – (1/3)2 - (2/3)2
= 0.266
Gini (Outlook=Sunny and wind= Strong) = 1- (1/2)2 – (1/2)2
= 0.2
Gini (Outlook=Sunny and Wind) = (3/5) * 0.266 + (2/5) * 0.2
= 0.466
Decision for sunny outlook:-
Feature Gini index
Temperature 0.2
Humidity 0
Wind 0.466
We’ve calculated Gini index score for feature when outlook is sunny.The winner is
humidity because its has the lowest value.
outlook
Humidity
Day Outlo
ok
Temp Humid
ity
Wind Decisi
0n
1 Sunny Hot High Weak No
2 Sunny Hot High Strong No
8 Sunny Mild High Weak No
High Normal
Day outlo
ok
Temp Humid
ity
Wind Dec
isio
n
9 Sunny Cool Normal Strong Yes
11 Sunny Mild Normal Weak yes
outlook
humidity
Yes
No
Day Outlook Temp Humidity Wind Decision
4 Rain Mild High Weak Yes
5 Rain Cool Normal Weak Yes
6 Rain Cool Normal Strong No
10 Rain Mild Normal Weak Yes
14 Rain Mild High Strong No
Sunny Rain
high
Normal
Day Outloo
k
temp Humidit
y
Wind Decisio
n
4 Rain Mild High Weak Yes
5 Rain Cool Normal Weak Yes
6 Rain Cool Normal Strong No
10 Rain Mind Normal Weak Yes
14 Rain Mild High strong No
Rain outlook :
Gini (Outlook=rain and temp= mild) = 1 – (2/3)2 – (1/3)2 =0.444
Temp Yes No Number of
instance
Mild 2 1 3
Cool 1 1 2
Gini of temp. for rain outlook.
Gini (Outlook=rain and temp= cool)= 1 – (1/2)2 – (1/2)2 = 0.5
Gini (Outlook=rain and temp)= (2/5) * 0.444 + (3/5) * 0.5
= 0.466
Gini of humidity for rain outlook
Humidity Yes No Number of
instance
High 1 1 2
Normal 2 1 3
Gini (outlook=rain and Humidity =high)= 1- (1/2)2 – (1/2)2
=0.444
Gini (outlook=rain and humidity =normal)= 1- (2/3)2 - (1/3)2
= 0.466
Gini (outlook=rain and humidity )= (2/5) * 0.5 + (3/5) * 0.444
=0.466
Gini of wind for rain outlook
Wind Yes No Number of
instance
Weak 3 0 3
Strong 0 2 2
Gini (Outlook = rain and wind =weak )= 1-(3/3)2 - (0/3)2
= 0
Gini (Outlook = rain and wind =strong )= 1 – (0/2)2 - (2/2)2
= 0
Gini (Outlook = rain and wind )= (3/5) * 0 + (2/5) * 0
= 0
Decision for rain outlook:
Feature Gini index
Temperature 0.466
Humidity 0.466
Wind 0
Outlook
Wind
Day Outlook Temp Humidit
y
Wind Decision
4 Rain Mild High Weak Yes
5 Rain Cool Normal Weak Yes
10 Rain Mild Normal Weak Yes
Day Outlook Temp Humidit
y
Wind Decision
6 Rain Cool Normal Strong No
14 Rain Mild High Strong No
Weak Strong
Outlook
Humidity
No Yes
Wind
Yes No
Yes
Sunny Rain
Overcast
High Normal
Weak Strong
Ai & Ml presentation purushottam.pptx

More Related Content

Recently uploaded

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...amitlee9823
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...amitlee9823
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...amitlee9823
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...amitlee9823
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceDelhi Call girls
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...amitlee9823
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...amitlee9823
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysismanisha194592
 

Recently uploaded (20)

Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Nandini Layout ☎ 7737669865 🥵 Book Your One night Stand
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
Call Girls Jalahalli Just Call 👗 7737669865 👗 Top Class Call Girl Service Ban...
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Surabaya ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Anomaly detection and data imputation within time series
Anomaly detection and data imputation within time seriesAnomaly detection and data imputation within time series
Anomaly detection and data imputation within time series
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men  🔝Dindigul🔝   Escor...
➥🔝 7737669865 🔝▻ Dindigul Call-girls in Women Seeking Men 🔝Dindigul🔝 Escor...
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
Call Girls Hsr Layout Just Call 👗 7737669865 👗 Top Class Call Girl Service Ba...
 
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort ServiceBDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
BDSM⚡Call Girls in Mandawali Delhi >༒8448380779 Escort Service
 
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Thane West Call On 9920725232 With Body to body massage...
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
April 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's AnalysisApril 2024 - Crypto Market Report's Analysis
April 2024 - Crypto Market Report's Analysis
 

Featured

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 HubspotMarius Sescu
 
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 ChatGPTExpeed Software
 
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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

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...
 

Ai & Ml presentation purushottam.pptx

  • 1. Atal Bihari Vajpayee Vishwavidyalaya Bilaspur (C.G.) Session-2021-22 Subject-AI & ML Topic- Decision tree type Guided by: Mr. Umesh Sir Presented by: PurushottamChoudhary (Mca 2nd sem)
  • 2. CART(Classification And RegressionTree) Classification And regression tree algorithm is a classification and a regression algorithm used for building a decision tree based on Gini’s impurity index as splitting criterion
  • 3. Example: S.No. Outlook Temperature Humidity Windy Play tennis 1 Sunny Hot High Weak No 2 Sunny Hot High Strong No 3 Overcast Hot High Weak Yes 4 Rain Mild High Weak Yes 5 Rain Cool Normal Weak Yes 6 Rain Cool Normal Strong No 7 Overcast Cool Normal Strong Yes 8 Sunny Mild High Weak No 9 Sunny Cool Normal Weak Yes 10 Rain Mild Normal Weak Yes 11 Sunny Mild Normal Strong Yes 12 Overcast Mild High Strong Yes 13 Overcast Hot Normal Weak Yes 14 Rain Mild High Strong No
  • 4. Gini index is a metric for classification tasks in CART. It stores sum of squared probabilties of each class. We can formulate it as illustrated below. •Gini(Attribute value) = 1 - ∑ (Pi)2 for i= 1 to number of classes • Gini(Attributue)= ∑ Pi * GI(v) v=value Outlook: Outlook Yes No Number of instances Sunny 2 3 5 Overcast 4 0 4 Rain 3 2 5
  • 5. Gini(Outlook=Sunny)= 1 - (2/5)2 – (3/5)2 = 1 - 0.16 - 0.36 = 0.48 Gini(Outlook=Overcast) = 1 – (4/4)2 – (0/4)2 = 1 – 1 – 0 = 0 Gini(Outlook=Rainy) = 1 – (3/5)2 – (2/5)2 = 1 – 0.36 – 0.16 = 0.48 Then we will calculate weighted sum of Gini indexes for outlook feature. Gini (Outlook)= (5/14)*0.48 + (4/14)*0 + (5/14)*0.48 = 0.342
  • 6. Temperature: Temprature Yes No Number of instances Hot 2 2 4 Cool 3 1 4 Mile 4 2 6 Gini(temp=hot)= 1 – (2/4)2 – (2/4)2 = 0.5 Gini(temp=cool) = 1 – (3/4)2 – (1/4)2 = 1 – 0.5625 – 0. 0625 = 0.375 Gini(temp=mild) =1 – (4/6)2 – (2/6)2 = 1 – 0.444 – 0.111 = 0.445
  • 7. Then we will calculate weighted sum of Gini indexes for temperature feature. Gini(temp)= (4/14) * 0.5 + (4/14) * 0.375 + (6/14) * 0.444 = 0.142 + 0.107 + 0.190 = 0.439 Humidity: Humidity Yes No Number of instance High 3 4 7 Normal 6 1 7 Gini(Humidity=high) = 1 – (3/7)2 – (4/7)2 = 1 – 0.183 – 0. 326 = 0.489 Gini(Humidity=normal) = 1 – (6/7)2 – (1/7)2 = 1 – 0.734 – 0.02 = 0.244
  • 8. Then we will calculate weighted sum of Gini indexes for Humidity feature. Gini(Humidity) = (7/14) * 0.489 + (7/14) * 0.244 = 0.367 Wind: Wind Yes No Number of instance Weak 6 2 8 Strong 3 3 6 Gini(wind=weak) = 1 – (6/8)2 – (2/8)2 = 1 – 0.5625 – 0.062 = 0.375 Gini(wind=strong) = 1 – (3/6)2 – (3/6)2 = 1 – 0.25 – 0. 25 = 0.5
  • 9. Then we will calculate weighted sum of Gini indexes for wind feature. Gini(Wind) = (8/14) * 0.375 + ( 6/14) * 0. 5 = 0.428 Time to decide: Feature Gini index Outlook 0.342 Temperature 0.439 Humidity 0.367 Wind 0.428 We have calculating gini index values for each feature.The winner will be outlook feature because its cost is the lowest
  • 10. We’ll put outlook decision at the top of the tree outlook Day Outloo k temp Humidi ty Wind Deci sion 1 sunny Hot High Weak No 2 Sunny Hot High Strong No 8 Sunny Cool High Weak No 9 Sunny Mind Normal Weak Yes 11 Sunny Cool Normal strong Yes sunny Rain
  • 11. Day Outloo k temp Humidit y Wind Decisio n 1 Rain Mild High Weak Yes 2 Rain Cool Normal Weak Yes 8 Rain Cool Normal Strong No 9 Rain Mind Normal Weak Yes 11 Rain Mild High strong No Day Outlook Temp Humidity Wind Decision 3 Overcast Hot High Weak Yes 7 Overcast Cool Normal Strong Yes 12 Overcast Mild High Strong Yes 13 Overcast Hot Normal Weak Yes overcast
  • 12. First decision would be outlook feature. You might realize that the over cast leaf has only yes decision .This mean that overcast leaf is over. outlook Da y Outlo ok tem p Humidit y Wind Decisio n 1 Rain Mild High Weak Yes 2 Rain Cool Normal Weak Yes 8 Rain Cool Normal Strong No 9 Rain Mind Normal Weak Yes 11 Rain Mild High strong No sunny Rain yes overcast Tree is over for overcast outlook leaf
  • 13. Day Outloo k temp Humidit y Wind Decisio n 1 Rain Mild High Weak Yes 2 Rain Cool Normal Weak Yes 8 Rain Cool Normal Strong No 9 Rain Mind Normal Weak Yes 11 Rain Mild High strong No
  • 14. We will same principal to those sub dataset in the following step: Day Outlook temp Humidity Wind Decisio n 1 sunny Hot High Weak No 2 Sunny Hot High Strong No 8 Sunny Cool High Weak No 9 Sunny Mind Normal Weak Yes 11 Sunny Cool Normal strong Yes Gini of temperature for sunny outlook:- Temperature Yes No Number of instance Hot 0 2 2 Cool 1 0 1 Mind 1 1 2
  • 15. Gini (Outlook=Sunny andTemp= hot) =1 – (0/2)2 – (2/2)2 = 0 Gini (Outlook=Sunny andTemp= cool)= 1- (1/1)2 – (0/1)2 = 0 Gini (Outlook=Sunny andTemp= mild)= 1 – (1/2)2 – (1/2)2 = 1 – 0.25 – 0.25 = 0.5 Gini (Outlook=Sunny andTemp)= (2/5) * 0 + (1/5) * 0 + (2/5) * 0.5 = 0.2 Gini of humidity for Sunny outlook:- Humidity Yes No Decision High 0 3 3 Normal 2 0 2
  • 16. Gini(outlook=Sunny and Humidity= high) =1 – (0/3)2 – (3/3)2 = 0 Gini(outlook=Sunny and Humidity= normal) = 1 – (2/2)2 – (0/2)2 = 0 Gini(outlook=Sunny and Humidity) = (3/5) * 0 + (2/5) * 0 = 0 Gini of wind for Sunny outlook:- Wind Yes No Number of instance Weak 1 2 3 Strong 1 1 2
  • 17. Gini (Outlook =Sunny and Wind=Weak) = 1 – (1/3)2 - (2/3)2 = 0.266 Gini (Outlook=Sunny and wind= Strong) = 1- (1/2)2 – (1/2)2 = 0.2 Gini (Outlook=Sunny and Wind) = (3/5) * 0.266 + (2/5) * 0.2 = 0.466 Decision for sunny outlook:- Feature Gini index Temperature 0.2 Humidity 0 Wind 0.466 We’ve calculated Gini index score for feature when outlook is sunny.The winner is humidity because its has the lowest value.
  • 18. outlook Humidity Day Outlo ok Temp Humid ity Wind Decisi 0n 1 Sunny Hot High Weak No 2 Sunny Hot High Strong No 8 Sunny Mild High Weak No High Normal Day outlo ok Temp Humid ity Wind Dec isio n 9 Sunny Cool Normal Strong Yes 11 Sunny Mild Normal Weak yes
  • 19. outlook humidity Yes No Day Outlook Temp Humidity Wind Decision 4 Rain Mild High Weak Yes 5 Rain Cool Normal Weak Yes 6 Rain Cool Normal Strong No 10 Rain Mild Normal Weak Yes 14 Rain Mild High Strong No Sunny Rain high Normal
  • 20. Day Outloo k temp Humidit y Wind Decisio n 4 Rain Mild High Weak Yes 5 Rain Cool Normal Weak Yes 6 Rain Cool Normal Strong No 10 Rain Mind Normal Weak Yes 14 Rain Mild High strong No Rain outlook : Gini (Outlook=rain and temp= mild) = 1 – (2/3)2 – (1/3)2 =0.444 Temp Yes No Number of instance Mild 2 1 3 Cool 1 1 2 Gini of temp. for rain outlook.
  • 21. Gini (Outlook=rain and temp= cool)= 1 – (1/2)2 – (1/2)2 = 0.5 Gini (Outlook=rain and temp)= (2/5) * 0.444 + (3/5) * 0.5 = 0.466 Gini of humidity for rain outlook Humidity Yes No Number of instance High 1 1 2 Normal 2 1 3 Gini (outlook=rain and Humidity =high)= 1- (1/2)2 – (1/2)2 =0.444 Gini (outlook=rain and humidity =normal)= 1- (2/3)2 - (1/3)2 = 0.466 Gini (outlook=rain and humidity )= (2/5) * 0.5 + (3/5) * 0.444 =0.466
  • 22. Gini of wind for rain outlook Wind Yes No Number of instance Weak 3 0 3 Strong 0 2 2 Gini (Outlook = rain and wind =weak )= 1-(3/3)2 - (0/3)2 = 0 Gini (Outlook = rain and wind =strong )= 1 – (0/2)2 - (2/2)2 = 0 Gini (Outlook = rain and wind )= (3/5) * 0 + (2/5) * 0 = 0 Decision for rain outlook: Feature Gini index Temperature 0.466 Humidity 0.466 Wind 0
  • 23. Outlook Wind Day Outlook Temp Humidit y Wind Decision 4 Rain Mild High Weak Yes 5 Rain Cool Normal Weak Yes 10 Rain Mild Normal Weak Yes Day Outlook Temp Humidit y Wind Decision 6 Rain Cool Normal Strong No 14 Rain Mild High Strong No Weak Strong
  • 24. Outlook Humidity No Yes Wind Yes No Yes Sunny Rain Overcast High Normal Weak Strong