What Is Sensitivity In Machine Learning?

Sensitivity

Sensitivity is the share of actual positive cases that a model correctly identifies. If 200 transactions in a dataset are fraudulent and the model flags 150 of them, sensitivity is 0.75. The other 50 are false negatives: real positives the model let through.

sensitivity = TP / (TP + FN)

TP is true positives, cases that are positive and were predicted positive. FN is false negatives, cases that are positive and were predicted negative. The denominator is every actual positive in the data, which is why sensitivity is sometimes described as a recall-style metric: it is scored against the ground truth column, not against what the model predicted.

Sensitivity, recall, true positive rate, and hit rate are four names for this exact calculation. Which one you hear depends entirely on who is talking.

Try Arize AX

Build better agents with Arize

Trace, evaluate, and learn. Build agents that work with Arize AX and start tracing your runs today.

Prefer open source? Try Arize Phoenix for self-hosted, open source agent observability.

Key takeaways

  • Sensitivity is TP / (TP + FN), the fraction of real positives the model catches. Its complement, FN / (TP + FN), is the miss rate.
  • Sensitivity and recall are the same number. Medicine and diagnostics say sensitivity and specificity; information retrieval and machine learning say recall and precision; signal detection says true positive rate.
  • Sensitivity ignores false positives completely. A model that predicts positive for every input scores a perfect 1.0, which is why it is never reported alone.
  • Sensitivity moves with the decision threshold. Lowering the threshold raises sensitivity and lowers specificity, so the target should come from the cost of a miss versus the cost of a false alarm.
  • High sensitivity does not mean a positive prediction is trustworthy. At low prevalence, most flagged cases can still be wrong.

How sensitivity is calculated

Sensitivity comes out of one row of the confusion matrix, the actual-positive row.

Predicted positive Predicted negative
Actually positive True positive (TP) False negative (FN)
Actually negative False positive (FP) True negative (TN)

Sensitivity divides the first cell by the sum of that row. Specificity does the same thing for the second row: TN / (TN + FP), the share of actual negatives correctly cleared. Precision reads down the first column instead: TP / (TP + FP), the share of positive predictions that were right.

Worked example. A fraud model scores 10,000 transactions, of which 200 are truly fraudulent. It flags 150 of the 200 and also flags 800 legitimate transactions.

  • Sensitivity is 150 / (150 + 50) = 0.75
  • Specificity is 9,000 / (9,000 + 800) = 0.918
  • Precision is 150 / (150 + 800) = 0.158

Three very different numbers describing one model. Report only the first and you would never learn that fewer than one in six flagged transactions is actually fraud.

Sensitivity, specificity, and the threshold

Almost every binary classification model outputs a score, not a label. The threshold you apply to that score converts it into a decision, and it is the threshold, not the model, that sets sensitivity.

Drop the threshold and the model flags more cases. Sensitivity goes up because fewer real positives slip through. Specificity goes down because more negatives get caught in the net. Raise the threshold and the trade runs the other way. Sweeping the threshold across its whole range and plotting sensitivity against the false positive rate is exactly what an ROC curve draws.

The important consequence: quoting a sensitivity without quoting the threshold is meaningless. Two teams can report wildly different sensitivity for the same model weights. The threshold belongs in the report, and the way to choose it is by pricing the two error types. Missing a fraudulent charge and blocking a legitimate one do not cost the same amount, so they should not be traded one for one. The mechanics of tuning this on real classification models are worked through in shipping NLP sentiment classification models with confidence and, for vision, in shipping your image classification model with confidence.

Why sensitivity alone will fool you

The single most useful fact about sensitivity is that a model which says yes to everything achieves a perfect score. Sensitivity has no term for false positives anywhere in its formula. It cannot penalize over-flagging, so it must always be read against specificity or precision.

The second is that sensitivity does not tell you how much to believe a positive prediction. Consider a hypothetical screening test with 99% sensitivity and 95% specificity applied to a population where 1% of people have the condition. Out of 10,000 people, 100 have it and the test catches 99. Of the 9,900 who do not, 5% test positive anyway, which is 495 people. So 594 people test positive and only 99 of them actually have the condition. That is a positive predictive value of about 17%, from a test with near-perfect sensitivity. Nothing is wrong with the test. Prevalence is doing the work, and no amount of sensitivity fixes it.

This is why sensitivity is reported in pairs, and why choosing an evaluation metric is a decision about which mistake you can afford.

Sensitivity in LLM and agent systems

Sensitivity did not stop mattering when systems started generating text. It moved.

Retrieval is the clearest case. A RAG pipeline’s retriever is a classifier over documents, and its sensitivity is the share of genuinely relevant chunks it pulls into context. A retriever that misses the one document containing the answer guarantees a wrong response no matter how good the model is, and the failure looks like a hallucination rather than a retrieval miss.

Measuring it takes the same apparatus as any other sensitivity number, which is the step most teams skip. You need a set of queries with the relevant chunks marked, and you need the retrieved chunk IDs recorded on the span so a miss is attributable rather than inferred. That is the instrumentation described in tracing and evaluating AI agents. And k does what the threshold did earlier on this page: recall at 5 and recall at 20 are different measurements, so a sensitivity figure without a stated k is the same omission in a new costume.

FAQ

Is sensitivity the same as recall?

Yes. Both are TP / (TP + FN). The names come from different traditions. Sensitivity and specificity are standard in medicine, epidemiology, and diagnostics, where you care about performance on the sick group and the healthy group separately. Recall and precision are standard in information retrieval and machine learning, where you care about coverage of relevant items and purity of returned items. Use whichever vocabulary your audience uses, and say once which one you mean.

What is the difference between sensitivity and specificity?

Sensitivity measures performance on actual positives: TP / (TP + FN). Specificity measures performance on actual negatives: TN / (TN + FP). They are computed on disjoint groups, so they do not trade off arithmetically, but they do trade off through the threshold. Together they describe a classifier without being affected by how common the positive class is.

What is the difference between sensitivity and precision?

Sensitivity asks what share of real positives you found. Precision asks what share of your positive predictions were correct. Sensitivity has false negatives in the denominator, precision has false positives. A model can have high sensitivity and terrible precision by flagging nearly everything.

Is high sensitivity always good?

Only relative to what it cost. Sensitivity can be pushed to 1.0 by lowering the threshold until the model flags every case, which is useless. High sensitivity is good when specificity or precision stayed acceptable at the same threshold, and when a miss is genuinely more expensive than a false alarm, as in disease screening or safety filtering.

Is sensitivity in machine learning the same as sensitivity analysis?

No, and the collision causes real confusion. Sensitivity as a metric is the true positive rate of a classifier. Sensitivity analysis is a modeling technique that measures how much an output changes when you perturb an input, used for understanding feature influence and model stability. Different concept, unrelated math.

Don’t ship vibes.

Arize gives AI teams observability and evals to understand and improve agent performance.