Professional Documents
Culture Documents
Precision, Recall and ROC Curves
Precision, Recall and ROC Curves
curves
CIS4526 Complementary materials
Model Evaluation
• Metrics for Performance Evaluation
• How to evaluate the performance of a model?
PREDICTED CLASS
Class=Yes Class=No
a: TP (true positive)
ACTUAL Class=Yes a b
b: FN (false negative)
CLASS
Class=No c d c: FP (false positive)
d: TN (true negative)
Metrics for Performance Evaluation…
PREDICTED CLASS
Class=Yes Class=No
ACTUAL Class=Yes a b
(TP) (FN)
CLASS
Class=No c d
(FP) (TN)
TP
TPR
TP FN PREDICTED CLASS
Fraction of positive instances Yes No
predicted as positive
Yes a b
FP Actual (TP) (FN)
FPR
FP TN No c d
(FP) (TN)
Fraction of negative instances
predicted as positive
ROC (Receiver Operating Characteristic)
At threshold t:
TP=0.5, FN=0.5, FP=0.12, FN=0.88
ROC Curve
(TP,FP):
• (0,0): declare everything
to be negative class
• (1,1): declare everything
to be positive class
• (1,0): ideal
PREDICTED CLASS
• Diagonal line:
• Random guessing Yes No
• Below diagonal line: Yes a b
• prediction is opposite of Actual (TP) (FN)
the true class No c d
(FP) (TN)
Using ROC for Model Comparison
No model consistently
outperform the other
M is better for
1
small FPR
M is better for large
2
FPR
Area Under the ROC
curve (AUC)
Ideal: Area = 1
Random guess:
Area = 0.5
ROC curve vs Precision-Recall curve