liveBook · Manning

Error rate

As explained in Statistics Slam Dunk

Misclassification error, or error rate, is the proportion of instances that a classification model predicts incorrectly.

Error rate, also called misclassification error or classification error, measures the proportion of classification predictions that are wrong. It adds false positives and false negatives, then divides by the number of records: (FP + FN) / n. Model accuracy is its complement: 1 − error rate. section 14.6.2

Calculate and interpret the metric from binary predictions:

  • Create a confusion matrix by comparing actual outcomes with predicted classes. section 14.6.2
  • Count false positives and false negatives, add them, and divide by the test-set record count. section 14.6.2
  • Compare the result with model accuracy, while considering whether false positives or false negatives matter more in context. section 14.6.2

NBA postseason prediction

For a logistic regression predicting NBA playoff qualification, the confusion matrix contains 11 false positives and 10 false negatives among 80 test records. In R, `misclassification_error <- (11 + 10) / 80` returns 0.2625, or a 26.25% error rate. The corresponding accuracy is `1 - misclassification_error`, which returns 0.7375, or 73.75%. section 14.6.2

confusion_matrix <- table(actuals$actual_values,     predictions$predicted_values2)
print(confusion_matrix)
##    0  1
## 0 19 11
## 1 10 40

Inspect the confusion matrix behind the NBA example, including the 11 false positives and 10 false negatives used in the error-rate calculation. section 14.6.2

How Statistics Slam Dunk covers it

How deep it goes
Defines the formula, calculates it from a confusion matrix, and contrasts it with accuracy, sensitivity, and specificity.
Examples
Uses an NBA playoff classifier with 11 false positives, 10 false negatives, 80 records, and a 0.2625 error rate.
What it assumes
Assumes binary actual and predicted outcomes and teaches false-positive and false-negative counting through a confusion matrix.
What you can do after
Apply via R by deriving error rate and accuracy from actual and predicted binary outcomes.
How it connects
Connects error rate to classification models, confusion matrices, false positives, false negatives, accuracy, sensitivity, specificity, and ROC curves.

Also explained in

Compare how 6 books explain error rate →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.