Professional Documents
Culture Documents
Sample
Test Set
Training Set validation data
Sample
Test Set
Evaluating Classifiers: Plain Accuracy
=1error rate
Too simplistic..
What do Businesses Care About?
Return on Investment, Expected Profit, False alarm cases for the next
1000 cases
Confusion Matrix
0 1
Total Actual
(predicted value is (predicted value is
(down)
negative) positive)
0 fp Total actual
tn
(actual value is (false positive, negatives
(true negative)
negative) false alarm) tn + fp
Actual Class
1 fn Total actual
tp
(actual value is (false negative, positives
(true positive)
positive) false dismissal) tp + fn
Total
Total negative Total positive
Total Predicted Examples
predictions predictions
(across) tp + tn +
tn + fn tp + fp
fp + fn
Actual Predicted
Probability Confusion Matrix
Target Target
Target = 1 Quadrant
Value Value
0 0.641 1 false alarm
1 0.601 1 true positive
We first must populate all
0 0.587 1 false alarm
four quadrants of the
1 0.585 1 true positive confusion matrix.
1 0.575 1 true positive
0 0.562 1 false alarm
0 0.531 1 false alarm AT left, the probability
1 0.504 1 true positive threshold is 0.5
0 0.489 0 true negative
1 0.488 0 false dismissal
0 0.483 0 true negative
0 0.471 0 true negative
0 0.457 0 true negative
1 0.418 0 false dismissal
0 0.394 0 true negative
0 0.384 0 true negative
0 0.372 0 true negative
0 0.371 0 true negative
0 0.341 0 true negative
1 0.317 0 false dismissal
Unbalanced datasets
Online marketing:
Targeting Cost: $1
$99 1 $1 > 0
> 0.01
Using Expected Value to Frame Classifier Evaluation
A cost-benefit matrix
A cost-benefit matrix for the marketing example
Using Expected Value to Frame Classifier Evaluation
Expected profit
= , , + , ,
+ , , + , ,
Expected profit
= , + ,
+ (|) () (, ) + (|) () (, )
Expected profit
= , + ,
+ [ , + , ]
Using Expected Value to Frame Classifier Evaluation
= 110
= 61 = 49
() = 0.55 () = 0.45
(|) = 56/61 = 0.92 (|) = 7/49 = 0.14
(|) = 5/61 = 0.08 (|) = 42/49 = 0.86
Expected profit = , + ,
+ , + ,
Sorted Predictions
Confusion Matrix
0 1
Total Actual
(predicted value is (predicted value is
(down)
negative) positive)
0 fp Total actual
tn
(actual value is (false positive, negatives
(true negative)
negative) false alarm) tn + fp
Actual Class
1 fn Total actual
tp
(actual value is (false negative, positives
(true positive)
positive) false dismissal) tp + fn
Total
Total negative Total positive
Total Predicted Examples
predictions predictions
(across) tp + tn +
tn + fn tp + fp
fp + fn
Actual Predicted
Probability Confusion Matrix
Target Target
Target = 1 Quadrant
Value Value
0 0.641 1 false alarm
1 0.601 1 true positive
We first must populate all
0 0.587 1 false alarm
four quadrants of the
1 0.585 1 true positive confusion matrix.
1 0.575 1 true positive
0 0.562 1 false alarm
0 0.531 1 false alarm AT left, the probability
1 0.504 1 true positive threshold is 0.5
0 0.489 0 true negative
1 0.488 0 false dismissal
0 0.483 0 true negative
0 0.471 0 true negative
0 0.457 0 true negative
1 0.418 0 false dismissal
0 0.394 0 true negative
0 0.384 0 true negative
0 0.372 0 true negative
0 0.371 0 true negative
0 0.341 0 true negative
1 0.317 0 false dismissal