Regression and Classification Metrics
Metrics must match the task.
For regression, common metrics include mean absolute error and mean squared error. Mean absolute error measures average absolute difference. Mean squared error penalizes larger errors more strongly.
For classification, accuracy is common but incomplete. Precision and recall matter when false positives and false negatives have different costs.
Small examples keep the meaning visible:
errors: -2, 1, 3
absolute errors: 2, 1, 3
mean absolute error = (2 + 1 + 3) / 3 = 2
No metric is automatically best. A metric is a statement about what kind of mistake matters.
Exercise: Mean absolute error
Errors are -1, 2, and -3. What is the mean absolute error?
Compute it first, then check your number.
Exercise: Accuracy
A classifier gets 18 examples correct out of 20. What is accuracy as a decimal?
Compute it first, then check your number.