Classification - Issues Regarding Classification and Prediction
Classification - Issues Regarding Classification and Prediction
Classification - Issues Regarding Classification and Prediction
Data Mining
Module-4:Classification
Dr Sunil Kumar P V
SCOPE
Classification: Overview
Introduction
• Bank loan
• Buys computer
• Best treatment
• The data analysis task is classification
• A model or classifier is constructed to predict
categorical labels, such as
• “safe” or “risky” for the loan application data
• “yes” or “no” for the marketing data
• “treatment A,” “treatment B,” or “treatment
C” for the medical data
2/39
Classification Vs Prediction
3/39
Classification Step1
4/39
Classification Step2
5/39
Classification: Step1-Learning
7/39
Points to note
8/39
Issues Regarding Classification
and Prediction
Data Preparation
• Accuracy
• Speed
• Robustness (performance given noisy data or
data with missing values)
• Scalability
• Iterpretability (level of understanding and insight
that is being provided by the classifier/predictor)
10/39
Decision Tree Induction
Decision Tree Algorithm Basics
• Three algorithms
• All were proposed in 1980s
• ID3 (Iterative Dichotomiser)
• C4.5 (a successor of ID3)
• Classification and Regression Trees (CART)
• Has three parameters: D, attribute_list, and
Attribute_selection_method
• Refer to Figure 6.3, Page 293, Han and Kamber
2nd Ed Textbook
11/39
Decision Tree Algorithms
13/39
Entropy Examples
14/39
Information Gain
15/39
Decision Tree Demo
16/39
Entropy of Outlook
17/39
Entropy of Outlook
18/39
Information Gain of Outlook
19/39
Information Gain of Temperature
• Gain(X , Temperature) =
P |X (v )|
H(X ) − v ∈{Hot,Mild,Cool} |X | Entropy (X (v ))
• H(X ) − 4/14H(Hot) − 6/14H(Mild) −
4/14H(Cool)
• = 0.94−(4/14) × 1 − (6/14) × 0.9183 −
(4/14) × 0.8113 = 0.0289
21/39
Entropy of Humidity
• Gain(X , Humidity ) =
P |X (v )|
H(X ) − v ∈{High,Normal} |X | Entropy (X (v ))
• H(X ) − 7/14H(High) − 7/14H(Normal)
• = 0.94−(7/14) × 0.9852 − (7/14) × 0.5916 =
0.1516
23/39
Entropy of Wind
• Gain(X , Wind) =
P |X (v )|
H(X ) − v ∈{Strong ,Weak} |X | Entropy (X (v ))
• H(X ) − 6/14H(Strong ) − 8/14H(Weak)
• = 0.94−(6/14) × 1 − (8/14) × 0.8113 = 0.0478
25/39
Attribute with the Maximum Information Gain
26/39
The tree so far
27/39
Dataset corresponding to Outlook = Sunny
28/39
X (Outlook = Sunny , Temperature)
30/39
X (Outlook = Sunny , Wind)
31/39
Attribute with the Maximum Information Gain
32/39
The tree so far
33/39
Dataset corresponding to Outlook = Rain
34/39
X (Outlook = Rain, Temperature)
36/39
X (Outlook = Rain, Wind)
37/39
Attribute with the Maximum Information Gain
38/39
The Final Decision Tree
39/39