Specificity measures how well a classifier identifies actual negative examples. Divide the true negatives by the total actual negatives: true negatives / (true negatives + false positives). It is also called the true negative rate. Specificity is not the same as precision. section 7.3
Specificity is considered alongside sensitivity when evaluating a model with a receiver operating characteristic (ROC) curve. Raising the classification threshold increases specificity while decreasing sensitivity. section 7.3
Thresholds change the trade-off
A health test can classify people as healthy or sick, and a spam detector can classify emails as ham or spam. In a simple example with five actual negatives, correctly identifying four gives a specificity of 4/5, or 0.8. Raising the threshold can increase specificity while reducing sensitivity. section 7.3
Figure 7.3 The effects of moving the threshold on the sensitivity and the specificity. On the left, we have a model with a low threshold; in the middle, we have one with a medium threshold; and on the right, we have one with a high threshold. For each of the models, there are five positive and five negative points. Each model is represented by the vertical line. The model predicts that the points to the right of the line are positive and those to the left are negative. For each of the models, we’ve counted the number of true positives and true negatives, that is, the number of positive and negative points that have been correctly predicted. We have used those to calculate the sensitivity and the specificity. Note that as we increase the threshold (i.e., as we move the vertical line from left to right), the sensitivity goes down and the specificity goes up.
Compare low, medium, and high thresholds to see how specificity and sensitivity change. section 7.3





