A model turns inputs into predictions: by a decision tree, by nearest neighbours, or by learning. Evaluation counts its right and wrong predictions.
| Squared distance | (x1 − x2)2 + (y1 − y2)2: (2, 7) to (5, 3) is 9 + 16 = 25 |
| True positive (TP) | actually positive, predicted positive |
| False positive (FP) | actually negative, predicted positive |
| True negative (TN); false negative (FN) | actually negative, predicted negative; actually positive, predicted negative |
| Accuracy | (TP + TN) ÷ total × 100% |
| Wrong predictions | FP + FN |
A model predicts whether an email is spam (positive = spam). Its results:
1. actual spam, predicted spam
2. actual not spam, predicted spam
3. actual spam, predicted spam
4. actual spam, predicted spam
5. actual not spam, predicted not spam
6. actual not spam, predicted not spam
7. actual spam, predicted not spam
8. actual spam, predicted not spam
9. actual spam, predicted spam
10. actual not spam, predicted not spam
11. actual not spam, predicted spam
12. actual spam, predicted spam
Count the (a) true positives (b) false positives (c) true negatives (d) false negatives.
Working: right and positive = TP; wrong and predicted positive = FP; right and negative = TN; wrong and predicted negative = FN
Answer: (a) 5; (b) 2; (c) 3; (d) 2