Data Mining Lecture 9.

Slides:



Advertisements
Similar presentations
Classification and Prediction
Advertisements

Paper By - Manish Mehta, Rakesh Agarwal and Jorma Rissanen
Huffman code and ID3 Prof. Sin-Min Lee Department of Computer Science.
Data Mining Techniques: Classification. Classification What is Classification? –Classifying tuples in a database –In training set E each tuple consists.
IT 433 Data Warehousing and Data Mining
Hunt’s Algorithm CIT365: Data Mining & Data Warehousing Bajuna Salehe
Decision Tree Approach in Data Mining
Data Mining Classification: Basic Concepts, Decision Trees, and Model Evaluation Lecture Notes for Chapter 4 Part I Introduction to Data Mining by Tan,
Classification: Definition Given a collection of records (training set ) –Each record contains a set of attributes, one of the attributes is the class.
1 Data Mining Classification Techniques: Decision Trees (BUSINESS INTELLIGENCE) Slides prepared by Elizabeth Anglo, DISCS ADMU.
Data Mining Classification: Basic Concepts, Decision Trees, and Model Evaluation Lecture Notes for Chapter 4 Introduction to Data Mining by Tan, Steinbach,
Classification Techniques: Decision Tree Learning
Lecture Notes for Chapter 4 Introduction to Data Mining
Classification and Prediction
Classification Continued
Lecture 5 (Classification with Decision Trees)
Decision Trees an Introduction.
SEG Tutorial 1 – Classification Decision tree, Naïve Bayes & k-NN CHANG Lijun.
Classification Based in part on Chapter 10 of Hand, Manilla, & Smyth and Chapter 7 of Han and Kamber David Madigan.
Classification and Prediction
Classification.
Chapter 4 Classification and Scoring
Machine Learning Lecture 10 Decision Trees G53MLE Machine Learning Dr Guoping Qiu1.
SEEM Tutorial 2 Classification: Decision tree, Naïve Bayes & k-NN
Chapter 7 Decision Tree.
DATA MINING : CLASSIFICATION. Classification : Definition  Classification is a supervised learning.  Uses training sets which has correct answers (class.
1 Data Mining Lecture 3: Decision Trees. 2 Classification: Definition l Given a collection of records (training set ) –Each record contains a set of attributes,
Lecture 7. Outline 1. Overview of Classification and Decision Tree 2. Algorithm to build Decision Tree 3. Formula to measure information 4. Weka, data.
Decision Trees. 2 Outline  What is a decision tree ?  How to construct a decision tree ? What are the major steps in decision tree induction ? How to.
Feature Selection: Why?
Decision Tree Learning Debapriyo Majumdar Data Mining – Fall 2014 Indian Statistical Institute Kolkata August 25, 2014.
Privacy preserving data mining Li Xiong CS573 Data Privacy and Anonymity.
CS685 : Special Topics in Data Mining, UKY The UNIVERSITY of KENTUCKY Classification CS 685: Special Topics in Data Mining Fall 2010 Jinze Liu.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Classification COMP Seminar BCB 713 Module Spring 2011.
Classification and Prediction Compiled By: Umair Yaqub Lecturer Govt. Murray College Sialkot Readings: Chapter 6 – Han and Kamber.
CS690L Data Mining: Classification
Chapter 20 Data Analysis and Mining. 2 n Decision Support Systems  Obtain high-level information out of detailed information stored in (DB) transaction-processing.
Chapter 6 Classification and Prediction Dr. Bernard Chen Ph.D. University of Central Arkansas.
Machine Learning Decision Trees. E. Keogh, UC Riverside Decision Tree Classifier Ross Quinlan Antenna Length Abdomen Length.
Classification and Prediction
DECISION TREE Ge Song. Introduction ■ Decision Tree: is a supervised learning algorithm used for classification or regression. ■ Decision Tree Graph:
An Introduction Student Name: Riaz Ahmad Program: MSIT( ) Subject: Data warehouse & Data Mining.
Lecture Notes for Chapter 4 Introduction to Data Mining
1 Classification: predicts categorical class labels (discrete or nominal) classifies data (constructs a model) based on the training set and the values.
Data Mining By Farzana Forhad CS 157B. Agenda Decision Tree and ID3 Rough Set Theory Clustering.
Data Mining Classification: Basic Concepts, Decision Trees, and Model Evaluation Lecture Notes for Chapter 4 Introduction to Data Mining By Tan, Steinbach,
Decision Trees.
DECISION TREES Asher Moody, CS 157B. Overview  Definition  Motivation  Algorithms  ID3  Example  Entropy  Information Gain  Applications  Conclusion.
SEEM Tutorial 1 Classification: Decision tree Siyuan Zhang,
Decision Tree. Classification Databases are rich with hidden information that can be used for making intelligent decisions. Classification is a form of.
Basic Data Mining Techniques Chapter 3-A. 3.1 Decision Trees.
DATA MINING TECHNIQUES (DECISION TREES ) Presented by: Shweta Ghate MIT College OF Engineering.
CSE343/543 Machine Learning: Lecture 4.  Chapter 3: Decision Trees  Weekly assignment:  There are lot of applications and systems using machine learning.
By N.Gopinath AP/CSE.  A decision tree is a flowchart-like tree structure, where each internal node (nonleaf node) denotes a test on an attribute, each.
Chapter 6 Decision Tree.
DECISION TREES An internal node represents a test on an attribute.
Decision Trees.
Chapter 6 Classification and Prediction
Data Science Algorithms: The Basic Methods
Supervised Learning Seminar Social Media Mining University UC3M
Data Mining Lecture 11.
Classification and Prediction
Chapter 8 Tutorial.
CS 685: Special Topics in Data Mining Jinze Liu
Data Mining – Chapter 3 Classification
CS 685: Special Topics in Data Mining Jinze Liu
©Jiawei Han and Micheline Kamber
CS 685: Special Topics in Data Mining Spring 2009 Jinze Liu
CS 685: Special Topics in Data Mining Jinze Liu
Presentation transcript:

Data Mining Lecture 9

Course Syllabus Classification Techniques (Week 7- Week 8- Week 9) Inductive Learning Decision Tree Learning Association Rules Regression Probabilistic Reasoning Bayesian Learning Case Study 4: Working and experiencing on the properties of the classification infrastructure of Propensity Score Card System for The Retail Banking (Assignment 4) Week 9

Decision Tree Induction: Training Dataset This follows an example of Quinlan’s ID3 (Playing Tennis) 3 3

Output: A Decision Tree for “buys_computer” age? overcast student? credit rating? <=30 >40 no yes 31..40 fair excellent 4 4

Algorithm for Decision Tree Induction Basic algorithm (a greedy algorithm) Tree is constructed in a top-down recursive divide-and-conquer manner At start, all the training examples are at the root Attributes are categorical (if continuous-valued, they are discretized in advance) Examples are partitioned recursively based on selected attributes Test attributes are selected on the basis of a heuristic or statistical measure (e.g., information gain) Conditions for stopping partitioning All samples for a given node belong to the same class There are no remaining attributes for further partitioning – majority voting is employed for classifying the leaf There are no samples left 5 5

Entropy Given a set of samples S, if S is partitioned into two intervals S1 and S2 using boundary T, the information gain after partitioning is Entropy is calculated based on class distribution of the samples in the set. Given m classes, the entropy of S1 is where pi is the probability of class i in S1

ID3 and Entropy

Attribute Selection Measure: Information Gain (ID3/C4.5) Select the attribute with the highest information gain Let pi be the probability that an arbitrary tuple in D belongs to class Ci, estimated by |Ci, D|/|D| Expected information (entropy) needed to classify a tuple in D: Information needed (after using A to split D into v partitions) to classify D: Information gained by branching on attribute A I : the expected information needed to classify a given sample E (entropy) : expected information based on the partitioning into subsets by A April 8, 2017 Data Mining: Concepts and Techniques 8 8

Attribute Selection: Information Gain Class P: buys_computer = “yes” Class N: buys_computer = “no” means “age <=30” has 5 out of 14 samples, with 2 yes’es and 3 no’s. Hence Similarly, April 8, 2017 9 9

ID3- Hypothesis Space Analysis a complete space of finite discrete-valued functions, relative to the available attributes maintains only a single current hypothesis as it searches through the space of decision trees. This contrasts, for example, with the earlier version space Candidate Elimination, which maintains the set of all hypotheses consistent with the available training examples no backtracking in its search; converging to locally optimal solutions that are not globally optimal at each step in the search to make statistically based decisions regarding how to refine its current hypothesis. This contrasts with Inductive Learning’s incremental approach Approximate inductive bias of ID3: Shorter trees are preferred over larger trees

ID3- Hypothesis Space Analysis A closer approximation to the inductive bias of ID3: Shorter trees are preferred over longer trees. Trees that place high information gain attributes close to the root are preferred over those that do not.

Why short hypothesis preferred ?- Occam’s Razor William of Occam's Razor (1320): Prefer the simplest hypothesis that fits the data because there are fewer short hypotheses than long ones (based on straightforward combinatorial arguments), it is less likely that one will find a short hypothesis that coincidentally fits the training data. In contrast there are often many very complex hypotheses that fit the current training data but fail to generalize correctly to subsequent data still this debate goes on April 8, 2017 Data Mining: Concepts and Techniques 12 12

Issues in Decision Tree Learning- Overfitting a hypothesis overfits the training examples if some other hypothesis that fits the training examples less well actually performs better over the entire distribution of instances April 8, 2017 Data Mining: Concepts and Techniques 13 13

Issues in Decision Tree Learning- Overfitting Reasons of Overfitting when the training examples contain random errors or noise and learning algorithm tries to explain this randomness overfitting is possible even when the training data are noise-free, especially when small numbers of examples are associated with leaf nodes; coincidental regularities to occur, in which some attribute happens to partition the examples very well, despite being unrelated to the actual target function April 8, 2017 Data Mining: Concepts and Techniques 14 14

Data Mining: Concepts and Techniques Avoiding Overfitting approaches that stop growing the tree earlier, before it reaches the point where it perfectly classifies the training data (it is difficult estimating precisely when to stop growing the tree approaches that allow the tree to overfit the data, and then post-prune the tree (cut the tree to make it smaller; much more practical) April 8, 2017 Data Mining: Concepts and Techniques 15 15

Data Mining: Concepts and Techniques Avoiding Overfitting Use a separate set of examples, distinct from the training examples, to evaluate the utility of post-pruning nodes from the tree. Use all the available data for training, but apply a statistical test to estimate whether expanding (or pruning) a particular node is likely to produce an improvement beyond the training set. For example, Quinlan (1986) uses a chi-square test to estimate whether further expanding a node is likely to improve performance over the entire instance distribution, or only on the current sample of training data. Use an explicit measure of the complexity for encoding the training examples and the decision tree, halting growth of the tree when this encoding size is minimized. This approach, based on a heuristic called the Minimum Description Length principle April 8, 2017 Data Mining: Concepts and Techniques 16 16

Data Mining: Concepts and Techniques Avoiding Overfitting April 8, 2017 Data Mining: Concepts and Techniques 17 17

Continuous Valued Attributes Avoiding Overfitting The major drawback of this approach is that when data is limited, withholding part of it for the validation set reduces even further the number of examples available for training Continuous Valued Attributes ID3 algorithm work on discrete valued attributes; thats why some arrangements must be done to add the ability of working with continuous valued attributes Simple strategy sort our continues valued attribute and determine classifier’s changing point (for exampl(48-60), (80-90) points for the below given case Take the mid point of changing points as candidates of discretization ((48+60)/2), ((80+90)/2) April 8, 2017 Data Mining: Concepts and Techniques 18 18

Computing Information-Gain for Continuous-Value Attributes Let attribute A be a continuous-valued attribute Must determine the best split point for A Sort the value A in increasing order Typically, the midpoint between each pair of adjacent values is considered as a possible split point (ai+ai+1)/2 is the midpoint between the values of ai and ai+1 The point with the minimum expected information requirement for A is selected as the split-point for A Split: D1 is the set of tuples in D satisfying A ≤ split-point, and D2 is the set of tuples in D satisfying A > split-point April 8, 2017 Data Mining: Concepts and Techniques 19 19

Gain Ratio for Attribute Selection (C4.5) Information gain measure is biased towards attributes with a large number of values C4.5 (a successor of ID3) uses gain ratio to overcome the problem (normalization to information gain) GainRatio(A) = Gain(A)/SplitInfo(A) Ex. gain_ratio(income) = 0.029/0.926 = 0.031 The attribute with the maximum gain ratio is selected as the splitting attribute April 8, 2017 Data Mining: Concepts and Techniques 20 20

Issues in Decision Tree Learning Handle missing attribute values Assign the most common value of the attribute Assign probability to each of the possible values Attribute construction Create new attributes based on existing ones that are sparsely represented This reduces fragmentation, repetition, and replication

Other Attribute Selection Measures CHAID: a popular decision tree algorithm, measure based on χ2 test for independence C-SEP: performs better than info. gain and gini index in certain cases G-statistics: has a close approximation to χ2 distribution MDL (Minimal Description Length) principle (i.e., the simplest solution is preferred): The best tree as the one that requires the fewest # of bits to both (1) encode the tree, and (2) encode the exceptions to the tree Multivariate splits (partition based on multiple variable combinations) CART: finds multivariate splits based on a linear comb. of attrs. Which attribute selection measure is the best? Most give good results, none is significantly superior than others April 8, 2017 Data Mining: Concepts and Techniques 22 22

Gini index (CART, IBM IntelligentMiner) If a data set D contains examples from n classes, gini index, gini(D) is defined as where pj is the relative frequency of class j in D If a data set D is split on A into two subsets D1 and D2, the gini index gini(D) is defined as Reduction in Impurity: The attribute provides the smallest ginisplit(D) (or the largest reduction in impurity) is chosen to split the node (need to enumerate all the possible splitting points for each attribute) 23 23

Gini index (CART, IBM IntelligentMiner) Ex. D has 9 tuples in buys_computer = “yes” and 5 in “no” Suppose the attribute income partitions D into 10 in D1: {low, medium} and 4 in D2 but gini{medium,high} is 0.30 and thus the best since it is the lowest All attributes are assumed continuous-valued May need other tools, e.g., clustering, to get the possible split values Can be modified for categorical attributes April 8, 2017 Data Mining: Concepts and Techniques 24 24

Comparing Attribute Selection Measures The three measures, in general, return good results but Information gain: biased towards multivalued attributes Gain ratio: tends to prefer unbalanced splits in which one partition is much smaller than the others Gini index: biased to multivalued attributes has difficulty when # of classes is large tends to favor tests that result in equal-sized partitions and purity in both partitions April 8, 2017 Data Mining: Concepts and Techniques 25 25

Bayesian Learning Bayes theorem is the cornerstone of Bayesian learning methods because it provides a way to calculate the posterior probability P(hlD), from the prior probability P(h), together with P(D) and P(D/h)

Bayesian Learning finding the most probable hypothesis h E H given the observed data D (or at least one of the maximally probable if there are several). Any such maximally probable hypothesis is called a maximum a posteriori (MAP) hypothesis. We can determine the MAP hypotheses by using Bayes theorem to calculate the posterior probability of each candidate hypothesis. More precisely, we will say that MAP is a MAP hypothesis provided (in the last line we dropped the term P(D) because it is a constant independent of h)

Bayesian Learning

Probability Rules

End of Lecture read Chapter 6 of Course Text Book read Chapter 6 – Supplemantary Text Book “Machine Learning” – Tom Mitchell