SlideShare a Scribd company logo
RegressionTrees
Hno lot Income Class Class
1 18.4 60 0 Owner
2 16.8 85.5 0 Owner
3 21.6 64.8 0 Owner
4 20.8 61.5 0 Owner
5 23.6 87 0 Owner
6 19.2 110.1 0 Owner
7 17.6 108 0 Owner
8 22.4 82.8 0 Owner
9 20 69 0 Owner
10 20.8 93 0 Owner
11 22 51 0 Owner
12 20 81 0 Owner
13 19.6 75 1 Non Owner
14 20.8 52.8 1 Non Owner
15 17.2 64.8 1 Non Owner
16 20.4 43.2 1 Non Owner
17 17.6 84 1 Non Owner
18 17.6 49.2 1 Non Owner
19 16 59.4 1 Non Owner
20 18.4 66 1 Non Owner
21 16.4 47.4 1 Non Owner
22 18.8 33 1 Non Owner
23 14 51 1 Non Owner
24 14.8 63 1 Non Owner
Median 19 64.8
Scatterplot of Lot Size vs. Income for 24 owners and non-owners of riding mowers
Gini Index (Class) = (1 − ∑ 𝑝𝑖
2
𝑛
𝑖=1 )
Non Owner=12
Owner=12
Gini (class) = (1-(12/24)2+(12/24)2) = 0
Median of lot = 19
Splitting the 24 observations by Lot Size value of 19 approximately
Lot <=19 (Lower Rectangle)
lot Income Class Class
14 51 1 Non Owner
14.8 63 1 Non Owner
16 59.4 1 Non Owner
16.4 47.4 1 Non Owner
16.8 85.5 0 Owner
17.2 64.8 1 Non Owner
17.6 108 0 Owner
17.6 84 1 Non Owner
17.6 49.2 1 Non Owner
18.4 60 0 Owner
18.4 66 1 Non Owner
18.8 33 1 Non Owner
Gini(lot - LR) = (1 – (3/12)2 – (9/12)2) = 0.375
Lot>19 (Upper Rectangle)
lot Income Class Class
19.2 110.1 0 Owner
19.6 75 1 Non Owner
20 69 0 Owner
20 81 0 Owner
20.4 43.2 1 Non Owner
20.8 61.5 0 Owner
20.8 93 0 Owner
20.8 52.8 1 Non Owner
21.6 64.8 0 Owner
22 51 0 Owner
22.4 82.8 0 Owner
23.6 87 0 Owner
Gini(lot - UR) = (1 – (9/12)2 – (3/12)2) = 0.375
Avg of LR and UR = 12/24(0.375)+12/24(0.375) = 0.375
Median(Income) = 64.8
Income<=64.8 (Lower Rectangle)
lot Income Class Class
18.8 33 1 Non Owner
20.4 43.2 1 Non Owner
16.4 47.4 1 Non Owner
17.6 49.2 1 Non Owner
22 51 0 Owner
14 51 1 Non Owner
20.8 52.8 1 Non Owner
16 59.4 1 Non Owner
18.4 60 0 Owner
20.8 61.5 0 Owner
14.8 63 1 Non Owner
21.6 64.8 0 Owner
17.2 64.8 1 Non Owner
Gini(Income) = (1 – (4/13)2 – (9/13)2) = 0.4261
Income>64.8 (Upper Rectangle)
lot Income Class Class
18.4 66 1 Non Owner
20 69 0 Owner
19.6 75 1 Non Owner
20 81 0 Owner
22.4 82.8 0 Owner
17.6 84 1 Non Owner
16.8 85.5 0 Owner
23.6 87 0 Owner
20.8 93 0 Owner
17.6 108 0 Owner
19.2 110.1 0 Owner
Gini(Income) = (1 – (8/11)2 – (3/11)2) = 0.3967
Avg of LR and UR = 14/24(0.4261)+11/24(0.397) = 0.431
Lot Income
0.375 (Min) 0.431
Minimum Gini Avg is for Lot. So choose lot as root
Tree: Step 1 – Identifying the root
Sort Lower rectangle of Lot <=19 with respect to Income and try analysing the class and
finalize the income points after which the classes has never changed. Its 84 and 85.5.
Median(84, 85.5) = 84.75
Lot
19
12 12
LR of Lot<=19
lot Income Class Class
18.8 33 1 Non Owner
16.4 47.4 1 Non Owner
17.6 49.2 1 Non Owner
14 51 1 Non Owner
16 59.4 1 Non Owner
18.4 60 0 Owner
14.8 63 1 Non Owner
17.2 64.8 1 Non Owner
18.4 66 1 Non Owner
17.6 84 1 Non Owner
16.8 85.5 0 Owner
17.6 108 0 Owner
If we continue splitting the mower data, the next split is on the Income variable at the value
84.75.
Splitting the 24 observations by Lot Size value of 19K, and then Income value of 84.75K
LR of Lot<=19 and Income <=84.75
lot Income Class Class
18.8 33 1 Non Owner
16.4 47.4 1 Non Owner
17.6 49.2 1 Non Owner
14 51 1 Non Owner
16 59.4 1 Non Owner
18.4 60 0 Owner
14.8 63 1 Non Owner
17.2 64.8 1 Non Owner
18.4 66 1 Non Owner
17.6 84 1 Non Owner
LR of Lot<=19 and Income >84.75
lot Income Class Class
16.8 85.5 0 Owner
17.6 108 0 Owner
Sort Lower rectangle of Lot <=19, Income <=84.75 with respect to the class and finalize the
lot points after which the classes has never changed. Its 17.6 and 18.4.
Median(17.6,18.4) = 18
LR of Lot<=19, Income <=84.75, Lot <=18
lot Income Class Class
14 51 1 Non Owner
14.8 63 1 Non Owner
16 59.4 1 Non Owner
16.4 47.4 1 Non Owner
17.2 64.8 1 Non Owner
17.6 49.2 1 Non Owner
17.6 84 1 Non Owner
2
Lot
19
12 12
Income
84.75
Owner
10
LR of Lot<=19, Income <=84.75, Lot >18
lot Income Class Class
18.4 66 1 Non Owner
18.4 60 0 Owner
18.8 33 1 Non Owner
Sort Lower rectangle of Lot <=19, Income <=84.75, Lot>18 with respect to the class and
finalize the lot points after which the classes has never changed. Its 18.8 and 18.4.
Median(18.8,18.4) = 18.6
LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6
lot Income Class Class
18.4 66 1 Non Owner
18.4 60 0 Owner
LR of Lot<=19, Income <=84.75, Lot >18, Lot>18.6
lot Income Class Class
18.8 33 1 Non Owner
2
Lot
19
12 12
Income
84.75
Owner
10
Lot
18
7
Non
Owner
3
LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6
lot Income Class Class
18.4 66 1 Non Owner
18.4 60 0 Owner
Sort Lower rectangle of Lot <=19, Income <=84.75, Lot>18, Lot<=18.6 with respect to the
class and finalize the income points after which the classes has never changed. Its 60 and 66
Median(66,60) = 63
LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6, Income<=63
lot Income Class Class
18.4 60 0 Owner
LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6, Income>63
lot Income Class Class
18.4 66 1 Non Owner
2
Lot
19
12 12
Income
84.75
Owner
10
Lot
18
7
Non
Owner
3
Lot
18.6
1
Non
Owner
2
Final Left Regression Tree
Predict Income = 55 Lot = 18.5
Income
63
2
Lot
19
12 12
Income
84.75
Owner
10
Lot
18
7
Non
Owner
3
Lot
18.6
1
Non
Owner
2
1
1
Owner Non
Owner
Predict Income = 55 Lot = 18.5
Income
46.5
2
Lot
19
12 12
Income
84.75
Owner
10
Lot
18
7
Non
Owner
3
Income
63
1
Non
Owner
1
1
Non
Owner Owner

More Related Content

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 Hubspot
Marius 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 ChatGPT
Expeed 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 Engineerings
Pixeldarts
 
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
 
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
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
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
Neil 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 2024
Albert 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 Insights
Kurio // 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 2024
Search 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 summary
SpeakerHub
 
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 Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit 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 management
MindGenius
 
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...
 

Regression trees

  • 1. RegressionTrees Hno lot Income Class Class 1 18.4 60 0 Owner 2 16.8 85.5 0 Owner 3 21.6 64.8 0 Owner 4 20.8 61.5 0 Owner 5 23.6 87 0 Owner 6 19.2 110.1 0 Owner 7 17.6 108 0 Owner 8 22.4 82.8 0 Owner 9 20 69 0 Owner 10 20.8 93 0 Owner 11 22 51 0 Owner 12 20 81 0 Owner 13 19.6 75 1 Non Owner 14 20.8 52.8 1 Non Owner 15 17.2 64.8 1 Non Owner 16 20.4 43.2 1 Non Owner 17 17.6 84 1 Non Owner 18 17.6 49.2 1 Non Owner 19 16 59.4 1 Non Owner 20 18.4 66 1 Non Owner 21 16.4 47.4 1 Non Owner 22 18.8 33 1 Non Owner 23 14 51 1 Non Owner 24 14.8 63 1 Non Owner Median 19 64.8 Scatterplot of Lot Size vs. Income for 24 owners and non-owners of riding mowers
  • 2. Gini Index (Class) = (1 − ∑ 𝑝𝑖 2 𝑛 𝑖=1 ) Non Owner=12 Owner=12 Gini (class) = (1-(12/24)2+(12/24)2) = 0 Median of lot = 19 Splitting the 24 observations by Lot Size value of 19 approximately Lot <=19 (Lower Rectangle) lot Income Class Class 14 51 1 Non Owner 14.8 63 1 Non Owner 16 59.4 1 Non Owner 16.4 47.4 1 Non Owner 16.8 85.5 0 Owner 17.2 64.8 1 Non Owner 17.6 108 0 Owner 17.6 84 1 Non Owner 17.6 49.2 1 Non Owner 18.4 60 0 Owner 18.4 66 1 Non Owner 18.8 33 1 Non Owner Gini(lot - LR) = (1 – (3/12)2 – (9/12)2) = 0.375
  • 3. Lot>19 (Upper Rectangle) lot Income Class Class 19.2 110.1 0 Owner 19.6 75 1 Non Owner 20 69 0 Owner 20 81 0 Owner 20.4 43.2 1 Non Owner 20.8 61.5 0 Owner 20.8 93 0 Owner 20.8 52.8 1 Non Owner 21.6 64.8 0 Owner 22 51 0 Owner 22.4 82.8 0 Owner 23.6 87 0 Owner Gini(lot - UR) = (1 – (9/12)2 – (3/12)2) = 0.375 Avg of LR and UR = 12/24(0.375)+12/24(0.375) = 0.375 Median(Income) = 64.8 Income<=64.8 (Lower Rectangle) lot Income Class Class 18.8 33 1 Non Owner 20.4 43.2 1 Non Owner 16.4 47.4 1 Non Owner 17.6 49.2 1 Non Owner 22 51 0 Owner 14 51 1 Non Owner 20.8 52.8 1 Non Owner 16 59.4 1 Non Owner 18.4 60 0 Owner 20.8 61.5 0 Owner 14.8 63 1 Non Owner 21.6 64.8 0 Owner 17.2 64.8 1 Non Owner Gini(Income) = (1 – (4/13)2 – (9/13)2) = 0.4261
  • 4. Income>64.8 (Upper Rectangle) lot Income Class Class 18.4 66 1 Non Owner 20 69 0 Owner 19.6 75 1 Non Owner 20 81 0 Owner 22.4 82.8 0 Owner 17.6 84 1 Non Owner 16.8 85.5 0 Owner 23.6 87 0 Owner 20.8 93 0 Owner 17.6 108 0 Owner 19.2 110.1 0 Owner Gini(Income) = (1 – (8/11)2 – (3/11)2) = 0.3967 Avg of LR and UR = 14/24(0.4261)+11/24(0.397) = 0.431 Lot Income 0.375 (Min) 0.431 Minimum Gini Avg is for Lot. So choose lot as root Tree: Step 1 – Identifying the root Sort Lower rectangle of Lot <=19 with respect to Income and try analysing the class and finalize the income points after which the classes has never changed. Its 84 and 85.5. Median(84, 85.5) = 84.75 Lot 19 12 12
  • 5. LR of Lot<=19 lot Income Class Class 18.8 33 1 Non Owner 16.4 47.4 1 Non Owner 17.6 49.2 1 Non Owner 14 51 1 Non Owner 16 59.4 1 Non Owner 18.4 60 0 Owner 14.8 63 1 Non Owner 17.2 64.8 1 Non Owner 18.4 66 1 Non Owner 17.6 84 1 Non Owner 16.8 85.5 0 Owner 17.6 108 0 Owner If we continue splitting the mower data, the next split is on the Income variable at the value 84.75. Splitting the 24 observations by Lot Size value of 19K, and then Income value of 84.75K LR of Lot<=19 and Income <=84.75 lot Income Class Class 18.8 33 1 Non Owner 16.4 47.4 1 Non Owner 17.6 49.2 1 Non Owner 14 51 1 Non Owner 16 59.4 1 Non Owner 18.4 60 0 Owner 14.8 63 1 Non Owner 17.2 64.8 1 Non Owner 18.4 66 1 Non Owner 17.6 84 1 Non Owner
  • 6. LR of Lot<=19 and Income >84.75 lot Income Class Class 16.8 85.5 0 Owner 17.6 108 0 Owner Sort Lower rectangle of Lot <=19, Income <=84.75 with respect to the class and finalize the lot points after which the classes has never changed. Its 17.6 and 18.4. Median(17.6,18.4) = 18 LR of Lot<=19, Income <=84.75, Lot <=18 lot Income Class Class 14 51 1 Non Owner 14.8 63 1 Non Owner 16 59.4 1 Non Owner 16.4 47.4 1 Non Owner 17.2 64.8 1 Non Owner 17.6 49.2 1 Non Owner 17.6 84 1 Non Owner 2 Lot 19 12 12 Income 84.75 Owner 10
  • 7. LR of Lot<=19, Income <=84.75, Lot >18 lot Income Class Class 18.4 66 1 Non Owner 18.4 60 0 Owner 18.8 33 1 Non Owner Sort Lower rectangle of Lot <=19, Income <=84.75, Lot>18 with respect to the class and finalize the lot points after which the classes has never changed. Its 18.8 and 18.4. Median(18.8,18.4) = 18.6 LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6 lot Income Class Class 18.4 66 1 Non Owner 18.4 60 0 Owner LR of Lot<=19, Income <=84.75, Lot >18, Lot>18.6 lot Income Class Class 18.8 33 1 Non Owner 2 Lot 19 12 12 Income 84.75 Owner 10 Lot 18 7 Non Owner 3
  • 8. LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6 lot Income Class Class 18.4 66 1 Non Owner 18.4 60 0 Owner Sort Lower rectangle of Lot <=19, Income <=84.75, Lot>18, Lot<=18.6 with respect to the class and finalize the income points after which the classes has never changed. Its 60 and 66 Median(66,60) = 63 LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6, Income<=63 lot Income Class Class 18.4 60 0 Owner LR of Lot<=19, Income <=84.75, Lot >18, Lot<=18.6, Income>63 lot Income Class Class 18.4 66 1 Non Owner 2 Lot 19 12 12 Income 84.75 Owner 10 Lot 18 7 Non Owner 3 Lot 18.6 1 Non Owner 2
  • 9. Final Left Regression Tree Predict Income = 55 Lot = 18.5 Income 63 2 Lot 19 12 12 Income 84.75 Owner 10 Lot 18 7 Non Owner 3 Lot 18.6 1 Non Owner 2 1 1 Owner Non Owner
  • 10. Predict Income = 55 Lot = 18.5 Income 46.5 2 Lot 19 12 12 Income 84.75 Owner 10 Lot 18 7 Non Owner 3 Income 63 1 Non Owner 1 1 Non Owner Owner