SlideShare a Scribd company logo
Machine Learning Using Python
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Agenda for Today’s Session
▪ What is Classification?
▪ Types of Classification
▪ Classification Use case
▪ What is Decision Tree?
▪ Terminologies associated to a Decision Tree
▪ Visualizing a Decision Tree
▪ Writing a Decision Tree Classifier form Scratch in Python using
CART Algorithm
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
What is Classification?
Machine Leaning Training Using Python
“Classification is the process of dividing the datasets
into different categories or groups by adding label”
What is
Classification?
▪ Note: It adds the data point to a particular
labelled group on the basis of some condition”
Types of
Classification
Decision Tree
Random Forest
Naïve Bayes
KNN
Decision Tree
▪ Graphical representation of all the possible solutions to a decision
▪ Decisions are based on some conditions
▪ Decision made can be easily explained
Types of
Classification
Decision Tree
Random Forest
Naïve Bayes
KNN
Random Forest
▪ Builds multiple decision trees and merges them together
▪ More accurate and stable prediction
▪ Random decision forests correct for decision trees' habit
of overfitting to their training set
▪ Trained with the “bagging” method
Types of
Classification
Decision Tree
Random Forest
Naïve Bayes
KNN
Naïve Bayes
▪ Classification technique based on Bayes' Theorem
▪ Assumes that the presence of a particular feature in a class is
unrelated to the presence of any other feature
Types of
Classification
Decision Tree
Random Forest
Naïve Bayes
KNN
K-Nearest Neighbors
▪ Stores all the available cases and classifies new cases
based on a similarity measure
▪ The “K” is KNN algorithm is the nearest neighbors we wish
to take vote from.
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
What is Decision Tree?
Machine Leaning Training Using Python
“A decision tree is a graphical representation of all
the possible solutions to a decision based on certain
conditions”
What is
Decision Tree?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
Understanding a Decision Tree
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Colour Diameter Label
Green 3 Mango
Yellow 3 Mango
Red 1 Grape
Red 1 Grape
Yellow 3 Lemon
Dataset
This is how our dataset looks like!
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
`
Decision
Tree
is diameter > = 3?
Color Diam Label
Green 3 Mango
Yellow 3 Lemon
Red 1 Grape
Yellow 3 Mango
Red 1 Grape
G 3 Mango
Y 3 Mango
Y 3 Lemon
R 1 Grape
R 1 Grape
is colour = = Yellow?
Y 3 Mango
Y 3 Lemon
G 3 Mango
Gini Impurity = 0.44
Gini Impurity = 0
Information Gain = 0.37
Information
Gain = 0.11
100% Grape
100% Mango
50% Mango
50% Lemon
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Is the colour green?
Is the diameter >=3
Is the colour yellow
TRUE False
Green 3 Mango
Yellow 3 Lemon
Yellow 3 Mango
`
What is
Decision Tree?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
Decision Tree Terminologies
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Decision Tree Terminology
Pruning
Opposite of Splitting, basically
removing unwanted branches from
the tree
Root Node
It represents the entire population or
sample and this further gets divided
into two or more homogenous sets.
Parent/Child Node
Root node is the parent node and all
the other nodes branched from it is
known as child node
Splitting
Splitting is dividing the root node/sub
node into different parts on the basis
of some condition.
Leaf Node
Node cannot be further segregated
into further nodes
Branch/SubTree
Formed by splitting the tree/node
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
is diameter > = 3?
Color Diam Label
Green 3 Mango
Yellow 3 Lemon
Red 1 Grape
Yellow 3 Mango
Red 1 Grape
is colour = = Yellow?
G 3 Mango
Y 3 Mango
Y 3 Lemon
R 1 Grape
R 1 Grape
100% Grape Y 3 Mango
Y 3 Lemon
100% Mango
50% Mango
50% Lemon
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
CART Algorithm
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Let’s First Visualize the Decision Tree
Which Question to ask and When?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Let’s First Visualize the Decision Tree
No
Yes
NormalHigh
Yes
WeakStrong
No Yes
Outlook
WindyHumidity
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Learn about Decision Tree
Which one among them
should you pick first?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Learn about Decision Tree
Answer: Determine the
attribute that best
classifies the training data
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Learn about Decision Tree
But How do we choose
the best attribute?
Or
How does a tree decide
where to split?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
How Does A Tree Decide Where To Split?
Information Gain
The information gain is the decrease in
entropy after a dataset is split on the basis
of an attribute. Constructing a decision tree
is all about finding attribute that returns the
highest information gain
Gini Index
The measure of impurity (or purity) used in
building decision tree in CART is Gini Index
Reduction in Variance
Reduction in variance is an algorithm used
for continuous target variables (regression
problems). The split with lower variance is
selected as the criteria to split the
population
Chi Square
It is an algorithm to find out the statistical
significance between the differences
between sub-nodes and parent node
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Let’s First Understand What is Impurity
Impurity = 0
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Let’s First Understand What is Impurity
Impurity ≠ 0
What is
Entropy?
▪ Defines randomness in the data
▪ Entropy is just a metric which measures the impurity or
▪ The first step to solve the problem of a decision tree
What is
Entropy?
If number of yes = number of no ie P(S) = 0.5
 Entropy(s) = 1
If it contains all yes or all no ie P(S) = 1 or 0
 Entropy(s) = 0
- P(yes) log2 P(yes) − P(no) log2 P(no)Entropy(s) =
Where,
▪ S is the total sample space,
▪ P(yes) is probability of yes
What is
Entropy?
E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠)
When P(Yes) =P(No) = 0.5 ie YES + NO = Total Sample(S)
E(S) = 0.5 log2 0.5 − 0.5 log2 0.5
E(S) = 0.5( log2 0.5 - log2 0.5)
E(S) = 1
What is
Entropy?
E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠)
When P(Yes) = 1 ie YES = Total Sample(S)
E(S) = 1 log2 1
E(S) = 0
E(S) = -P(No) log2 𝑃(𝑁𝑜)
When P(No) = 1 ie No = Total Sample(S)
E(S) = 1 log2 1
E(S) = 0
What is
Information
Gain?
▪ Measures the reduction in entropy
▪ Decides which attribute should be selected as the
decision node
If S is our total collection,
Information Gain = Entropy(S) – [(Weighted Avg) x Entropy(each feature)]
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
Let’s Build Our Decision Tree
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Out of 14 instances we have 9 YES and 5 NO
So we have the formula,
E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠) − P(No) log2 𝑃(𝑁𝑜)
E(S) = - (9/14)* log2 9/14 - (5/14)* log2 5/14
E(S) = 0.41+0.53 = 0.94
Step 1: Compute the entropy for the Data set
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
D12
D13
D14
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node?
Outlook? Temperature?
Humidity? Windy?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node: Outlook
Outlook?
Sunny Overcast
Yes
Yes
No
No
No
Yes
Yes
Yes
Yes
Rainy
Yes
Yes
Yes
No
No
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node: Outlook
E(Outlook = Sunny) = -2/5 log2 2/5 − 3/5 log2 3/5 = 0.971
E(Outlook = Overcast) = -1 log2 1
E(Outlook = Sunny) = -3/5 log2 3/5
− 0 log2 0 = 0
− 2/5 log2 2/5 = 0.971
I(Outlook) = 5/14 x 0.971 + 4/14 x 0 + 5/14 x 0.971 = 0.693
Information from outlook,
Information gained from outlook,
Gain(Outlook) = E(S) – I(Outlook)
0.94 – 0.693 = 0.247
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node: Outlook
Windy?
False
Yes
Yes
Yes
Yes
Yes
Yes
No
No
True
Yes
Yes
Yes
No
No
No
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node: Windy
E(Windy = True) = 1
E(Windy = False) = 0.811
I(Windy) = 8/14 x 0.811+ 6/14 x 1 = 0.892
Information from windy,
Information gained from outlook,
Gain(Windy) = E(S) – I(Windy)
0.94 – 0.892 = 0.048
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
Similarly We Calculated For Rest Two
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select As Root Node
Outlook:
Info 0.693
Gain: 0.940-0.693 0.247
Temperature:
Info 0.911
Gain: 0.940-0.911 0.029
Windy:
Info 0.892
Gain: 0.940-0.982 0.048
Humidity:
Info 0.788
Gain: 0.940-0.788 0.152
Since Max gain = 0.247,
Outlook is our ROOT Node
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Which Node To Select Further?
Outlook
Yes ??
Overcast
Outlook = overcast
Contains only yes
You need to
recalculate things
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
This Is How Your Complete Tree Will Look Like
No
Yes
NormalHigh
Yes
WeakStrong
No Yes
Outlook
WindyHumidity
Overcast
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
What Should I Do To Play - Pruning
“A decision tree is a graphical representation of all
the possible solutions to a decision based on certain
conditions”
What is
Pruning?
Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python
Pruning: Reducing The Complexity
Yes
Normal
Yes
Weak
Yes
Outlook
WindyHumidity
Copyright © 2018, edureka and/or its affiliates. All rights reserved.
Machine Leaning
Training Using
Python
Are tree based models better than
linear models?
Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka
Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka

More Related Content

What's hot (20)

Random forest algorithm
Random forest algorithmRandom forest algorithm
Random forest algorithm
Rashid Ansari
 
Decision tree
Decision treeDecision tree
Decision tree
Soujanya V
 
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Edureka!
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
Mohammad Junaid Khan
 
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Simplilearn
 
Decision Tree - C4.5&CART
Decision Tree - C4.5&CARTDecision Tree - C4.5&CART
Decision Tree - C4.5&CART
Xueping Peng
 
Stochastic Gradient Decent (SGD).pptx
Stochastic Gradient Decent (SGD).pptxStochastic Gradient Decent (SGD).pptx
Stochastic Gradient Decent (SGD).pptx
Shubham Jaybhaye
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
Tonmoy Bhagawati
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
Knoldus Inc.
 
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
Marina Santini
 
ID3 ALGORITHM
ID3 ALGORITHMID3 ALGORITHM
ID3 ALGORITHM
HARDIK SINGH
 
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Simplilearn
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
3. mining frequent patterns
3. mining frequent patterns3. mining frequent patterns
3. mining frequent patterns
Azad public school
 
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
 
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
 
Naive bayes
Naive bayesNaive bayes
Naive bayes
Ashraf Uddin
 
Decision tree
Decision treeDecision tree
Decision tree
ShraddhaPandey45
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
Girish Khanzode
 
Decision tree
Decision treeDecision tree
Decision tree
R A Akerkar
 
Random forest algorithm
Random forest algorithmRandom forest algorithm
Random forest algorithm
Rashid Ansari
 
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Decision Tree Algorithm & Analysis | Machine Learning Algorithm | Data Scienc...
Edureka!
 
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Decision Tree Algorithm With Example | Decision Tree In Machine Learning | Da...
Simplilearn
 
Decision Tree - C4.5&CART
Decision Tree - C4.5&CARTDecision Tree - C4.5&CART
Decision Tree - C4.5&CART
Xueping Peng
 
Stochastic Gradient Decent (SGD).pptx
Stochastic Gradient Decent (SGD).pptxStochastic Gradient Decent (SGD).pptx
Stochastic Gradient Decent (SGD).pptx
Shubham Jaybhaye
 
Presentation on supervised learning
Presentation on supervised learningPresentation on supervised learning
Presentation on supervised learning
Tonmoy Bhagawati
 
Feature Engineering in Machine Learning
Feature Engineering in Machine LearningFeature Engineering in Machine Learning
Feature Engineering in Machine Learning
Knoldus Inc.
 
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
Marina Santini
 
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Decision Tree In R | Decision Tree Algorithm | Data Science Tutorial | Machin...
Simplilearn
 
Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
Mohammad Junaid Khan
 
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
 
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
 

Similar to Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka (20)

Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Edureka!
 
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Edureka!
 
Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Practical Artificial Intelligence & Machine Learning (Arturo Servin)Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Practical Artificial Intelligence & Machine Learning (Arturo Servin)
LSx Festival of Technology
 
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Imran Ali
 
What Is Data Science? | Introduction to Data Science | Data Science For Begin...
What Is Data Science? | Introduction to Data Science | Data Science For Begin...What Is Data Science? | Introduction to Data Science | Data Science For Begin...
What Is Data Science? | Introduction to Data Science | Data Science For Begin...
Simplilearn
 
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Austin Ogilvie
 
machine _learning_introductionand python.pptx
machine _learning_introductionand python.pptxmachine _learning_introductionand python.pptx
machine _learning_introductionand python.pptx
ChandrakalaV15
 
Classification decision tree
Classification  decision treeClassification  decision tree
Classification decision tree
yazad dumasia
 
unit 5 decision tree2.pptx
unit 5 decision tree2.pptxunit 5 decision tree2.pptx
unit 5 decision tree2.pptx
ssuser5c580e1
 
Deep Learning with MXNet
Deep Learning with MXNetDeep Learning with MXNet
Deep Learning with MXNet
Cyrus Moazami-Vahid
 
Supervised vs Unsupervised vs Reinforcement Learning | Edureka
Supervised vs Unsupervised vs Reinforcement Learning | EdurekaSupervised vs Unsupervised vs Reinforcement Learning | Edureka
Supervised vs Unsupervised vs Reinforcement Learning | Edureka
Edureka!
 
2019 09 05 Global AI Night Toronto - Machine Learning.Net
2019 09 05 Global AI Night Toronto - Machine Learning.Net2019 09 05 Global AI Night Toronto - Machine Learning.Net
2019 09 05 Global AI Night Toronto - Machine Learning.Net
Bruno Capuano
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
Suman Debnath
 
Credit Card Fraud Analysis Using Data Science (1).pdf
Credit Card Fraud Analysis Using Data Science (1).pdfCredit Card Fraud Analysis Using Data Science (1).pdf
Credit Card Fraud Analysis Using Data Science (1).pdf
mapfuriralaz
 
Slide3.ppt
Slide3.pptSlide3.ppt
Slide3.ppt
butest
 
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
KhanhPhan575445
 
Primer to Machine Learning
Primer to Machine LearningPrimer to Machine Learning
Primer to Machine Learning
Jeff Tanner
 
Top 100+ Google Data Science Interview Questions.pdf
Top 100+ Google Data Science Interview Questions.pdfTop 100+ Google Data Science Interview Questions.pdf
Top 100+ Google Data Science Interview Questions.pdf
Datacademy.ai
 
Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Machine Learning With R | Machine Learning Algorithms | Data Science Training...Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Edureka!
 
applications and advantages of python
applications and advantages of pythonapplications and advantages of python
applications and advantages of python
bhavesh lande
 
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Python for Data Science | Python Data Science Tutorial | Data Science Certifi...
Edureka!
 
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Scikit Learn Tutorial | Machine Learning with Python | Python for Data Scienc...
Edureka!
 
Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Practical Artificial Intelligence & Machine Learning (Arturo Servin)Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Practical Artificial Intelligence & Machine Learning (Arturo Servin)
LSx Festival of Technology
 
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
13: Practical Artificial Intelligence & Machine Learning (Arturo Servin)
Imran Ali
 
What Is Data Science? | Introduction to Data Science | Data Science For Begin...
What Is Data Science? | Introduction to Data Science | Data Science For Begin...What Is Data Science? | Introduction to Data Science | Data Science For Begin...
What Is Data Science? | Introduction to Data Science | Data Science For Begin...
Simplilearn
 
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Applied Data Science: Building a Beer Recommender | Data Science MD - Oct 2014
Austin Ogilvie
 
machine _learning_introductionand python.pptx
machine _learning_introductionand python.pptxmachine _learning_introductionand python.pptx
machine _learning_introductionand python.pptx
ChandrakalaV15
 
Classification decision tree
Classification  decision treeClassification  decision tree
Classification decision tree
yazad dumasia
 
unit 5 decision tree2.pptx
unit 5 decision tree2.pptxunit 5 decision tree2.pptx
unit 5 decision tree2.pptx
ssuser5c580e1
 
Supervised vs Unsupervised vs Reinforcement Learning | Edureka
Supervised vs Unsupervised vs Reinforcement Learning | EdurekaSupervised vs Unsupervised vs Reinforcement Learning | Edureka
Supervised vs Unsupervised vs Reinforcement Learning | Edureka
Edureka!
 
2019 09 05 Global AI Night Toronto - Machine Learning.Net
2019 09 05 Global AI Night Toronto - Machine Learning.Net2019 09 05 Global AI Night Toronto - Machine Learning.Net
2019 09 05 Global AI Night Toronto - Machine Learning.Net
Bruno Capuano
 
Introduction to ML and Decision Tree
Introduction to ML and Decision TreeIntroduction to ML and Decision Tree
Introduction to ML and Decision Tree
Suman Debnath
 
Credit Card Fraud Analysis Using Data Science (1).pdf
Credit Card Fraud Analysis Using Data Science (1).pdfCredit Card Fraud Analysis Using Data Science (1).pdf
Credit Card Fraud Analysis Using Data Science (1).pdf
mapfuriralaz
 
Slide3.ppt
Slide3.pptSlide3.ppt
Slide3.ppt
butest
 
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
02sjjknbjijnuijkjnkggjknbhhbjkjhnilide.ppt
KhanhPhan575445
 
Primer to Machine Learning
Primer to Machine LearningPrimer to Machine Learning
Primer to Machine Learning
Jeff Tanner
 
Top 100+ Google Data Science Interview Questions.pdf
Top 100+ Google Data Science Interview Questions.pdfTop 100+ Google Data Science Interview Questions.pdf
Top 100+ Google Data Science Interview Questions.pdf
Datacademy.ai
 
Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Machine Learning With R | Machine Learning Algorithms | Data Science Training...Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Machine Learning With R | Machine Learning Algorithms | Data Science Training...
Edureka!
 
applications and advantages of python
applications and advantages of pythonapplications and advantages of python
applications and advantages of python
bhavesh lande
 
Ad

More from Edureka! (20)

What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
What to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | EdurekaWhat to learn during the 21 days Lockdown | Edureka
What to learn during the 21 days Lockdown | Edureka
Edureka!
 
Top 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | EdurekaTop 10 Dying Programming Languages in 2020 | Edureka
Top 10 Dying Programming Languages in 2020 | Edureka
Edureka!
 
Top 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | EdurekaTop 5 Trending Business Intelligence Tools | Edureka
Top 5 Trending Business Intelligence Tools | Edureka
Edureka!
 
Tableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | EdurekaTableau Tutorial for Data Science | Edureka
Tableau Tutorial for Data Science | Edureka
Edureka!
 
Python Programming Tutorial | Edureka
Python Programming Tutorial | EdurekaPython Programming Tutorial | Edureka
Python Programming Tutorial | Edureka
Edureka!
 
Top 5 PMP Certifications | Edureka
Top 5 PMP Certifications | EdurekaTop 5 PMP Certifications | Edureka
Top 5 PMP Certifications | Edureka
Edureka!
 
Top Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | EdurekaTop Maven Interview Questions in 2020 | Edureka
Top Maven Interview Questions in 2020 | Edureka
Edureka!
 
Linux Mint Tutorial | Edureka
Linux Mint Tutorial | EdurekaLinux Mint Tutorial | Edureka
Linux Mint Tutorial | Edureka
Edureka!
 
How to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| EdurekaHow to Deploy Java Web App in AWS| Edureka
How to Deploy Java Web App in AWS| Edureka
Edureka!
 
Importance of Digital Marketing | Edureka
Importance of Digital Marketing | EdurekaImportance of Digital Marketing | Edureka
Importance of Digital Marketing | Edureka
Edureka!
 
RPA in 2020 | Edureka
RPA in 2020 | EdurekaRPA in 2020 | Edureka
RPA in 2020 | Edureka
Edureka!
 
Email Notifications in Jenkins | Edureka
Email Notifications in Jenkins | EdurekaEmail Notifications in Jenkins | Edureka
Email Notifications in Jenkins | Edureka
Edureka!
 
EA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | EdurekaEA Algorithm in Machine Learning | Edureka
EA Algorithm in Machine Learning | Edureka
Edureka!
 
Cognitive AI Tutorial | Edureka
Cognitive AI Tutorial | EdurekaCognitive AI Tutorial | Edureka
Cognitive AI Tutorial | Edureka
Edureka!
 
AWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | EdurekaAWS Cloud Practitioner Tutorial | Edureka
AWS Cloud Practitioner Tutorial | Edureka
Edureka!
 
Blue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | EdurekaBlue Prism Top Interview Questions | Edureka
Blue Prism Top Interview Questions | Edureka
Edureka!
 
Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka Big Data on AWS Tutorial | Edureka
Big Data on AWS Tutorial | Edureka
Edureka!
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
Edureka!
 
Kubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | EdurekaKubernetes Installation on Ubuntu | Edureka
Kubernetes Installation on Ubuntu | Edureka
Edureka!
 
Introduction to DevOps | Edureka
Introduction to DevOps | EdurekaIntroduction to DevOps | Edureka
Introduction to DevOps | Edureka
Edureka!
 
Ad

Recently uploaded (20)

National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Introduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUEIntroduction to Typescript - GDG On Campus EUE
Introduction to Typescript - GDG On Campus EUE
Google Developer Group On Campus European Universities in Egypt
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
National Fuels Treatments Initiative: Building a Seamless Map of Hazardous Fu...
Safe Software
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
Domino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use CasesDomino IQ – What to Expect, First Steps and Use Cases
Domino IQ – What to Expect, First Steps and Use Cases
panagenda
 
If You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FMEIf You Use Databricks, You Definitely Need FME
If You Use Databricks, You Definitely Need FME
Safe Software
 
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdfcnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
cnc-drilling-dowel-inserting-machine-drillteq-d-510-english.pdf
AmirStern2
 
Oracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization ProgramOracle Cloud and AI Specialization Program
Oracle Cloud and AI Specialization Program
VICTOR MAESTRE RAMIREZ
 
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOMEstablish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Establish Visibility and Manage Risk in the Supply Chain with Anchore SBOM
Anchore
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME FlowProviding an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Murdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementaryMurdledescargadarkweb.pdfvolumen1 100 elementary
Murdledescargadarkweb.pdfvolumen1 100 elementary
JorgeSemperteguiMont
 
Secure Access with Azure Active Directory
Secure Access with Azure Active DirectorySecure Access with Azure Active Directory
Secure Access with Azure Active Directory
VICTOR MAESTRE RAMIREZ
 
PyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent IntegrationPyData - Graph Theory for Multi-Agent Integration
PyData - Graph Theory for Multi-Agent Integration
barqawicloud
 
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Creating an Accessible Future-How AI-powered Accessibility Testing is Shaping...
Impelsys Inc.
 
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und AnwendungsfälleDomino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
Domino IQ – Was Sie erwartet, erste Schritte und Anwendungsfälle
panagenda
 
Oracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI FoundationsOracle Cloud Infrastructure AI Foundations
Oracle Cloud Infrastructure AI Foundations
VICTOR MAESTRE RAMIREZ
 
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data ResilienceFloods in Valencia: Two FME-Powered Stories of Data Resilience
Floods in Valencia: Two FME-Powered Stories of Data Resilience
Safe Software
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely Demo Showcase: Powering ServiceNow Discovery with Precisely Ironstr...
Precisely
 
Your startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean accountYour startup on AWS - How to architect and maintain a Lean and Mean account
Your startup on AWS - How to architect and maintain a Lean and Mean account
angelo60207
 
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
“Solving Tomorrow’s AI Problems Today with Cadence’s Newest Processor,” a Pre...
Edge AI and Vision Alliance
 

Decision Tree Algorithm | Decision Tree in Python | Machine Learning Algorithms | Edureka

  • 2. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Agenda for Today’s Session ▪ What is Classification? ▪ Types of Classification ▪ Classification Use case ▪ What is Decision Tree? ▪ Terminologies associated to a Decision Tree ▪ Visualizing a Decision Tree ▪ Writing a Decision Tree Classifier form Scratch in Python using CART Algorithm
  • 3. Copyright © 2018, edureka and/or its affiliates. All rights reserved. What is Classification? Machine Leaning Training Using Python
  • 4. “Classification is the process of dividing the datasets into different categories or groups by adding label” What is Classification? ▪ Note: It adds the data point to a particular labelled group on the basis of some condition”
  • 5. Types of Classification Decision Tree Random Forest Naïve Bayes KNN Decision Tree ▪ Graphical representation of all the possible solutions to a decision ▪ Decisions are based on some conditions ▪ Decision made can be easily explained
  • 6. Types of Classification Decision Tree Random Forest Naïve Bayes KNN Random Forest ▪ Builds multiple decision trees and merges them together ▪ More accurate and stable prediction ▪ Random decision forests correct for decision trees' habit of overfitting to their training set ▪ Trained with the “bagging” method
  • 7. Types of Classification Decision Tree Random Forest Naïve Bayes KNN Naïve Bayes ▪ Classification technique based on Bayes' Theorem ▪ Assumes that the presence of a particular feature in a class is unrelated to the presence of any other feature
  • 8. Types of Classification Decision Tree Random Forest Naïve Bayes KNN K-Nearest Neighbors ▪ Stores all the available cases and classifies new cases based on a similarity measure ▪ The “K” is KNN algorithm is the nearest neighbors we wish to take vote from.
  • 9. Copyright © 2018, edureka and/or its affiliates. All rights reserved. What is Decision Tree? Machine Leaning Training Using Python
  • 10. “A decision tree is a graphical representation of all the possible solutions to a decision based on certain conditions” What is Decision Tree?
  • 11. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python Understanding a Decision Tree
  • 12. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Colour Diameter Label Green 3 Mango Yellow 3 Mango Red 1 Grape Red 1 Grape Yellow 3 Lemon Dataset This is how our dataset looks like!
  • 13. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python ` Decision Tree is diameter > = 3? Color Diam Label Green 3 Mango Yellow 3 Lemon Red 1 Grape Yellow 3 Mango Red 1 Grape G 3 Mango Y 3 Mango Y 3 Lemon R 1 Grape R 1 Grape is colour = = Yellow? Y 3 Mango Y 3 Lemon G 3 Mango Gini Impurity = 0.44 Gini Impurity = 0 Information Gain = 0.37 Information Gain = 0.11 100% Grape 100% Mango 50% Mango 50% Lemon
  • 14. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Is the colour green? Is the diameter >=3 Is the colour yellow TRUE False Green 3 Mango Yellow 3 Lemon Yellow 3 Mango ` What is Decision Tree?
  • 15. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python Decision Tree Terminologies
  • 16. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Decision Tree Terminology Pruning Opposite of Splitting, basically removing unwanted branches from the tree Root Node It represents the entire population or sample and this further gets divided into two or more homogenous sets. Parent/Child Node Root node is the parent node and all the other nodes branched from it is known as child node Splitting Splitting is dividing the root node/sub node into different parts on the basis of some condition. Leaf Node Node cannot be further segregated into further nodes Branch/SubTree Formed by splitting the tree/node
  • 17. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python is diameter > = 3? Color Diam Label Green 3 Mango Yellow 3 Lemon Red 1 Grape Yellow 3 Mango Red 1 Grape is colour = = Yellow? G 3 Mango Y 3 Mango Y 3 Lemon R 1 Grape R 1 Grape 100% Grape Y 3 Mango Y 3 Lemon 100% Mango 50% Mango 50% Lemon
  • 18. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python CART Algorithm
  • 19. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Let’s First Visualize the Decision Tree Which Question to ask and When?
  • 20. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Let’s First Visualize the Decision Tree No Yes NormalHigh Yes WeakStrong No Yes Outlook WindyHumidity
  • 21. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Learn about Decision Tree Which one among them should you pick first?
  • 22. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Learn about Decision Tree Answer: Determine the attribute that best classifies the training data
  • 23. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Learn about Decision Tree But How do we choose the best attribute? Or How does a tree decide where to split?
  • 24. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python How Does A Tree Decide Where To Split? Information Gain The information gain is the decrease in entropy after a dataset is split on the basis of an attribute. Constructing a decision tree is all about finding attribute that returns the highest information gain Gini Index The measure of impurity (or purity) used in building decision tree in CART is Gini Index Reduction in Variance Reduction in variance is an algorithm used for continuous target variables (regression problems). The split with lower variance is selected as the criteria to split the population Chi Square It is an algorithm to find out the statistical significance between the differences between sub-nodes and parent node
  • 25. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Let’s First Understand What is Impurity Impurity = 0
  • 26. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Let’s First Understand What is Impurity Impurity ≠ 0
  • 27. What is Entropy? ▪ Defines randomness in the data ▪ Entropy is just a metric which measures the impurity or ▪ The first step to solve the problem of a decision tree
  • 28. What is Entropy? If number of yes = number of no ie P(S) = 0.5  Entropy(s) = 1 If it contains all yes or all no ie P(S) = 1 or 0  Entropy(s) = 0 - P(yes) log2 P(yes) − P(no) log2 P(no)Entropy(s) = Where, ▪ S is the total sample space, ▪ P(yes) is probability of yes
  • 29. What is Entropy? E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠) When P(Yes) =P(No) = 0.5 ie YES + NO = Total Sample(S) E(S) = 0.5 log2 0.5 − 0.5 log2 0.5 E(S) = 0.5( log2 0.5 - log2 0.5) E(S) = 1
  • 30. What is Entropy? E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠) When P(Yes) = 1 ie YES = Total Sample(S) E(S) = 1 log2 1 E(S) = 0 E(S) = -P(No) log2 𝑃(𝑁𝑜) When P(No) = 1 ie No = Total Sample(S) E(S) = 1 log2 1 E(S) = 0
  • 31. What is Information Gain? ▪ Measures the reduction in entropy ▪ Decides which attribute should be selected as the decision node If S is our total collection, Information Gain = Entropy(S) – [(Weighted Avg) x Entropy(each feature)]
  • 32. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python Let’s Build Our Decision Tree
  • 33. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Out of 14 instances we have 9 YES and 5 NO So we have the formula, E(S) = -P(Yes) log2 𝑃(𝑌𝑒𝑠) − P(No) log2 𝑃(𝑁𝑜) E(S) = - (9/14)* log2 9/14 - (5/14)* log2 5/14 E(S) = 0.41+0.53 = 0.94 Step 1: Compute the entropy for the Data set D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14
  • 34. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node? Outlook? Temperature? Humidity? Windy?
  • 35. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node: Outlook Outlook? Sunny Overcast Yes Yes No No No Yes Yes Yes Yes Rainy Yes Yes Yes No No
  • 36. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node: Outlook E(Outlook = Sunny) = -2/5 log2 2/5 − 3/5 log2 3/5 = 0.971 E(Outlook = Overcast) = -1 log2 1 E(Outlook = Sunny) = -3/5 log2 3/5 − 0 log2 0 = 0 − 2/5 log2 2/5 = 0.971 I(Outlook) = 5/14 x 0.971 + 4/14 x 0 + 5/14 x 0.971 = 0.693 Information from outlook, Information gained from outlook, Gain(Outlook) = E(S) – I(Outlook) 0.94 – 0.693 = 0.247
  • 37. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node: Outlook Windy? False Yes Yes Yes Yes Yes Yes No No True Yes Yes Yes No No No
  • 38. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node: Windy E(Windy = True) = 1 E(Windy = False) = 0.811 I(Windy) = 8/14 x 0.811+ 6/14 x 1 = 0.892 Information from windy, Information gained from outlook, Gain(Windy) = E(S) – I(Windy) 0.94 – 0.892 = 0.048
  • 39. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python Similarly We Calculated For Rest Two
  • 40. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select As Root Node Outlook: Info 0.693 Gain: 0.940-0.693 0.247 Temperature: Info 0.911 Gain: 0.940-0.911 0.029 Windy: Info 0.892 Gain: 0.940-0.982 0.048 Humidity: Info 0.788 Gain: 0.940-0.788 0.152 Since Max gain = 0.247, Outlook is our ROOT Node
  • 41. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Which Node To Select Further? Outlook Yes ?? Overcast Outlook = overcast Contains only yes You need to recalculate things
  • 42. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python This Is How Your Complete Tree Will Look Like No Yes NormalHigh Yes WeakStrong No Yes Outlook WindyHumidity Overcast
  • 43. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python What Should I Do To Play - Pruning
  • 44. “A decision tree is a graphical representation of all the possible solutions to a decision based on certain conditions” What is Pruning?
  • 45. Copyright © 2018, edureka and/or its affiliates. All rights reserved.Machine Leaning Training Using Python Pruning: Reducing The Complexity Yes Normal Yes Weak Yes Outlook WindyHumidity
  • 46. Copyright © 2018, edureka and/or its affiliates. All rights reserved. Machine Leaning Training Using Python Are tree based models better than linear models?