8c - Model Evaluation and Selection
8c - Model Evaluation and Selection
Chapter 8c
Classification – Model Evaluation and
Selection
2
USING IF-THEN RULES
Represent the knowledge in the form of IF-THEN rules
R: IF age = youth AND student = yes THEN buys_computer = yes
Rule antecedent/precondition vs. rule consequent
3
USING IF-THEN RULES
If more than one rule are triggered, need conflict resolution
Size ordering: assign the highest priority to the triggering rules that has
the “toughest” requirement (i.e., with the most attribute tests)
Rule-based ordering (decision list): rules are organized into one long
priority list, according to some measure of rule quality or by experts
4
RULE EXTRACTION FROM A
DECISION TREE
Rules are easier to understand than large
trees age?
One rule is created for each path from the <=30 31..40 >40
root to a leaf
student? credit rating?
yes
Each attribute-value pair along a path forms a
excellent fair
conjunction: the leaf holds the class no yes
no yes
prediction no yes
6
MODEL EVALUATION AND SELECTION
7
CLASSIFIER EVALUATION METRICS:
CONFUSION MATRIX
Confusion Matrix:
True Negatives:
Negative tuples correctly classified as negative.
False Positives:
Negative tuples incorrectly classified as positives.
False Negatives:
Positive tuples incorrectly classified as negatives
9
CLASSIFIER EVALUATION METRICS:
CONFUSION MATRIX
Confusion Matrix:
Actual class\Predicted class C1 ¬ C1
C1 True Positives (TP) False Negatives (FN)
¬ C1 False Positives (FP) True Negatives (TN)
10
ACCURACY, ERROR RATE,
SENSITIVITY AND SPECIFICITY
A\P C ¬C
C TP FN P
¬C FP TN N
P’ N’ All
11
ACCURACY, ERROR RATE,
SENSITIVITY AND SPECIFICITY
Class Imbalance Problem:
One class may be rare, e.g. fraud, or HIV-positive
12
PRECISION AND RECALL, AND F-
MEASURES
Precision: exactness – what % of tuples that the classifier
labeled as positive are actually positive
13
CLASSIFIER EVALUATION METRICS:
PRECISION AND RECALL, AND F-
MEASURES
Inverse relationship between precision & recall
F measure (F or F-score): harmonic mean of precision and
1
recall,
14
CLASSIFIER EVALUATION METRICS: EXAMPLE
Actual Class\Predicted class cancer = yes cancer = no Total Recognition(%)
15