SlideShare a Scribd company logo
Decision Trees
By
Amritansh
Introduction
Given an event, predict is category.
Examples:
Who won a given ball game?
How should we file a given email?
What word sense was intended for a given
occurrence of a word?
Event = list of features. Examples:
Ball game: Which players were on
offense?
Email: Who sent the email?
Disambiguation: What was the preceding
word?
2
Introduction
 Use a decision tree to predict categories for new events.
 Use training data to build the decision tree.
3
New
Events
Decision
Tree
Category
Training
Events and
Categories
Decision Tree for PlayTennis4
Outlook
Sunny Overcast Rain
Humidity
High Normal
No Yes
Each internal node tests an attribute
Each branch corresponds to an
attribute value node
Each leaf node assigns a classification
Word Sense Disambiguation
 Given an occurrence of a word, decide which sense, or meaning, was
intended.
 Example: "run"
 run1: move swiftly (I ran to the store.)
 run2: operate (I run a store.)
 run3: flow (Water runs from the spring.)
 run4: length of torn stitches (Her stockings had a run.)
 etc.
5
Word Sense Disambiguation
 Categories
Use word sense labels (run1, run2, etc.) to name the
possible categories.
 Features
Features describe the context of the word we want to
disambiguate.
Possible features include:
near(w): is the given word near an occurrence of word w?
pos: the word’s part of speech
left(w): is the word immediately preceded by the word w?
etc.
6
Word Sense Disambiguation
 Example decision tree:
(Note: Decision trees for WSD tend to be quite large)
7
pos
near(race)
near(river)
near(stocking)
run4 run1
yes no
noun verb
yes no
run3
yes no
WSD: Sample Training Data
Features Word
Sensepos near(race) near(river) near(stockings)
noun no no no run4
verb no no no run1
verb no yes no run3
noun yes yes yes run4
verb no no yes run1
verb yes yes no run2
verb no yes yes run3
8
Decision Tree for Conjunction9
Outlook
Sunny Overcast Rain
Wind
Strong Weak
No Yes
No
Outlook=Sunny  Wind=Weak
No
Decision Tree for Disjunction10
Outlook
Sunny Overcast Rain
Yes
Outlook=Sunny  Wind=Weak
Wind
Strong Weak
No Yes
Wind
Strong Weak
No Yes
Decision Tree for XOR11
Outlook
Sunny Overcast Rain
Wind
Strong Weak
Yes No
Outlook=Sunny XOR Wind=Weak
Wind
Strong Weak
No Yes
Wind
Strong Weak
No Yes
Decision Tree12
Outlook
Sunny Overcast Rain
Humidity
High Normal
Wind
Strong Weak
No Yes
Yes
YesNo
• decision trees represent disjunctions of conjunctions
(Outlook=Sunny  Humidity=Normal)
 (Outlook=Overcast)
 (Outlook=Rain  Wind=Weak)
When to consider Decision Trees
Instances describable by attribute-value pairs
Target function is discrete valued
Disjunctive hypothesis may be required
Possibly noisy training data
Missing attribute values
Examples:
Medical diagnosis
Credit risk analysis
Object classification for robot manipulator
(Tan 1993)
13
Top-Down Induction of Decision
Trees ID3
14
1. A  the “best” decision attribute for next node
2. Assign A as decision attribute for node
3. For each value of A create new descendant
4. Sort training examples to leaf node according to
the attribute value of the branch
5. If all training examples are perfectly classified
(same value of target attribute) stop, else
iterate over new leaf nodes.
Which attribute is best?15
A1=?
G H
[21+, 5-] [8+, 30-]
[29+,35-] A2=?
L M
[18+, 33-] [11+, 2-]
[29+,35-]
Entropy
 S is a sample of training examples
 p+ is the proportion of positive examples
 p- is the proportion of negative examples
 Entropy measures the impurity of S
Entropy(S) = -p+ log2 p+ - p- log2 p-
16
Entropy
 Entropy(S)= expected number of bits needed to
encode class (+ or -) of randomly drawn members
of S (under the optimal, shortest length-code)
Why?
 Information theory optimal length code assign
–log2 p bits to messages having probability p.
 So the expected number of bits to encode
(+ or -) of random member of S:
-p+ log2 p+ - p- log2 p-
17
Information Gain (S=E)
 Gain(S,A): expected reduction in entropy due to
sorting S on attribute A
18
A1=?
G H
[21+, 5-] [8+, 30-]
[29+,35-] A2=?
True False
[18+, 33-] [11+, 2-]
[29+,35-]
Entropy([29+,35-]) = -29/64 log2 29/64 – 35/64 log2 35/64
= 0.99
Information Gain
Entropy([21+,5-]) = 0.71
Entropy([8+,30-]) = 0.74
Gain(S,A1)=Entropy(S)
-26/64*Entropy([21+,5-])
-38/64*Entropy([8+,30-])
=0.27
19
A1=?
True False
[21+, 5-] [8+, 30-]
[29+,35-]
Entropy([18+,33-]) = 0.94
Entropy([11+,2-]) = 0.62
Gain(S,A2)=Entropy(S)
-51/64*Entropy([18+,33-])
-13/64*Entropy([11+,2-])
=0.12
A2=?
True False
[18+, 33-] [11+, 2-]
[29+,35-]
Training Examples20
NoStrongHighMildRainD14
YesWeakNormalHotOvercastD13
YesStrongHighMildOvercastD12
YesStrongNormalMildSunnyD11
YesStrongNormalMildRainD10
YesWeakNormalColdSunnyD9
NoWeakHighMildSunnyD8
YesWeakNormalCoolOvercastD7
NoStrongNormalCoolRainD6
YesWeakNormalCoolRainD5
YesWeakHighMildRainD4
YesWeakHighHotOvercastD3
NoStrongHighHotSunnyD2
NoWeakHighHotSunnyD1
Play TennisWindHumidityTemp.OutlookDay
Selecting the Next Attribute21
Humidity
High Normal
[3+, 4-] [6+, 1-]
S=[9+,5-]
E=0.940
Gain(S,Humidity)
=0.940-(7/14)*0.985
– (7/14)*0.592
=0.151
E=0.985 E=0.592
Wind
Weak Strong
[6+, 2-] [3+, 3-]
S=[9+,5-]
E=0.940
E=0.811 E=1.0
Gain(S,Wind)
=0.940-(8/14)*0.811
– (6/14)*1.0
=0.048
Humidity provides greater info. gain than Wind, w.r.t target classification.
Selecting the Next Attribute22
Outlook
Sunny Rain
[2+, 3-] [3+, 2-]
S=[9+,5-]
E=0.940
Gain(S,Outlook)
=0.940-(5/14)*0.971
-(4/14)*0.0 – (5/14)*0.0971
=0.247
E=0.971 E=0.971
Over
cast
[4+, 0]
E=0.0
Selecting the Next Attribute23
The information gain values for the 4 attributes
are:
• Gain(S,Outlook) =0.247
• Gain(S,Humidity) =0.151
• Gain(S,Wind) =0.048
• Gain(S,Temperature) =0.029
where S denotes the collection of training
examples
ID3 Algorithm24
Outlook
Sunny Overcast Rain
Yes
[D1,D2,…,D14]
[9+,5-]
Ssunny =[D1,D2,D8,D9,D11]
[2+,3-]
? ?
[D3,D7,D12,D13]
[4+,0-]
[D4,D5,D6,D10,D14]
[3+,2-]
Gain(Ssunny, Humidity)=0.970-(3/5)0.0 – 2/5(0.0) = 0.970
Gain(Ssunny, Temp.)=0.970-(2/5)0.0 –2/5(1.0)-(1/5)0.0 = 0.570
Gain(Ssunny, Wind)=0.970= -(2/5)1.0 – 3/5(0.918) = 0.019
ID3 Algorithm25
Outlook
Sunny Overcast Rain
Humidity
High Normal
Wind
Strong Weak
No Yes
Yes
YesNo
[D3,D7,D12,D13]
[D8,D9,D11]
[mistake]
[D6,D14][D1,D2] [D4,D5,D10]
Occam’s Razor
”If two theories explain the facts equally weel, then the
simpler theory is to be preferred”
Arguments in favor:
Fewer short hypotheses than long hypotheses
A short hypothesis that fits the data is unlikely to be
a coincidence
A long hypothesis that fits the data might be a
coincidence
Arguments opposed:
There are many ways to define small sets of
hypotheses
26
Overfitting
 One of the biggest problems with decision trees
is Overfitting
27
Avoid Overfitting
 Stop growing when split not statistically significant
 Grow full tree, then post-prune
Select “best” tree:
 measure performance over training data
 measure performance over separate validation data set
 min( |tree|+|misclassifications(tree)|)
28
Effect of Reduced Error Pruning29
Converting a Tree to Rules30
Outlook
Sunny Overcast Rain
Humidity
High Normal
Wind
Strong Weak
No Yes
Yes
YesNo
R1: If (Outlook=Sunny)  (Humidity=High) Then PlayTennis=No
R2: If (Outlook=Sunny)  (Humidity=Normal) Then PlayTennis=Yes
R3: If (Outlook=Overcast) Then PlayTennis=Yes
R4: If (Outlook=Rain)  (Wind=Strong) Then PlayTennis=No
R5: If (Outlook=Rain)  (Wind=Weak) Then PlayTennis=Yes
Continuous Valued Attributes
Create a discrete attribute to test continuous
 Temperature = 24.50C
 (Temperature > 20.00C) = {true, false}
Where to set the threshold?
31
180C
NoYesYesYesNoNoPlayTennis
270C240C220C190C150CTemperature
Random forest classifier
 Random forest classifier, an extension to bagging which uses de-correlated
trees.
 To say it in simple words: Random forest builds multiple decision trees and
merges them together to get a more accurate and stable prediction
Random Forest Classifier
NexamplesTraining Data
M features
Random Forest Classifier
Nexamples
Create bootstrap samples
from the training data
....…
M features
Random Forest Classifier
Nexamples
Construct a decision tree
....…
M features
Random Forest Classifier
Nexamples
....…
M features
At each node in choosing the split feature
choose only among m<M features
Random Forest Classifier
Create decision tree
from each bootstrap sample
Nexamples
....…
....…
M features
Random Forest Classifier
Nexamples
....…
....…
Take the
majority
vote
M features
Unknown Attribute Values
What if some examples have missing values of A?
Use training example anyway sort through tree
 If node n tests A, assign most common value of A
among other examples sorted to node n.
 Assign most common value of A among other
examples with same target value
 Assign probability pi to each possible value vi of A
Assign fraction pi of example to each descendant
in tree
Classify new examples in the same fashion
39
Cross-Validation
 Estimate the accuracy of an hypothesis induced by a supervised
learning algorithm
 Predict the accuracy of an hypothesis over future unseen
instances
 Select the optimal hypothesis from a given set of alternative
hypotheses
 Pruning decision trees
 Model selection
 Feature selection
 Combining multiple classifiers (boosting)
40

More Related Content

What's hot

Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
Tarun Gehlot
 
Machine Learning and Data Mining - Decision Trees
Machine Learning and Data Mining - Decision TreesMachine Learning and Data Mining - Decision Trees
Machine Learning and Data Mining - Decision Trees
webisslides
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
Matthew Leingang
 
Logisticregression
LogisticregressionLogisticregression
Logisticregression
sujimaa
 
Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)
asghar123456
 
b
bb
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Daniel Katz
 
Analysis Solutions CVI
Analysis Solutions CVIAnalysis Solutions CVI
Analysis Solutions CVI
Leonardo Di Giosia
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
Matthew Leingang
 
Roots equations
Roots equationsRoots equations
Roots equations
oscar
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
Matthew Leingang
 
Limits Involving Number e
Limits Involving Number eLimits Involving Number e
Limits Involving Number e
Pablo Antuna
 
[4] num integration
[4] num integration[4] num integration
[4] num integration
ikhulsys
 
0. exponents y
0. exponents y0. exponents y
0. exponents y
math123c
 
Lesson 27: Integration by Substitution, part II (Section 10 version)
Lesson 27: Integration by Substitution, part II (Section 10 version)Lesson 27: Integration by Substitution, part II (Section 10 version)
Lesson 27: Integration by Substitution, part II (Section 10 version)
Matthew Leingang
 
Chapter 04 answers
Chapter 04 answersChapter 04 answers
Chapter 04 answers
Rajwinder Marock
 
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
jemille6
 
Pdf smda6e-chapter-04-mathematical-optimization-loss-function
Pdf smda6e-chapter-04-mathematical-optimization-loss-functionPdf smda6e-chapter-04-mathematical-optimization-loss-function
Pdf smda6e-chapter-04-mathematical-optimization-loss-function
Sou Tibon
 
19 min max-saddle-points
19 min max-saddle-points19 min max-saddle-points
19 min max-saddle-points
math267
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
Matthew Leingang
 

What's hot (20)

Linear approximations and_differentials
Linear approximations and_differentialsLinear approximations and_differentials
Linear approximations and_differentials
 
Machine Learning and Data Mining - Decision Trees
Machine Learning and Data Mining - Decision TreesMachine Learning and Data Mining - Decision Trees
Machine Learning and Data Mining - Decision Trees
 
Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)Lesson 27: Integration by Substitution (slides)
Lesson 27: Integration by Substitution (slides)
 
Logisticregression
LogisticregressionLogisticregression
Logisticregression
 
Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)Amth250 octave matlab some solutions (2)
Amth250 octave matlab some solutions (2)
 
b
bb
b
 
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
Quantitative Methods for Lawyers - Class #9 - Bayes Theorem (Part 2), Skewnes...
 
Analysis Solutions CVI
Analysis Solutions CVIAnalysis Solutions CVI
Analysis Solutions CVI
 
Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)Lesson 21: Curve Sketching (slides)
Lesson 21: Curve Sketching (slides)
 
Roots equations
Roots equationsRoots equations
Roots equations
 
Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)Lesson 26: The Fundamental Theorem of Calculus (slides)
Lesson 26: The Fundamental Theorem of Calculus (slides)
 
Limits Involving Number e
Limits Involving Number eLimits Involving Number e
Limits Involving Number e
 
[4] num integration
[4] num integration[4] num integration
[4] num integration
 
0. exponents y
0. exponents y0. exponents y
0. exponents y
 
Lesson 27: Integration by Substitution, part II (Section 10 version)
Lesson 27: Integration by Substitution, part II (Section 10 version)Lesson 27: Integration by Substitution, part II (Section 10 version)
Lesson 27: Integration by Substitution, part II (Section 10 version)
 
Chapter 04 answers
Chapter 04 answersChapter 04 answers
Chapter 04 answers
 
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
Mayo Slides: Part I Meeting #2 (Phil 6334/Econ 6614)
 
Pdf smda6e-chapter-04-mathematical-optimization-loss-function
Pdf smda6e-chapter-04-mathematical-optimization-loss-functionPdf smda6e-chapter-04-mathematical-optimization-loss-function
Pdf smda6e-chapter-04-mathematical-optimization-loss-function
 
19 min max-saddle-points
19 min max-saddle-points19 min max-saddle-points
19 min max-saddle-points
 
Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)Lesson 2: A Catalog of Essential Functions (slides)
Lesson 2: A Catalog of Essential Functions (slides)
 

Similar to Data Science Training in Bangalore | Learnbay.in | Decision Tree | Machine Learning Course

Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
butest
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
Ramadan Babers, PhD
 
Decision tree learning
Decision tree learningDecision tree learning
Decision tree learning
Dr. Radhey Shyam
 
Complete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.pptComplete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.ppt
AishaAnwar16
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
allyn joy calcaben
 
Estimation, Approximation and Standard form
Estimation, Approximation and Standard formEstimation, Approximation and Standard form
Estimation, Approximation and Standard form
Nsomp
 
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning BasicsDeep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Jason Tsai
 
Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362
butest
 
Probability unit2.pptx
Probability unit2.pptxProbability unit2.pptx
Probability unit2.pptx
SNIGDHABADIDA2127755
 
week9_Machine_Learning.ppt
week9_Machine_Learning.pptweek9_Machine_Learning.ppt
week9_Machine_Learning.ppt
butest
 
11.1 Sequences and Series
11.1 Sequences and Series11.1 Sequences and Series
11.1 Sequences and Series
smiller5
 
Nhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdfNhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdf
NhtHong96
 
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
nassorokayanda9412
 
ID3 Algorithm
ID3 AlgorithmID3 Algorithm
ID3 Algorithm
CherifRehouma
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
Dr. C.V. Suresh Babu
 
Machine Learning 3 - Decision Tree Learning
Machine Learning 3 - Decision Tree LearningMachine Learning 3 - Decision Tree Learning
Machine Learning 3 - Decision Tree Learning
butest
 
Decision Trees.ppt
Decision Trees.pptDecision Trees.ppt
Decision Trees.ppt
muhammadabdullah400131
 
Introduction to Recursion (Python)
Introduction to Recursion (Python)Introduction to Recursion (Python)
Introduction to Recursion (Python)
Thai Pangsakulyanont
 
Efficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formatsEfficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formats
Alexander Litvinenko
 
Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1
jennytuazon01630
 

Similar to Data Science Training in Bangalore | Learnbay.in | Decision Tree | Machine Learning Course (20)

Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
Software-Praktikum SoSe 2005 Lehrstuhl fuer Maschinelles ...
 
Classification using decision tree in detail
Classification using decision tree in detailClassification using decision tree in detail
Classification using decision tree in detail
 
Decision tree learning
Decision tree learningDecision tree learning
Decision tree learning
 
Complete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.pptComplete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.ppt
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
Estimation, Approximation and Standard form
Estimation, Approximation and Standard formEstimation, Approximation and Standard form
Estimation, Approximation and Standard form
 
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning BasicsDeep Learning: Introduction & Chapter 5 Machine Learning Basics
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
 
Machine Learning 2D5362
Machine Learning 2D5362Machine Learning 2D5362
Machine Learning 2D5362
 
Probability unit2.pptx
Probability unit2.pptxProbability unit2.pptx
Probability unit2.pptx
 
week9_Machine_Learning.ppt
week9_Machine_Learning.pptweek9_Machine_Learning.ppt
week9_Machine_Learning.ppt
 
11.1 Sequences and Series
11.1 Sequences and Series11.1 Sequences and Series
11.1 Sequences and Series
 
Nhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdfNhan_Chapter 6_Classification 2022.pdf
Nhan_Chapter 6_Classification 2022.pdf
 
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
3.-SEQUENCES-AND-SERIES-THEORY.hhsssspdf
 
ID3 Algorithm
ID3 AlgorithmID3 Algorithm
ID3 Algorithm
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Machine Learning 3 - Decision Tree Learning
Machine Learning 3 - Decision Tree LearningMachine Learning 3 - Decision Tree Learning
Machine Learning 3 - Decision Tree Learning
 
Decision Trees.ppt
Decision Trees.pptDecision Trees.ppt
Decision Trees.ppt
 
Introduction to Recursion (Python)
Introduction to Recursion (Python)Introduction to Recursion (Python)
Introduction to Recursion (Python)
 
Efficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formatsEfficient Analysis of high-dimensional data in tensor formats
Efficient Analysis of high-dimensional data in tensor formats
 
Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1
 

More from Learnbay Datascience

Top data science projects
Top data science projectsTop data science projects
Top data science projects
Learnbay Datascience
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
Learnbay Datascience
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
Learnbay Datascience
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
Learnbay Datascience
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
Learnbay Datascience
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
Learnbay Datascience
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
Learnbay Datascience
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
Learnbay Datascience
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
Learnbay Datascience
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
Learnbay Datascience
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
Learnbay Datascience
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
Learnbay Datascience
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
Learnbay Datascience
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
Learnbay Datascience
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
Learnbay Datascience
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
Learnbay Datascience
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
Learnbay Datascience
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
Learnbay Datascience
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
Learnbay Datascience
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
Learnbay Datascience
 

More from Learnbay Datascience (20)

Top data science projects
Top data science projectsTop data science projects
Top data science projects
 
Python my SQL - create table
Python my SQL - create tablePython my SQL - create table
Python my SQL - create table
 
Python my SQL - create database
Python my SQL - create databasePython my SQL - create database
Python my SQL - create database
 
Python my sql database connection
Python my sql   database connectionPython my sql   database connection
Python my sql database connection
 
Python - mySOL
Python - mySOLPython - mySOL
Python - mySOL
 
AI - Issues and Terminology
AI - Issues and TerminologyAI - Issues and Terminology
AI - Issues and Terminology
 
AI - Fuzzy Logic Systems
AI - Fuzzy Logic SystemsAI - Fuzzy Logic Systems
AI - Fuzzy Logic Systems
 
AI - working of an ns
AI - working of an nsAI - working of an ns
AI - working of an ns
 
Artificial Intelligence- Neural Networks
Artificial Intelligence- Neural NetworksArtificial Intelligence- Neural Networks
Artificial Intelligence- Neural Networks
 
AI - Robotics
AI - RoboticsAI - Robotics
AI - Robotics
 
Applications of expert system
Applications of expert systemApplications of expert system
Applications of expert system
 
Components of expert systems
Components of expert systemsComponents of expert systems
Components of expert systems
 
Artificial intelligence - expert systems
 Artificial intelligence - expert systems Artificial intelligence - expert systems
Artificial intelligence - expert systems
 
AI - natural language processing
AI - natural language processingAI - natural language processing
AI - natural language processing
 
Ai popular search algorithms
Ai   popular search algorithmsAi   popular search algorithms
Ai popular search algorithms
 
AI - Agents & Environments
AI - Agents & EnvironmentsAI - Agents & Environments
AI - Agents & Environments
 
Artificial intelligence - research areas
Artificial intelligence - research areasArtificial intelligence - research areas
Artificial intelligence - research areas
 
Artificial intelligence composed
Artificial intelligence composedArtificial intelligence composed
Artificial intelligence composed
 
Artificial intelligence intelligent systems
Artificial intelligence   intelligent systemsArtificial intelligence   intelligent systems
Artificial intelligence intelligent systems
 
Applications of ai
Applications of aiApplications of ai
Applications of ai
 

Recently uploaded

Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
eudsoh
 
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
nitachopra
 
Call Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
Call Girls Lucknow 0000000000 Independent Call Girl Service LucknowCall Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
Call Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
hiju9823
 
Bangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts ServiceBangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts Service
nhero3888
 
SAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content DocumentSAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content Document
newdirectionconsulta
 
Senior Software Profiles Backend Sample - Sheet1.pdf
Senior Software Profiles  Backend Sample - Sheet1.pdfSenior Software Profiles  Backend Sample - Sheet1.pdf
Senior Software Profiles Backend Sample - Sheet1.pdf
Vineet
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
nhutnguyen355078
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
Vineet
 
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdfNamma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
22ad0301
 
Call Girls Hyderabad (india) ☎️ +91-7426014248 Hyderabad Call Girl
Call Girls Hyderabad  (india) ☎️ +91-7426014248 Hyderabad  Call GirlCall Girls Hyderabad  (india) ☎️ +91-7426014248 Hyderabad  Call Girl
Call Girls Hyderabad (india) ☎️ +91-7426014248 Hyderabad Call Girl
sapna sharmap11
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
Vineet
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
uevausa
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
Alireza Kamrani
 
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
Timothy Spann
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
osoyvvf
 
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
PsychoTech Services
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 
Drownings spike from May to August in children
Drownings spike from May to August in childrenDrownings spike from May to August in children
Drownings spike from May to August in children
Bisnar Chase Personal Injury Attorneys
 

Recently uploaded (20)

Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
一比一原版马来西亚博特拉大学毕业证(upm毕业证)如何办理
 
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
Call Girls Goa👉9024918724👉Low Rate Escorts in Goa 💃 Available 24/7
 
Call Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
Call Girls Lucknow 0000000000 Independent Call Girl Service LucknowCall Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
Call Girls Lucknow 0000000000 Independent Call Girl Service Lucknow
 
Bangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts ServiceBangalore ℂall Girl 000000 Bangalore Escorts Service
Bangalore ℂall Girl 000000 Bangalore Escorts Service
 
SAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content DocumentSAP BW4HANA Implementagtion Content Document
SAP BW4HANA Implementagtion Content Document
 
Senior Software Profiles Backend Sample - Sheet1.pdf
Senior Software Profiles  Backend Sample - Sheet1.pdfSenior Software Profiles  Backend Sample - Sheet1.pdf
Senior Software Profiles Backend Sample - Sheet1.pdf
 
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdfOverview IFM June 2024 Consumer Confidence INDEX Report.pdf
Overview IFM June 2024 Consumer Confidence INDEX Report.pdf
 
Senior Engineering Sample EM DOE - Sheet1.pdf
Senior Engineering Sample EM DOE  - Sheet1.pdfSenior Engineering Sample EM DOE  - Sheet1.pdf
Senior Engineering Sample EM DOE - Sheet1.pdf
 
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdfNamma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
Namma-Kalvi-11th-Physics-Study-Material-Unit-1-EM-221086.pdf
 
Call Girls Hyderabad (india) ☎️ +91-7426014248 Hyderabad Call Girl
Call Girls Hyderabad  (india) ☎️ +91-7426014248 Hyderabad  Call GirlCall Girls Hyderabad  (india) ☎️ +91-7426014248 Hyderabad  Call Girl
Call Girls Hyderabad (india) ☎️ +91-7426014248 Hyderabad Call Girl
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
 
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
一比一原版加拿大渥太华大学毕业证(uottawa毕业证书)如何办理
 
How To Control IO Usage using Resource Manager
How To Control IO Usage using Resource ManagerHow To Control IO Usage using Resource Manager
How To Control IO Usage using Resource Manager
 
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
06-20-2024-AI Camp Meetup-Unstructured Data and Vector Databases
 
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
一比一原版(uom毕业证书)曼彻斯特大学毕业证如何办理
 
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
Interview Methods - Marital and Family Therapy and Counselling - Psychology S...
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 
Drownings spike from May to August in children
Drownings spike from May to August in childrenDrownings spike from May to August in children
Drownings spike from May to August in children
 

Data Science Training in Bangalore | Learnbay.in | Decision Tree | Machine Learning Course

  • 2. Introduction Given an event, predict is category. Examples: Who won a given ball game? How should we file a given email? What word sense was intended for a given occurrence of a word? Event = list of features. Examples: Ball game: Which players were on offense? Email: Who sent the email? Disambiguation: What was the preceding word? 2
  • 3. Introduction  Use a decision tree to predict categories for new events.  Use training data to build the decision tree. 3 New Events Decision Tree Category Training Events and Categories
  • 4. Decision Tree for PlayTennis4 Outlook Sunny Overcast Rain Humidity High Normal No Yes Each internal node tests an attribute Each branch corresponds to an attribute value node Each leaf node assigns a classification
  • 5. Word Sense Disambiguation  Given an occurrence of a word, decide which sense, or meaning, was intended.  Example: "run"  run1: move swiftly (I ran to the store.)  run2: operate (I run a store.)  run3: flow (Water runs from the spring.)  run4: length of torn stitches (Her stockings had a run.)  etc. 5
  • 6. Word Sense Disambiguation  Categories Use word sense labels (run1, run2, etc.) to name the possible categories.  Features Features describe the context of the word we want to disambiguate. Possible features include: near(w): is the given word near an occurrence of word w? pos: the word’s part of speech left(w): is the word immediately preceded by the word w? etc. 6
  • 7. Word Sense Disambiguation  Example decision tree: (Note: Decision trees for WSD tend to be quite large) 7 pos near(race) near(river) near(stocking) run4 run1 yes no noun verb yes no run3 yes no
  • 8. WSD: Sample Training Data Features Word Sensepos near(race) near(river) near(stockings) noun no no no run4 verb no no no run1 verb no yes no run3 noun yes yes yes run4 verb no no yes run1 verb yes yes no run2 verb no yes yes run3 8
  • 9. Decision Tree for Conjunction9 Outlook Sunny Overcast Rain Wind Strong Weak No Yes No Outlook=Sunny  Wind=Weak No
  • 10. Decision Tree for Disjunction10 Outlook Sunny Overcast Rain Yes Outlook=Sunny  Wind=Weak Wind Strong Weak No Yes Wind Strong Weak No Yes
  • 11. Decision Tree for XOR11 Outlook Sunny Overcast Rain Wind Strong Weak Yes No Outlook=Sunny XOR Wind=Weak Wind Strong Weak No Yes Wind Strong Weak No Yes
  • 12. Decision Tree12 Outlook Sunny Overcast Rain Humidity High Normal Wind Strong Weak No Yes Yes YesNo • decision trees represent disjunctions of conjunctions (Outlook=Sunny  Humidity=Normal)  (Outlook=Overcast)  (Outlook=Rain  Wind=Weak)
  • 13. When to consider Decision Trees Instances describable by attribute-value pairs Target function is discrete valued Disjunctive hypothesis may be required Possibly noisy training data Missing attribute values Examples: Medical diagnosis Credit risk analysis Object classification for robot manipulator (Tan 1993) 13
  • 14. Top-Down Induction of Decision Trees ID3 14 1. A  the “best” decision attribute for next node 2. Assign A as decision attribute for node 3. For each value of A create new descendant 4. Sort training examples to leaf node according to the attribute value of the branch 5. If all training examples are perfectly classified (same value of target attribute) stop, else iterate over new leaf nodes.
  • 15. Which attribute is best?15 A1=? G H [21+, 5-] [8+, 30-] [29+,35-] A2=? L M [18+, 33-] [11+, 2-] [29+,35-]
  • 16. Entropy  S is a sample of training examples  p+ is the proportion of positive examples  p- is the proportion of negative examples  Entropy measures the impurity of S Entropy(S) = -p+ log2 p+ - p- log2 p- 16
  • 17. Entropy  Entropy(S)= expected number of bits needed to encode class (+ or -) of randomly drawn members of S (under the optimal, shortest length-code) Why?  Information theory optimal length code assign –log2 p bits to messages having probability p.  So the expected number of bits to encode (+ or -) of random member of S: -p+ log2 p+ - p- log2 p- 17
  • 18. Information Gain (S=E)  Gain(S,A): expected reduction in entropy due to sorting S on attribute A 18 A1=? G H [21+, 5-] [8+, 30-] [29+,35-] A2=? True False [18+, 33-] [11+, 2-] [29+,35-] Entropy([29+,35-]) = -29/64 log2 29/64 – 35/64 log2 35/64 = 0.99
  • 19. Information Gain Entropy([21+,5-]) = 0.71 Entropy([8+,30-]) = 0.74 Gain(S,A1)=Entropy(S) -26/64*Entropy([21+,5-]) -38/64*Entropy([8+,30-]) =0.27 19 A1=? True False [21+, 5-] [8+, 30-] [29+,35-] Entropy([18+,33-]) = 0.94 Entropy([11+,2-]) = 0.62 Gain(S,A2)=Entropy(S) -51/64*Entropy([18+,33-]) -13/64*Entropy([11+,2-]) =0.12 A2=? True False [18+, 33-] [11+, 2-] [29+,35-]
  • 21. Selecting the Next Attribute21 Humidity High Normal [3+, 4-] [6+, 1-] S=[9+,5-] E=0.940 Gain(S,Humidity) =0.940-(7/14)*0.985 – (7/14)*0.592 =0.151 E=0.985 E=0.592 Wind Weak Strong [6+, 2-] [3+, 3-] S=[9+,5-] E=0.940 E=0.811 E=1.0 Gain(S,Wind) =0.940-(8/14)*0.811 – (6/14)*1.0 =0.048 Humidity provides greater info. gain than Wind, w.r.t target classification.
  • 22. Selecting the Next Attribute22 Outlook Sunny Rain [2+, 3-] [3+, 2-] S=[9+,5-] E=0.940 Gain(S,Outlook) =0.940-(5/14)*0.971 -(4/14)*0.0 – (5/14)*0.0971 =0.247 E=0.971 E=0.971 Over cast [4+, 0] E=0.0
  • 23. Selecting the Next Attribute23 The information gain values for the 4 attributes are: • Gain(S,Outlook) =0.247 • Gain(S,Humidity) =0.151 • Gain(S,Wind) =0.048 • Gain(S,Temperature) =0.029 where S denotes the collection of training examples
  • 24. ID3 Algorithm24 Outlook Sunny Overcast Rain Yes [D1,D2,…,D14] [9+,5-] Ssunny =[D1,D2,D8,D9,D11] [2+,3-] ? ? [D3,D7,D12,D13] [4+,0-] [D4,D5,D6,D10,D14] [3+,2-] Gain(Ssunny, Humidity)=0.970-(3/5)0.0 – 2/5(0.0) = 0.970 Gain(Ssunny, Temp.)=0.970-(2/5)0.0 –2/5(1.0)-(1/5)0.0 = 0.570 Gain(Ssunny, Wind)=0.970= -(2/5)1.0 – 3/5(0.918) = 0.019
  • 25. ID3 Algorithm25 Outlook Sunny Overcast Rain Humidity High Normal Wind Strong Weak No Yes Yes YesNo [D3,D7,D12,D13] [D8,D9,D11] [mistake] [D6,D14][D1,D2] [D4,D5,D10]
  • 26. Occam’s Razor ”If two theories explain the facts equally weel, then the simpler theory is to be preferred” Arguments in favor: Fewer short hypotheses than long hypotheses A short hypothesis that fits the data is unlikely to be a coincidence A long hypothesis that fits the data might be a coincidence Arguments opposed: There are many ways to define small sets of hypotheses 26
  • 27. Overfitting  One of the biggest problems with decision trees is Overfitting 27
  • 28. Avoid Overfitting  Stop growing when split not statistically significant  Grow full tree, then post-prune Select “best” tree:  measure performance over training data  measure performance over separate validation data set  min( |tree|+|misclassifications(tree)|) 28
  • 29. Effect of Reduced Error Pruning29
  • 30. Converting a Tree to Rules30 Outlook Sunny Overcast Rain Humidity High Normal Wind Strong Weak No Yes Yes YesNo R1: If (Outlook=Sunny)  (Humidity=High) Then PlayTennis=No R2: If (Outlook=Sunny)  (Humidity=Normal) Then PlayTennis=Yes R3: If (Outlook=Overcast) Then PlayTennis=Yes R4: If (Outlook=Rain)  (Wind=Strong) Then PlayTennis=No R5: If (Outlook=Rain)  (Wind=Weak) Then PlayTennis=Yes
  • 31. Continuous Valued Attributes Create a discrete attribute to test continuous  Temperature = 24.50C  (Temperature > 20.00C) = {true, false} Where to set the threshold? 31 180C NoYesYesYesNoNoPlayTennis 270C240C220C190C150CTemperature
  • 32. Random forest classifier  Random forest classifier, an extension to bagging which uses de-correlated trees.  To say it in simple words: Random forest builds multiple decision trees and merges them together to get a more accurate and stable prediction
  • 34. Random Forest Classifier Nexamples Create bootstrap samples from the training data ....… M features
  • 35. Random Forest Classifier Nexamples Construct a decision tree ....… M features
  • 36. Random Forest Classifier Nexamples ....… M features At each node in choosing the split feature choose only among m<M features
  • 37. Random Forest Classifier Create decision tree from each bootstrap sample Nexamples ....… ....… M features
  • 39. Unknown Attribute Values What if some examples have missing values of A? Use training example anyway sort through tree  If node n tests A, assign most common value of A among other examples sorted to node n.  Assign most common value of A among other examples with same target value  Assign probability pi to each possible value vi of A Assign fraction pi of example to each descendant in tree Classify new examples in the same fashion 39
  • 40. Cross-Validation  Estimate the accuracy of an hypothesis induced by a supervised learning algorithm  Predict the accuracy of an hypothesis over future unseen instances  Select the optimal hypothesis from a given set of alternative hypotheses  Pruning decision trees  Model selection  Feature selection  Combining multiple classifiers (boosting) 40