39 Types of Errors
39.1 Basic Terms
False positives, False negatives, True positives and True negatives. See Sensitivity and Specificity.
Sensitivity = \(Pr(Positive ~Test~|~Disease)\)
- When you’re sick, what’s the probability that we predict that? \[\frac{TP}{TP+FN}\]
Specificity = \(Pr(Negative ~Test~|~ No Disease)\)
- If you’re actually healthy, what’s the probability that we predict that? \[\frac{TP}{FP+TN}\]
Positive Predictive Value = \(Pr(~Disease~|~Positive ~test~)\)
- What’s the fraction of people who we call sick, who are actually sick? \[\frac{TP}{TP+FP}\]
Negative Predictive Value = \(Pr(~Disease~|~Negative ~test~)\)
- What’s the fraction of people who we call healthy who are actually healthy? \[\frac{TN}{TN+FN}\]
Accuracy = \(Pr(~Correct ~Outcome)\) \[\frac{TP+TN}{TP+FP+FN+TN}\]
Using a confusion matrix to diagnose your model, Accross the top is what you actually are and along the side is what your model has predicted you are. Using the breast cancer dataset for example, the top left corner gives you your true positives and the top right corner gives you your false positives.
39.2 Screening Tests
Assume that n = 10,000 and that some disease has a 0.1% prevalence in the population. Assume we have a test kit for that disease that works 99% sensitivity and 99% specificity. What is the probability of a person having the disease given the test result is positive, if we randomly select a subject from:
- The general population?
- The high risk sub-population with 10% disease prevalence?
39.3 Common Error Measures For Continuous Data
Mean Squared Error (MSE) \[\frac{1}{n} \sum_{i=1}^n (Prediction_i ~ Truth_i)^2\]
Root Mean Squared Error (RMSE) \[\sqrt{\frac{1}{n} \sum_{i=1}^n (Prediction_i ~ Truth_i)^2}\]
Mean squared error - Continuous data, sensitive to outliers
Median absolute deviation - Continuous data, often more robust
Sensitivity (recall) - If you want few missed positives
Specificity - If you want few negatives called positives
Accuracy - Weighs false positives / negatives equally
Concordance - One example is Kappa (Multiclass data)