SlideShare a Scribd company logo
1 of 6
Download to read offline
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

More Related Content

What's hot

CommunicationComplexity1_jieren
CommunicationComplexity1_jierenCommunicationComplexity1_jieren
CommunicationComplexity1_jieren
jie ren
 
20070823
2007082320070823
20070823
neostar
 
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
 
Combinatorial Problems2
Combinatorial Problems2Combinatorial Problems2
Combinatorial Problems2
3ashmawy
 
Probabilistic information retrieval models & systems
Probabilistic information retrieval models & systemsProbabilistic information retrieval models & systems
Probabilistic information retrieval models & systems
Selman Bozkır
 

What's hot (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
 

Viewers also liked (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
 

Similar to 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
 
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
 

Similar to Lesson 35 (9)

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
 
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdfUnit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
Unit-3 greedy method, Prim's algorithm, Kruskal's algorithm.pdf
 
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
 

More from 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
 

Recently uploaded

Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pillsMifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Abortion pills in Kuwait Cytotec pills in Kuwait
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
daisycvs
 
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
instagramfab782445
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
daisycvs
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 

Recently uploaded (20)

Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
 
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
 
Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024Marel Q1 2024 Investor Presentation from May 8, 2024
Marel Q1 2024 Investor Presentation from May 8, 2024
 
BeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdfBeMetals Investor Presentation_May 3, 2024.pdf
BeMetals Investor Presentation_May 3, 2024.pdf
 
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pillsMifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
Mifty kit IN Salmiya (+918133066128) Abortion pills IN Salmiyah Cytotec pills
 
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai KuwaitThe Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
The Abortion pills for sale in Qatar@Doha [+27737758557] []Deira Dubai Kuwait
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...joint cost.pptx  COST ACCOUNTING  Sixteenth Edition                          ...
joint cost.pptx COST ACCOUNTING Sixteenth Edition ...
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
 
Power point presentation on enterprise performance management
Power point presentation on enterprise performance managementPower point presentation on enterprise performance management
Power point presentation on enterprise performance management
 
Falcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business PotentialFalcon Invoice Discounting: Unlock Your Business Potential
Falcon Invoice Discounting: Unlock Your Business Potential
 
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
Quick Doctor In Kuwait +2773`7758`557 Kuwait Doha Qatar Dubai Abu Dhabi Sharj...
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
Falcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business GrowthFalcon Invoice Discounting: Empowering Your Business Growth
Falcon Invoice Discounting: Empowering Your Business Growth
 
Organizational Transformation Lead with Culture
Organizational Transformation Lead with CultureOrganizational Transformation Lead with Culture
Organizational Transformation Lead with Culture
 
Famous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st CenturyFamous Olympic Siblings from the 21st Century
Famous Olympic Siblings from the 21st Century
 

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