SlideShare ist ein Scribd-Unternehmen logo
1 von 6
Downloaden Sie, um offline zu lesen
Module
          12
Machine Learning
        Version 2 CSE IIT, Kharagpur
Lesson
             35
Rule Induction and
  Decision Tree - I
          Version 2 CSE IIT, Kharagpur
12.3 Decision Trees
Decision trees are a class of learning models that are more robust to noise as well as more
powerful as compared to concept learning. Consider the problem of classifying a star
based on some astronomical measurements. It can naturally be represented by the
following set of decisions on each measurement arranged in a tree like fashion.


                                        Luminosity

                      Mass <= T1                                > T1

     <= T2                                   > T2                       Type C


    Type A                                   Type B

12.3.1 Decision Tree: Definition
•   A decision-tree learning algorithm approximates a target concept using a tree
    representation, where each internal node corresponds to an attribute, and every
    terminal node corresponds to a class.
•   There are two types of nodes:
        o Internal node.- Splits into different branches according to the different values
           the corresponding attribute can take. Example: luminosity <= T1 or
           luminosity > T1.
        o Terminal Node.- Decides the class assigned to the example.

12.3.2 Classifying Examples Using Decision Tree
To classify an example X we start at the root of the tree, and check the value of that
attribute on X. We follow the branch corresponding to that value and jump to the next
node. We continue until we reach a terminal node and take that class as our best
prediction.




                                                           Version 2 CSE IIT, Kharagpur
X = (Luminosity <= T1, Mass > T2)

                                    Luminosity

                             <= T1                    > T1
                      M as s

              <= T2                  > T2                         Type C


                                       Type B                        Assigned Class
      Type A

Decision trees adopt a DNF (Disjunctive Normal Form) representation. For a fixed class,
every branch from the root of the tree to a terminal node with that class is a conjunction
of attribute values; different branches ending in that class form a disjunction.

In the following example, the rules for class A are: (~X1 & ~x2) OR (X1 & ~x3)
                                   x1
                         0                    1
              x                                             x

      0                   1                       0                  1

                         B                     A                     C


12.3.3 Decision Tree Construction
There are different ways to construct trees from data. We will concentrate on the top-
down, greedy search approach:

Basic idea:

 1. Choose the best attribute a* to place at the root of the tree.


                                                                Version 2 CSE IIT, Kharagpur
2. Separate training set D into subsets {D1, D2, .., Dk} where each subset Di contains
     examples having the same value for a*

       3. Recursively apply the algorithm on each new subset until examples have the same
     class or there are few of them.

     Illustration:




            t2                                                 Class P: Poisonous
humidity
                                                                Class N: Non-
            t3                                                  poisonous



                               t1        size


     Attributes: size and humidity.
     Size has two values: >t1 or <= t1
     Humidity has three values: >t2, (>t3 and <=t2), <= t3

                                            Suppose we choose size as the best

           t2
                                                                  size
           t3
                                                      <= T1               > T1

                          t1                             ?
                                                                                    P
             Class P: poisonous
             Class N: not-poisonous




                                                              Version 2 CSE IIT, Kharagpur
Suppose we choose humidity as the next best


    t2
                                                               size
    t3
                                                <= T1                    > T1

                    t1                         humidity
                                                                                  P
                                 >t2                   <= t3
                                           > t3 & <= t2

                                   N             P            N
Steps:

•   Create a root for the tree
•    If all examples are of the same class or the number of examples is below a threshold
    return that class
•    If no attributes available return majority class
•    Let a* be the best attribute
•    For each possible value v of a*
         • Add a branch below a* labeled “a = v”
         • Let Sv be the subsets of example where attribute a*=v
         • Recursively apply the algorithm to Sv




                                                          Version 2 CSE IIT, Kharagpur

Weitere ähnliche Inhalte

Was ist angesagt?

CommunicationComplexity1_jieren
CommunicationComplexity1_jierenCommunicationComplexity1_jieren
CommunicationComplexity1_jierenjie ren
 
Kernels and Support Vector Machines
Kernels and Support Vector  MachinesKernels and Support Vector  Machines
Kernels and Support Vector MachinesEdgar Marca
 
Hands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in PythonHands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in PythonChun-Ming Chang
 
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...CSCJournals
 
Support vector machine
Support vector machineSupport vector machine
Support vector machinePrasenjit Dey
 
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 Treeswebisslides
 
20070823
2007082320070823
20070823neostar
 
Numerical solution of fuzzy hybrid differential equation by third order runge...
Numerical solution of fuzzy hybrid differential equation by third order runge...Numerical solution of fuzzy hybrid differential equation by third order runge...
Numerical solution of fuzzy hybrid differential equation by third order runge...Alexander Decker
 
11.numerical solution of fuzzy hybrid differential equation by third order ru...
11.numerical solution of fuzzy hybrid differential equation by third order ru...11.numerical solution of fuzzy hybrid differential equation by third order ru...
11.numerical solution of fuzzy hybrid differential equation by third order ru...Alexander Decker
 
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...Alexander Decker
 
Combinatorial Problems2
Combinatorial Problems2Combinatorial Problems2
Combinatorial Problems23ashmawy
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsSelman Bozkır
 
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...Lushanthan Sivaneasharajah
 

Was ist angesagt? (18)

CommunicationComplexity1_jieren
CommunicationComplexity1_jierenCommunicationComplexity1_jieren
CommunicationComplexity1_jieren
 
E2
E2E2
E2
 
Kernels and Support Vector Machines
Kernels and Support Vector  MachinesKernels and Support Vector  Machines
Kernels and Support Vector Machines
 
Hands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in PythonHands-on Tutorial of Machine Learning in Python
Hands-on Tutorial of Machine Learning in Python
 
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...
Time Domain Signal Analysis Using Modified Haar and Modified Daubechies Wavel...
 
Support vector machine
Support vector machineSupport vector machine
Support vector machine
 
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
 
Strings
StringsStrings
Strings
 
Strings
StringsStrings
Strings
 
20070823
2007082320070823
20070823
 
Numerical solution of fuzzy hybrid differential equation by third order runge...
Numerical solution of fuzzy hybrid differential equation by third order runge...Numerical solution of fuzzy hybrid differential equation by third order runge...
Numerical solution of fuzzy hybrid differential equation by third order runge...
 
11.numerical solution of fuzzy hybrid differential equation by third order ru...
11.numerical solution of fuzzy hybrid differential equation by third order ru...11.numerical solution of fuzzy hybrid differential equation by third order ru...
11.numerical solution of fuzzy hybrid differential equation by third order ru...
 
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...
11.[8 17]numerical solution of fuzzy hybrid differential equation by third or...
 
Combinatorial Problems2
Combinatorial Problems2Combinatorial Problems2
Combinatorial Problems2
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systems
 
Svm algorithm
Svm algorithmSvm algorithm
Svm algorithm
 
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...
Application of Fisher Linear Discriminant Analysis to Speech/Music Classifica...
 
Ai unit-3
Ai unit-3Ai unit-3
Ai unit-3
 

Andere mochten auch

Andere mochten auch (9)

Lesson 20
Lesson 20Lesson 20
Lesson 20
 
Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Lesson 23
Lesson 23Lesson 23
Lesson 23
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
 
Lesson 25
Lesson 25Lesson 25
Lesson 25
 
Lesson 21
Lesson 21Lesson 21
Lesson 21
 
Inaugural Addresses
Inaugural AddressesInaugural Addresses
Inaugural Addresses
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & Textspeak
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Ähnlich wie Lesson 35

CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...Raed Aldahdooh
 
20070702 Text Categorization
20070702 Text Categorization20070702 Text Categorization
20070702 Text Categorizationmidi
 
Neural network precept diagnosis on petrochemical pipelines for quality maint...
Neural network precept diagnosis on petrochemical pipelines for quality maint...Neural network precept diagnosis on petrochemical pipelines for quality maint...
Neural network precept diagnosis on petrochemical pipelines for quality maint...Alexander Decker
 
Mining Implications from Lattices of Closed Trees
Mining Implications from Lattices of Closed TreesMining Implications from Lattices of Closed Trees
Mining Implications from Lattices of Closed TreesAlbert Bifet
 
20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared verHsing-chuan Hsieh
 
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reductionAaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reductionAminaRepo
 

Ähnlich wie Lesson 35 (8)

CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...CLIQUE Automatic subspace clustering of high dimensional data for data mining...
CLIQUE Automatic subspace clustering of high dimensional data for data mining...
 
20070702 Text Categorization
20070702 Text Categorization20070702 Text Categorization
20070702 Text Categorization
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Decision Trees.ppt
Decision Trees.pptDecision Trees.ppt
Decision Trees.ppt
 
Neural network precept diagnosis on petrochemical pipelines for quality maint...
Neural network precept diagnosis on petrochemical pipelines for quality maint...Neural network precept diagnosis on petrochemical pipelines for quality maint...
Neural network precept diagnosis on petrochemical pipelines for quality maint...
 
Mining Implications from Lattices of Closed Trees
Mining Implications from Lattices of Closed TreesMining Implications from Lattices of Closed Trees
Mining Implications from Lattices of Closed Trees
 
20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver20211019 When does label smoothing help_shared ver
20211019 When does label smoothing help_shared ver
 
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reductionAaa ped-17-Unsupervised Learning: Dimensionality reduction
Aaa ped-17-Unsupervised Learning: Dimensionality reduction
 

Mehr von Avijit Kumar (16)

Lesson 24
Lesson 24Lesson 24
Lesson 24
 
Lesson 22
Lesson 22Lesson 22
Lesson 22
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
 
Lesson 27
Lesson 27Lesson 27
Lesson 27
 
Lesson 28
Lesson 28Lesson 28
Lesson 28
 
Lesson 29
Lesson 29Lesson 29
Lesson 29
 
Lesson 30
Lesson 30Lesson 30
Lesson 30
 
Lesson 31
Lesson 31Lesson 31
Lesson 31
 
Lesson 32
Lesson 32Lesson 32
Lesson 32
 
Lesson 33
Lesson 33Lesson 33
Lesson 33
 
Lesson 36
Lesson 36Lesson 36
Lesson 36
 
Lesson 37
Lesson 37Lesson 37
Lesson 37
 
Lesson 39
Lesson 39Lesson 39
Lesson 39
 
Lesson 38
Lesson 38Lesson 38
Lesson 38
 
Lesson 41
Lesson 41Lesson 41
Lesson 41
 
Lesson 40
Lesson 40Lesson 40
Lesson 40
 

Kürzlich hochgeladen

Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMintel Group
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607dollysharma2066
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?Olivia Kresic
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Servicecallgirls2057
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Seta Wicaksana
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesKeppelCorporation
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03DallasHaselhorst
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy Verified Accounts
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024Adnet Communications
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCRashishs7044
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Pereraictsugar
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfRbc Rbcua
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environmentelijahj01012
 
Appkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxAppkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxappkodes
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfrichard876048
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandSharisaBethune
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCRashishs7044
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFChandresh Chudasama
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckHajeJanKamps
 

Kürzlich hochgeladen (20)

Call Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North GoaCall Us ➥9319373153▻Call Girls In North Goa
Call Us ➥9319373153▻Call Girls In North Goa
 
Market Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 EditionMarket Sizes Sample Report - 2024 Edition
Market Sizes Sample Report - 2024 Edition
 
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
(Best) ENJOY Call Girls in Faridabad Ex | 8377087607
 
MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?MAHA Global and IPR: Do Actions Speak Louder Than Words?
MAHA Global and IPR: Do Actions Speak Louder Than Words?
 
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort ServiceCall US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
Call US-88OO1O2216 Call Girls In Mahipalpur Female Escort Service
 
Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...Ten Organizational Design Models to align structure and operations to busines...
Ten Organizational Design Models to align structure and operations to busines...
 
Annual General Meeting Presentation Slides
Annual General Meeting Presentation SlidesAnnual General Meeting Presentation Slides
Annual General Meeting Presentation Slides
 
Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03Cybersecurity Awareness Training Presentation v2024.03
Cybersecurity Awareness Training Presentation v2024.03
 
Buy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail AccountsBuy gmail accounts.pdf Buy Old Gmail Accounts
Buy gmail accounts.pdf Buy Old Gmail Accounts
 
TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024TriStar Gold Corporate Presentation - April 2024
TriStar Gold Corporate Presentation - April 2024
 
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR8447779800, Low rate Call girls in Tughlakabad Delhi NCR
8447779800, Low rate Call girls in Tughlakabad Delhi NCR
 
Kenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith PereraKenya Coconut Production Presentation by Dr. Lalith Perera
Kenya Coconut Production Presentation by Dr. Lalith Perera
 
APRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdfAPRIL2024_UKRAINE_xml_0000000000000 .pdf
APRIL2024_UKRAINE_xml_0000000000000 .pdf
 
Cyber Security Training in Office Environment
Cyber Security Training in Office EnvironmentCyber Security Training in Office Environment
Cyber Security Training in Office Environment
 
Appkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptxAppkodes Tinder Clone Script with Customisable Solutions.pptx
Appkodes Tinder Clone Script with Customisable Solutions.pptx
 
Innovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdfInnovation Conference 5th March 2024.pdf
Innovation Conference 5th March 2024.pdf
 
PB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal BrandPB Project 1: Exploring Your Personal Brand
PB Project 1: Exploring Your Personal Brand
 
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR8447779800, Low rate Call girls in Dwarka mor Delhi NCR
8447779800, Low rate Call girls in Dwarka mor Delhi NCR
 
Guide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDFGuide Complete Set of Residential Architectural Drawings PDF
Guide Complete Set of Residential Architectural Drawings PDF
 
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deckPitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
Pitch Deck Teardown: Geodesic.Life's $500k Pre-seed deck
 

Lesson 35

  • 1. Module 12 Machine Learning Version 2 CSE IIT, Kharagpur
  • 2. Lesson 35 Rule Induction and Decision Tree - I Version 2 CSE IIT, Kharagpur
  • 3. 12.3 Decision Trees Decision trees are a class of learning models that are more robust to noise as well as more powerful as compared to concept learning. Consider the problem of classifying a star based on some astronomical measurements. It can naturally be represented by the following set of decisions on each measurement arranged in a tree like fashion. Luminosity Mass <= T1 > T1 <= T2 > T2 Type C Type A Type B 12.3.1 Decision Tree: Definition • A decision-tree learning algorithm approximates a target concept using a tree representation, where each internal node corresponds to an attribute, and every terminal node corresponds to a class. • There are two types of nodes: o Internal node.- Splits into different branches according to the different values the corresponding attribute can take. Example: luminosity <= T1 or luminosity > T1. o Terminal Node.- Decides the class assigned to the example. 12.3.2 Classifying Examples Using Decision Tree To classify an example X we start at the root of the tree, and check the value of that attribute on X. We follow the branch corresponding to that value and jump to the next node. We continue until we reach a terminal node and take that class as our best prediction. Version 2 CSE IIT, Kharagpur
  • 4. X = (Luminosity <= T1, Mass > T2) Luminosity <= T1 > T1 M as s <= T2 > T2 Type C Type B Assigned Class Type A Decision trees adopt a DNF (Disjunctive Normal Form) representation. For a fixed class, every branch from the root of the tree to a terminal node with that class is a conjunction of attribute values; different branches ending in that class form a disjunction. In the following example, the rules for class A are: (~X1 & ~x2) OR (X1 & ~x3) x1 0 1 x x 0 1 0 1 B A C 12.3.3 Decision Tree Construction There are different ways to construct trees from data. We will concentrate on the top- down, greedy search approach: Basic idea: 1. Choose the best attribute a* to place at the root of the tree. Version 2 CSE IIT, Kharagpur
  • 5. 2. Separate training set D into subsets {D1, D2, .., Dk} where each subset Di contains examples having the same value for a* 3. Recursively apply the algorithm on each new subset until examples have the same class or there are few of them. Illustration: t2 Class P: Poisonous humidity Class N: Non- t3 poisonous t1 size Attributes: size and humidity. Size has two values: >t1 or <= t1 Humidity has three values: >t2, (>t3 and <=t2), <= t3 Suppose we choose size as the best t2 size t3 <= T1 > T1 t1 ? P Class P: poisonous Class N: not-poisonous Version 2 CSE IIT, Kharagpur
  • 6. Suppose we choose humidity as the next best t2 size t3 <= T1 > T1 t1 humidity P >t2 <= t3 > t3 & <= t2 N P N Steps: • Create a root for the tree • If all examples are of the same class or the number of examples is below a threshold return that class • If no attributes available return majority class • Let a* be the best attribute • For each possible value v of a* • Add a branch below a* labeled “a = v” • Let Sv be the subsets of example where attribute a*=v • Recursively apply the algorithm to Sv Version 2 CSE IIT, Kharagpur