Data Mining Chapter 4 Algorithms: The Basic Methods - Constructing decision trees Reporter: Yuen-Kuei Hsueh Date: 2008/7/24.

Slides:



Advertisements
Similar presentations
CHAPTER 9: Decision Trees
Advertisements

Hunt’s Algorithm CIT365: Data Mining & Data Warehousing Bajuna Salehe
Decision Tree Approach in Data Mining
Introduction Training Complexity, Pruning CART vs. ID3 vs. C4.5
Classification Techniques: Decision Tree Learning
Naïve Bayes: discussion
Decision Trees.
Decision Trees Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Eibe Frank and Jiawei Han.
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Constructing Decision Trees. A Decision Tree Example The weather data example. ID codeOutlookTemperatureHumidityWindyPlay abcdefghijklmnabcdefghijklmn.
1 Classification with Decision Trees Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Eibe Frank and Jiawei.
Classification: Decision Trees
1 Classification with Decision Trees I Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Eibe Frank and Jiawei.
Biological Data Mining (Predicting Post-synaptic Activity in Proteins)
Decision Trees an Introduction.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
1 1 1 Berendt: Advanced databases, 2010, Advanced databases – Inferring implicit/new knowledge from data(bases):
Covering Algorithms. Trees vs. rules From trees to rules. Easy: converting a tree into a set of rules –One rule for each leaf: –Antecedent contains a.
Inferring rudimentary rules
The joy of Entropy. Administrivia Reminder: HW 1 due next week No other news. No noose is good noose...
Classification: Decision Trees 2 Outline  Top-Down Decision Tree Construction  Choosing the Splitting Attribute  Information Gain and Gain Ratio.
Machine Learning Lecture 10 Decision Trees G53MLE Machine Learning Dr Guoping Qiu1.
Learning Chapter 18 and Parts of Chapter 20
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Machine Learning Chapter 3. Decision Tree Learning
Weka Project assignment 3
Classification I. 2 The Task Input: Collection of instances with a set of attributes x and a special nominal attribute Y called class attribute Output:
Lecture 7. Outline 1. Overview of Classification and Decision Tree 2. Algorithm to build Decision Tree 3. Formula to measure information 4. Weka, data.
Clustering II. 2 Finite Mixtures Model data using a mixture of distributions –Each distribution represents one cluster –Each distribution gives probabilities.
CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Decision Tree Learning Debapriyo Majumdar Data Mining – Fall 2014 Indian Statistical Institute Kolkata August 25, 2014.
1 Learning Chapter 18 and Parts of Chapter 20 AI systems are complex and may have many parameters. It is impractical and often impossible to encode all.
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.3: Decision Trees Rodney Nielsen Many of.
Slides for “Data Mining” by I. H. Witten and E. Frank.
Data Mining – Algorithms: Decision Trees - ID3 Chapter 4, Section 4.3.
CS690L Data Mining: Classification
Algorithms: Decision Trees 2 Outline  Introduction: Data Mining and Classification  Classification  Decision trees  Splitting attribute  Information.
MACHINE LEARNING 10 Decision Trees. Motivation  Parametric Estimation  Assume model for class probability or regression  Estimate parameters from all.
Decision Trees Binary output – easily extendible to multiple output classes. Takes a set of attributes for a given situation or object and outputs a yes/no.
1 Decision Tree Learning Original slides by Raymond J. Mooney University of Texas at Austin.
Slide 1 DSCI 4520/5240: Data Mining Fall 2013 – Dr. Nick Evangelopoulos Lecture 5: Decision Tree Algorithms Material based on: Witten & Frank 2000, Olson.
1 Data Mining I Karl Young Center for Imaging of Neurodegenerative Diseases, UCSF.
1 Classification with Decision Trees Instructor: Qiang Yang Hong Kong University of Science and Technology Thanks: Eibe Frank and Jiawei.
Data Mining By Farzana Forhad CS 157B. Agenda Decision Tree and ID3 Rough Set Theory Clustering.
Decision Trees.
SEEM Tutorial 1 Classification: Decision tree Siyuan Zhang,
Decision Trees MSE 2400 EaLiCaRA Dr. Tom Way.
Decision Trees by Muhammad Owais Zahid
Chapter 3 Data Mining: Classification & Association Chapter 4 in the text box Section: 4.3 (4.3.1),
Review of Decision Tree Learning Bamshad Mobasher DePaul University Bamshad Mobasher DePaul University.
Induction of Decision Trees Blaž Zupan and Ivan Bratko magix.fri.uni-lj.si/predavanja/uisp.
DECISION TREES An internal node represents a test on an attribute.
Decision Trees an introduction.
Algorithms for Classification:
Classification Algorithms
Decision Trees.
Artificial Intelligence
Ch9: Decision Trees 9.1 Introduction A decision tree:
Data Science Algorithms: The Basic Methods
Advanced Artificial Intelligence
Machine Learning Chapter 3. Decision Tree Learning
Classification with Decision Trees
Machine Learning Chapter 3. Decision Tree Learning
Dept. of Computer Science University of Liverpool
Learning Chapter 18 and Parts of Chapter 20
Data Mining(中国人民大学) Yang qiang(香港科技大学) Han jia wei(UIUC)
Junheng, Shengming, Yunsheng 10/19/2018
INTRODUCTION TO Machine Learning 2nd Edition
Decision Trees Jeff Storey.
Data Mining CSCI 307, Spring 2019 Lecture 15
Presentation transcript:

Data Mining Chapter 4 Algorithms: The Basic Methods - Constructing decision trees Reporter: Yuen-Kuei Hsueh Date: 2008/7/24

Constructing decision trees Strategy: top down Recursive divide and conquer fashion –First: select attribute for root node Create branch for each possible attribute value –Then: split instances into subsets One for each branch extending from the node Finally: repeat recursively for each branch, using only instances that reach the branch Stop if all instances have the same class

Which attribute to select?

Criterion for attribute selection Which is the best attribute? – Want to get the smallest tree – Heuristic: choose the attribute that produces the “purest” nodes Popular impurity criterion: information gain –Information gain increases with the average purity of the subsets Strategy: choose attribute that gives greatest information gain

Computing information Measure information in bits –Given a probability distribution, the info required to predict an event is the distribution’s entropy –Entropy gives the information required in bits (can involve fractions of bits!) Formula for computing the entropy:

Example: attribute Outlook Outlook = Sunny : info[2,3]=entropy(2/5,3/5)=−2/5log(2/5)−3/5log(3/5)=0.971bits Outlook = Overcast : info[4,0]=entropy(1,0)=−1log(1)−0log(0)=0bits Outlook = Rainy : info[2,3]=entropy(3/5,2/5)=−3/5log(3/5)−2/5log(2/5)=0.971bits Expected information for attribute: info[3,2], [4,0], [3,2]=(5/14)×0.971+(4/14)×0+(5/14)×0.971=0.693bits NoYes

Computing information gain Information gain: information before splitting – information after splitting gain(Outlook )= info([9,5]) – info([2,3],[4,0],[3,2]) = – = bits Information gain for attributes from weather data: gain(Outlook ) = bits gain(Temperature ) = bits gain(Humidity ) = bits gain(Windy ) = bits

Continuing to split gain(Temperature ) = bits gain(Humidity ) = bits gain(Windy ) = bits

Final decision tree ● Note: not all leaves need to be pure; sometimes identical instances have different classes => Splitting stops when data can’t be split any further

Wishlist for a purity measure Properties we require from a purity measure: –When node is pure, measure should be zero –When impurity is maximal (i.e. all classes equally likely), measure should be maximal –Measure should obey multistage property (i.e. decisions can be made in several stages): measure[2,3,4]=measure([2,7])+(7/9)×measure([3,4]) Entropy is the only function that satisfies all three properties!

Properties of the entropy The multistage property: Simplification of computation: Info([2,3,4])=−2/9×log(2/9)−3/9×log(3/9)−4/9×log(4/9) =[−2×log2−3×log3−4×log4+9×log9]/9 Note: instead of maximizing info gain we could just minimize information

Highly-branching attributes Problematic: attributes with a large number of values (extreme case: ID code) Subsets are more likely to be pure if there is a large number of values =>Information gain is biased towards choosing attributes with a large number of values =>This may result in overfitting (selection of an attribute that is nonoptimal for prediction) Another problem: fragmentation

Weather data with ID code ID codeOutlookTempHumidityWindyPlay ASunnyHotHighFalseNo BSunnyHotHighTrueNo COvercastHotHighFalseYes DRainyMildHighFalseYes ERainyCoolNormalFalseYes FRainyCoolNormalTrueNo GOvercastCoolNormalTrueYes HSunnyMildHighFalseNo ISunnyCoolNormalFalseYes JRainyMildNormalFalseYes KSunnyMildNormalTrueYes LOvercastMildHighTrueYes MOvercastHotNormalFalseYes NRainyMildHighTrueNo

Tree stump for ID code attribute Entropy of split: =>Information gain is maximal for ID code (namely bits)

Gain ratio Gain ratio: a modification of the information gain that reduces its bias Gain ratio takes number and size of branches into account when choosing an attribute –It corrects the information gain by taking the intrinsic information of a split into account Intrinsic information: entropy of distribution of instances into branches (i.e. how much info do we need to tell which branch an instance belongs to)

Computing the gain ratio Example: intrinsic information for ID code Info([1,1,..., 1])=14×(−1/14×log(1/14))=3.807bits Value of attribute decreases as intrinsic information gets larger Definition of gain ratio: gain_ratio(attribute)=gain(attribute)/intrinsic_info(attribute) Example: gain_ratio(ID code)=0.940bits/3.807bits=0.246

Gain ratios for weather data OutlookTemperature Info:0.963 Gain: =0.247 Split info: info([5,4,5])=1.577 Gain ratio: 0.247/1.577=0.157 Info:0911 Gain: =0.029 Split info: info([5,4,5])=1.557 Gain ratio: 0.029/1.557=0.019 HumidityWindy Info:0.788 Gain: =0.152 Split info: info([5,4,5])=1.000 Gain ratio: 0.152/1=0.152 Info:0.892 Gain: =0.048 Split info: info([5,4,5])=0.985 Gain ratio: 0.048/0.985=0.049

More on the gain ratio “Outlook” still comes out top However: “ID code” has greater gain ratio –Standard fix: ad hoc test to prevent splitting on that type of attribute Problem with gain ratio: it may overcompensate –May choose an attribute just because its intrinsic information is very low –Standard fix: only consider attributes with greater than average information gain

Discussion Top-down induction of decision trees: ID3, algorithm developed by Ross Quinlan –Gain ratio just one modification of this basic algorithm –=>C4.5: deals with numeric attributes, missing values, noisy data Similar approach: CART There are many other attribute selection criteria! (But little difference in accuracy of result)