SlideShare a Scribd company logo
1 of 56
What’s in it for you?
What is a Decision Tree?
What problems can be solved using Decision Trees?
How does a Decision Tree work?
Use Case: Survival prediction in R
What is a Decision Tree?
Left or right?
What is a Decision Tree?
Wait or go? Left or right?
What is a Decision Tree?
Decision Tree is a tree shaped algorithm used to determine a course of action.
Each branch of the tree represents a possible decision, occurrence or reaction
Wait or go? Left or right?
What is a Decision Tree?
What is a Decision Tree?
Shopkeeper
What is a Decision Tree?
I must organize
my stall..
Shopkeeper
What is a Decision Tree?
Shopkeeper
What is a Decision Tree?
Is it coloured orange?
Is it round?
No Yes
YesNo
Shopkeeper
What problems can be solved using Decision Tree?
Classification:
Identifying to which set an object belongs
Example: Carrot is orange while broccoli is
green
What problems can be solved using Decision Tree?
Classification:
Identifying to which set an object belongs
Example: Carrot is orange while broccoli is
green
Regression:
Regression problems have continuous or
numerical valued output variables
Example: Predicting the profits of a company
How does a Decision Tree work?
Terms you must know
first…..
How does a Decision Tree work?
NODES
Each internal node in a decision tree is a test which splits the objects into
different categories
Is it coloured orange?
Is it round?
No Yes
YesNo
Terms you must know
first…..
How does a Decision Tree work?
Is it coloured orange?
Is it round?
No Yes
YesNoThis is a node
Terms you must know
first…..
NODES
Each internal node in a decision tree is a test which splits the objects into
different categories
How does a Decision Tree work?
Is it coloured orange?
Is it round?
No Yes
YesNo
ROOT NODE
The node at the top of the decision tree is called the Root node
Terms you must know
first…..
How does a Decision Tree work?
ROOT NODE
The node at the top of the decision tree is called the Root node
Is it coloured orange?
Is it round?
No Yes
YesNo
This is a root node
Terms you must know
first…..
How does a Decision Tree work?
LEAF NODE
Each external node in a decision tree is called the leaf node. The leaf
node is the output
Is it coloured orange?
Is it round?
No Yes
YesNo
Terms you must know
first…..
How does a Decision Tree work?
Is it coloured orange?
Is it round?
No Yes
YesNo
This is a leaf node
LEAF NODE
Each external node in a decision tree is called the leaf node. The leaf
node is the output
Terms you must know
first…..
How does a Decision Tree work?
ENTROPY
Entropy is a measure of the messiness of your data collection. The
messier or more random your data, higher will be the entropy
Terms you must know
first…..
How does a Decision Tree work?
This collection has high entropy
Terms you must know
first…..
ENTROPY
Entropy is a measure of the messiness of your data collection. The
messier or more random your data, higher will be the entropy
How does a Decision Tree work?
This collection has high entropy
This collection has low entropy
Terms you must know
first…..
ENTROPY
Entropy is a measure of the messiness of your data collection. The
messier or more random your data, higher will be the entropy
How does a Decision Tree work?
INFORMATION GAIN
Information gain is the decrease obtained in entropy by splitting the data
set based on some condition
Is it coloured orange?
Is it round?
No Yes
YesNo
E1
E2
Terms you must know
first…..
How does a Decision Tree work?
INFORMATION GAIN
Information gain is the decrease obtained in entropy by splitting the data
set based on some condition
Is it coloured orange?
Is it round?
No Yes
YesNo
E1
E2
E1>E2
INFORMATION GAIN=E1-E2
Terms you must know
first…..
How does a Decision Tree work?
Hi, my cupboard is
a mess. I must
organize my stuff..
How does a Decision Tree work?
Classify the objects based
on their attribute set using
decision trees
How does a Decision Tree work?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Let’s look at the attributes
for each object
How does a Decision Tree work?
• We split at each level based on certain
conditions on the attributes
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
• We split at each level based on certain
conditions on the attributes
• Splitting aims at reducing the entropy
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
• We split at each level based on certain
conditions on the attributes
• Splitting aims at reducing the entropy
-∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ))
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
-[2/9.log₂(2/9) + 2/9.log₂(2/9) + 1/9.log₂(1/9) + 4/9.log₂(4/9)]=
-∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ))
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
-[2/9.log₂(2/9) + 2/9.log₂(2/9) + 1/9.log₂(1/9) + 4/9.log₂(4/9)]= 1.8282
-∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ))
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
Now we must find the conditions
for our split. Every split must give
us the maximum achievable
information gain Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
How does a Decision Tree work?
Our first split will be on
shape as that will
directly segregate the
balls
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
E1 = 1.8282
How does a Decision Tree work?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
E2 = 1.3784
E1 = 1.8282
How does a Decision Tree work?
Our second split will be
on size as that will
directly segregate the
books
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
E2 = 1.3784
E1 = 1.8282
How does a Decision Tree work?
Shape == Rectangle?
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
E3 = 0.716
E2 = 1.3784
E1 = 1.8282
How does a Decision Tree work?
Our third split will
once again be on
size
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
E3 = 0.716
E2 = 1.3784
E1 = 1.8282
How does a Decision Tree work?
Size>3?
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
E3 = 0.716
E2 = 1.3784
E1 = 1.8282
E4 = 0
How does a Decision Tree work?
Size>3?
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
E2 = 1.3784
E3 = 0.716
E1 = 1.8282
E4 = 0
How does a Decision Tree work?
All our objects are now
classified with 100%
accuracy
Size>3?
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
How does a Decision Tree work?
All our objects are now
classified with 100%
accuracy
Size>3?
Size>5?
Shape Size Label Number
round 10 ball 2
rectangle 6 book 2
rectangle 4 card 1
rectangle 2 blocks 4
total 9
Shape == Rectangle?
Use Case: Survival prediction in R
Let’s implement classification of a data set based on
Information Gain
Let’s implement classification of a data set based on
Information Gain
This is the ID3 algorithm
Use Case: Survival prediction in R
Let’s implement classification of a data set based on
Information Gain
This is the ID3 algorithm
We will be using the RStudio IDE
Use Case: Survival prediction in R
• A ship had 20 lifeboats
Use Case: Survival prediction in R
• A ship had 20 lifeboats
• The lifeboats were
distributed based on the
class, gender and age of
the passengers
Use Case: Survival prediction in R
• A ship had 20 lifeboats
• The lifeboats were
distributed based on the
class, gender and age of
the passengers
• We will develop a model
that recognises the
relationship between these
factors and predicts the
survival of a passenger
accordingly
Use Case: Survival prediction in R
Use Case: Survival prediction in R
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
1 indicates the
person survived the
wreck
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
Use Case: Survival prediction in R
The luxury class
of the cabin
Use Case: Survival prediction in R
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
Numbers of siblings
on board
Use Case: Survival prediction in R
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
Numbers of parents
on board
Use Case: Survival prediction in R
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
Disembark location
Use Case: Survival prediction in R
We will be using a data set which
specifies if a passenger on a ship
survived it’s wreck or not
What is DecisionTree? Problems solved using DecisionTrees
How does a decision tree work?
Key Takeaways
Predicting survivors using R Determining accuracy of prediction
Terms to know
So what’s
your next step?

More Related Content

What's hot

Random forest
Random forestRandom forest
Random forestUjjawal
 
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Simplilearn
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioMarina Santini
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersFunctional Imperative
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Simplilearn
 
CART – Classification & Regression Trees
CART – Classification & Regression TreesCART – Classification & Regression Trees
CART – Classification & Regression TreesHemant Chetwani
 
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)Parth Khare
 
The Evolution of Data Science
The Evolution of Data ScienceThe Evolution of Data Science
The Evolution of Data ScienceKenny Daniel
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning Mohammad Junaid Khan
 
What is Apriori Algorithm | Edureka
What is Apriori Algorithm | EdurekaWhat is Apriori Algorithm | Edureka
What is Apriori Algorithm | EdurekaEdureka!
 
Chapter 4 Classification
Chapter 4 ClassificationChapter 4 Classification
Chapter 4 ClassificationKhalid Elshafie
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision treesKnoldus Inc.
 
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...Simplilearn
 
Random Forest and KNN is fun
Random Forest and KNN is funRandom Forest and KNN is fun
Random Forest and KNN is funZhen Li
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining Sulman Ahmed
 

What's hot (20)

Random forest
Random forestRandom forest
Random forest
 
Random forest
Random forestRandom forest
Random forest
 
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
Random Forest Algorithm - Random Forest Explained | Random Forest In Machine ...
 
Decision tree
Decision treeDecision tree
Decision tree
 
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain RatioLecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
Lecture 4 Decision Trees (2): Entropy, Information Gain, Gain Ratio
 
Introduction to Machine Learning Classifiers
Introduction to Machine Learning ClassifiersIntroduction to Machine Learning Classifiers
Introduction to Machine Learning Classifiers
 
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
 
CART – Classification & Regression Trees
CART – Classification & Regression TreesCART – Classification & Regression Trees
CART – Classification & Regression Trees
 
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
Machine learning basics using trees algorithm (Random forest, Gradient Boosting)
 
Decision tree
Decision treeDecision tree
Decision tree
 
The Evolution of Data Science
The Evolution of Data ScienceThe Evolution of Data Science
The Evolution of Data Science
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
 
What is Apriori Algorithm | Edureka
What is Apriori Algorithm | EdurekaWhat is Apriori Algorithm | Edureka
What is Apriori Algorithm | Edureka
 
Classification Using Decision tree
Classification Using Decision treeClassification Using Decision tree
Classification Using Decision tree
 
Chapter 4 Classification
Chapter 4 ClassificationChapter 4 Classification
Chapter 4 Classification
 
Machine Learning with Decision trees
Machine Learning with Decision treesMachine Learning with Decision trees
Machine Learning with Decision trees
 
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
Machine Learning Algorithms | Machine Learning Tutorial | Data Science Algori...
 
Random Forest and KNN is fun
Random Forest and KNN is funRandom Forest and KNN is fun
Random Forest and KNN is fun
 
Decision tree
Decision treeDecision tree
Decision tree
 
Classification in data mining
Classification in data mining Classification in data mining
Classification in data mining
 

Similar to Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machine Learning |Simplilearn

Decision tree of cart
Decision tree of cartDecision tree of cart
Decision tree of cartkalung0313
 
Revision grids-level-4
Revision grids-level-4Revision grids-level-4
Revision grids-level-4mkwoods77
 
3.1 Rounding And Estimating
3.1 Rounding And Estimating3.1 Rounding And Estimating
3.1 Rounding And EstimatingJessca Lundin
 
Fishlock Lesson One Standard Form
Fishlock Lesson One Standard FormFishlock Lesson One Standard Form
Fishlock Lesson One Standard FormHayesfield School
 
STI Sabado Percentage Rato and Proportion.pptx
STI Sabado Percentage Rato and Proportion.pptxSTI Sabado Percentage Rato and Proportion.pptx
STI Sabado Percentage Rato and Proportion.pptxGilbertTuraray1
 
Decision trees & random forests
Decision trees & random forestsDecision trees & random forests
Decision trees & random forestsSC5.io
 
Ratios And Proportions Notes
Ratios And Proportions NotesRatios And Proportions Notes
Ratios And Proportions NotesJeremy Shortess
 
arithmetic-vs-geometric.pptx
arithmetic-vs-geometric.pptxarithmetic-vs-geometric.pptx
arithmetic-vs-geometric.pptxJESSALOUCAPAPAS2
 
MATH 6-Q1-WEEK_8.pptx
MATH 6-Q1-WEEK_8.pptxMATH 6-Q1-WEEK_8.pptx
MATH 6-Q1-WEEK_8.pptxLuisSalenga1
 
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptx
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptxQ Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptx
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptxErwinJoaquinCabigao
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision TreeSuman Debnath
 

Similar to Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machine Learning |Simplilearn (20)

Decision tree of cart
Decision tree of cartDecision tree of cart
Decision tree of cart
 
Revision grids-level-4
Revision grids-level-4Revision grids-level-4
Revision grids-level-4
 
Handling data 1
Handling data 1Handling data 1
Handling data 1
 
G4ww1 4
G4ww1 4G4ww1 4
G4ww1 4
 
Decision theory & decisiontrees
Decision theory & decisiontreesDecision theory & decisiontrees
Decision theory & decisiontrees
 
BAS 250 Lecture 5
BAS 250 Lecture 5BAS 250 Lecture 5
BAS 250 Lecture 5
 
Multiplication of decimals
Multiplication of decimalsMultiplication of decimals
Multiplication of decimals
 
6323 Lab1 PowerPoint
6323 Lab1 PowerPoint6323 Lab1 PowerPoint
6323 Lab1 PowerPoint
 
MMC Math 2009
MMC Math 2009MMC Math 2009
MMC Math 2009
 
Whiz Kid 4th Grade Math
Whiz Kid 4th Grade MathWhiz Kid 4th Grade Math
Whiz Kid 4th Grade Math
 
Decision tree
Decision treeDecision tree
Decision tree
 
3.1 Rounding And Estimating
3.1 Rounding And Estimating3.1 Rounding And Estimating
3.1 Rounding And Estimating
 
Fishlock Lesson One Standard Form
Fishlock Lesson One Standard FormFishlock Lesson One Standard Form
Fishlock Lesson One Standard Form
 
STI Sabado Percentage Rato and Proportion.pptx
STI Sabado Percentage Rato and Proportion.pptxSTI Sabado Percentage Rato and Proportion.pptx
STI Sabado Percentage Rato and Proportion.pptx
 
Decision trees & random forests
Decision trees & random forestsDecision trees & random forests
Decision trees & random forests
 
Ratios And Proportions Notes
Ratios And Proportions NotesRatios And Proportions Notes
Ratios And Proportions Notes
 
arithmetic-vs-geometric.pptx
arithmetic-vs-geometric.pptxarithmetic-vs-geometric.pptx
arithmetic-vs-geometric.pptx
 
MATH 6-Q1-WEEK_8.pptx
MATH 6-Q1-WEEK_8.pptxMATH 6-Q1-WEEK_8.pptx
MATH 6-Q1-WEEK_8.pptx
 
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptx
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptxQ Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptx
Q Week 5 - CHANGING FRACTION TO DECIMAL AND VICE VERSA.pptx
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
 

More from Simplilearn

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in CybersecuritySimplilearn
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptxSimplilearn
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023 Simplilearn
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Simplilearn
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Simplilearn
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...Simplilearn
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Simplilearn
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...Simplilearn
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Simplilearn
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...Simplilearn
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Simplilearn
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Simplilearn
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Simplilearn
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...Simplilearn
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...Simplilearn
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...Simplilearn
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...Simplilearn
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Simplilearn
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...Simplilearn
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...Simplilearn
 

More from Simplilearn (20)

ChatGPT in Cybersecurity
ChatGPT in CybersecurityChatGPT in Cybersecurity
ChatGPT in Cybersecurity
 
Whatis SQL Injection.pptx
Whatis SQL Injection.pptxWhatis SQL Injection.pptx
Whatis SQL Injection.pptx
 
Top 5 High Paying Cloud Computing Jobs in 2023
 Top 5 High Paying Cloud Computing Jobs in 2023  Top 5 High Paying Cloud Computing Jobs in 2023
Top 5 High Paying Cloud Computing Jobs in 2023
 
Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024Types Of Cloud Jobs In 2024
Types Of Cloud Jobs In 2024
 
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
Top 12 AI Technologies To Learn 2024 | Top AI Technologies in 2024 | AI Trend...
 
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
What is LSTM ?| Long Short Term Memory Explained with Example | Deep Learning...
 
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
Top 10 Chat GPT Use Cases | ChatGPT Applications | ChatGPT Tutorial For Begin...
 
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
React JS Vs Next JS - What's The Difference | Next JS Tutorial For Beginners ...
 
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
Backpropagation in Neural Networks | Back Propagation Algorithm with Examples...
 
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
How to Become a Business Analyst ?| Roadmap to Become Business Analyst | Simp...
 
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
Career Opportunities In Artificial Intelligence 2023 | AI Job Opportunities |...
 
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
Programming for Beginners | How to Start Coding in 2023? | Introduction to Pr...
 
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
Best IDE for Programming in 2023 | Top 8 Programming IDE You Should Know | Si...
 
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
React 18 Overview | React 18 New Features and Changes | React 18 Tutorial 202...
 
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
What Is Next JS ? | Introduction to Next JS | Basics of Next JS | Next JS Tut...
 
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
How To Become an SEO Expert In 2023 | SEO Expert Tutorial | SEO For Beginners...
 
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
WordPress Tutorial for Beginners 2023 | What Is WordPress and How Does It Wor...
 
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
Blogging For Beginners 2023 | How To Create A Blog | Blogging Tutorial | Simp...
 
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
How To Start A Blog In 2023 | Pros And Cons Of Blogging | Blogging Tutorial |...
 
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
How to Increase Website Traffic ? | 10 Ways To Increase Website Traffic in 20...
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machine Learning |Simplilearn

  • 1.
  • 2. What’s in it for you? What is a Decision Tree? What problems can be solved using Decision Trees? How does a Decision Tree work? Use Case: Survival prediction in R
  • 3. What is a Decision Tree?
  • 4. Left or right? What is a Decision Tree?
  • 5. Wait or go? Left or right? What is a Decision Tree?
  • 6. Decision Tree is a tree shaped algorithm used to determine a course of action. Each branch of the tree represents a possible decision, occurrence or reaction Wait or go? Left or right? What is a Decision Tree?
  • 7. What is a Decision Tree? Shopkeeper
  • 8. What is a Decision Tree? I must organize my stall.. Shopkeeper
  • 9. What is a Decision Tree? Shopkeeper
  • 10. What is a Decision Tree? Is it coloured orange? Is it round? No Yes YesNo Shopkeeper
  • 11. What problems can be solved using Decision Tree? Classification: Identifying to which set an object belongs Example: Carrot is orange while broccoli is green
  • 12. What problems can be solved using Decision Tree? Classification: Identifying to which set an object belongs Example: Carrot is orange while broccoli is green Regression: Regression problems have continuous or numerical valued output variables Example: Predicting the profits of a company
  • 13. How does a Decision Tree work? Terms you must know first…..
  • 14. How does a Decision Tree work? NODES Each internal node in a decision tree is a test which splits the objects into different categories Is it coloured orange? Is it round? No Yes YesNo Terms you must know first…..
  • 15. How does a Decision Tree work? Is it coloured orange? Is it round? No Yes YesNoThis is a node Terms you must know first….. NODES Each internal node in a decision tree is a test which splits the objects into different categories
  • 16. How does a Decision Tree work? Is it coloured orange? Is it round? No Yes YesNo ROOT NODE The node at the top of the decision tree is called the Root node Terms you must know first…..
  • 17. How does a Decision Tree work? ROOT NODE The node at the top of the decision tree is called the Root node Is it coloured orange? Is it round? No Yes YesNo This is a root node Terms you must know first…..
  • 18. How does a Decision Tree work? LEAF NODE Each external node in a decision tree is called the leaf node. The leaf node is the output Is it coloured orange? Is it round? No Yes YesNo Terms you must know first…..
  • 19. How does a Decision Tree work? Is it coloured orange? Is it round? No Yes YesNo This is a leaf node LEAF NODE Each external node in a decision tree is called the leaf node. The leaf node is the output Terms you must know first…..
  • 20. How does a Decision Tree work? ENTROPY Entropy is a measure of the messiness of your data collection. The messier or more random your data, higher will be the entropy Terms you must know first…..
  • 21. How does a Decision Tree work? This collection has high entropy Terms you must know first….. ENTROPY Entropy is a measure of the messiness of your data collection. The messier or more random your data, higher will be the entropy
  • 22. How does a Decision Tree work? This collection has high entropy This collection has low entropy Terms you must know first….. ENTROPY Entropy is a measure of the messiness of your data collection. The messier or more random your data, higher will be the entropy
  • 23. How does a Decision Tree work? INFORMATION GAIN Information gain is the decrease obtained in entropy by splitting the data set based on some condition Is it coloured orange? Is it round? No Yes YesNo E1 E2 Terms you must know first…..
  • 24. How does a Decision Tree work? INFORMATION GAIN Information gain is the decrease obtained in entropy by splitting the data set based on some condition Is it coloured orange? Is it round? No Yes YesNo E1 E2 E1>E2 INFORMATION GAIN=E1-E2 Terms you must know first…..
  • 25. How does a Decision Tree work? Hi, my cupboard is a mess. I must organize my stuff..
  • 26. How does a Decision Tree work? Classify the objects based on their attribute set using decision trees
  • 27. How does a Decision Tree work? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Let’s look at the attributes for each object
  • 28. How does a Decision Tree work? • We split at each level based on certain conditions on the attributes Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 29. How does a Decision Tree work? • We split at each level based on certain conditions on the attributes • Splitting aims at reducing the entropy Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 30. How does a Decision Tree work? • We split at each level based on certain conditions on the attributes • Splitting aims at reducing the entropy -∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ)) Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 31. How does a Decision Tree work? -[2/9.log₂(2/9) + 2/9.log₂(2/9) + 1/9.log₂(1/9) + 4/9.log₂(4/9)]= -∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ)) Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 32. How does a Decision Tree work? -[2/9.log₂(2/9) + 2/9.log₂(2/9) + 1/9.log₂(1/9) + 4/9.log₂(4/9)]= 1.8282 -∑ⁱₓ₌₁p(valueₓ).log₂(p(valueₓ)) Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 33. How does a Decision Tree work? Now we must find the conditions for our split. Every split must give us the maximum achievable information gain Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9
  • 34. How does a Decision Tree work? Our first split will be on shape as that will directly segregate the balls Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 E1 = 1.8282
  • 35. How does a Decision Tree work? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle? E2 = 1.3784 E1 = 1.8282
  • 36. How does a Decision Tree work? Our second split will be on size as that will directly segregate the books Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle? E2 = 1.3784 E1 = 1.8282
  • 37. How does a Decision Tree work? Shape == Rectangle? Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 E3 = 0.716 E2 = 1.3784 E1 = 1.8282
  • 38. How does a Decision Tree work? Our third split will once again be on size Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle? E3 = 0.716 E2 = 1.3784 E1 = 1.8282
  • 39. How does a Decision Tree work? Size>3? Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle? E3 = 0.716 E2 = 1.3784 E1 = 1.8282 E4 = 0
  • 40. How does a Decision Tree work? Size>3? Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle? E2 = 1.3784 E3 = 0.716 E1 = 1.8282 E4 = 0
  • 41. How does a Decision Tree work? All our objects are now classified with 100% accuracy Size>3? Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle?
  • 42. How does a Decision Tree work? All our objects are now classified with 100% accuracy Size>3? Size>5? Shape Size Label Number round 10 ball 2 rectangle 6 book 2 rectangle 4 card 1 rectangle 2 blocks 4 total 9 Shape == Rectangle?
  • 43. Use Case: Survival prediction in R Let’s implement classification of a data set based on Information Gain
  • 44. Let’s implement classification of a data set based on Information Gain This is the ID3 algorithm Use Case: Survival prediction in R
  • 45. Let’s implement classification of a data set based on Information Gain This is the ID3 algorithm We will be using the RStudio IDE Use Case: Survival prediction in R
  • 46. • A ship had 20 lifeboats Use Case: Survival prediction in R
  • 47. • A ship had 20 lifeboats • The lifeboats were distributed based on the class, gender and age of the passengers Use Case: Survival prediction in R
  • 48. • A ship had 20 lifeboats • The lifeboats were distributed based on the class, gender and age of the passengers • We will develop a model that recognises the relationship between these factors and predicts the survival of a passenger accordingly Use Case: Survival prediction in R
  • 49. Use Case: Survival prediction in R We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not
  • 50. 1 indicates the person survived the wreck We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not Use Case: Survival prediction in R
  • 51. The luxury class of the cabin Use Case: Survival prediction in R We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not
  • 52. Numbers of siblings on board Use Case: Survival prediction in R We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not
  • 53. Numbers of parents on board Use Case: Survival prediction in R We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not
  • 54. Disembark location Use Case: Survival prediction in R We will be using a data set which specifies if a passenger on a ship survived it’s wreck or not
  • 55. What is DecisionTree? Problems solved using DecisionTrees How does a decision tree work? Key Takeaways Predicting survivors using R Determining accuracy of prediction Terms to know

Editor's Notes

  1. Style - 01
  2. Style - 01
  3. Style - 01
  4. Style - 01
  5. Style - 01
  6. Style - 01
  7. Style - 01
  8. Style - 01
  9. Style - 01
  10. Style - 01
  11. Style - 01
  12. Style - 01
  13. Style - 01
  14. Style - 01
  15. Style - 01
  16. Style - 01
  17. Style - 01
  18. Style - 01
  19. Style - 01
  20. Style - 01
  21. Style - 01
  22. Style - 01
  23. Style - 01
  24. Style - 01
  25. Style - 01
  26. Style - 01
  27. Style - 01
  28. Style - 01
  29. Style - 01
  30. Style - 01
  31. Style - 01
  32. Style - 01
  33. Style - 01
  34. Style - 01
  35. Style - 01
  36. Style - 01
  37. Style - 01
  38. Style - 01
  39. Style - 01
  40. Style - 01
  41. Style - 01
  42. Style - 01
  43. Style - 01
  44. Style - 01
  45. Style - 01
  46. Style - 01
  47. Style - 01
  48. Style - 01
  49. Style - 01
  50. Style - 01
  51. Style - 01
  52. Style - 01
  53. Style - 01
  54. Style - 01