liveBook · Manning

True positive

As explained in Statistics Every Programmer Needs

A true positive is a positive-class observation correctly predicted as positive, or the corresponding count in a classification summary.

A true positive is a positive-class observation correctly predicted as positive. In a binary classification confusion matrix, it is the count where the true label and predicted label are both 1. section 5.2.4 section 6.3.4

Use true positives to:

  • Count correct positive predictions by filtering records whose actual and predicted labels both equal 1. section 5.2.4
  • Compute sensitivity or recall as tp divided by tp plus fn. section 5.2.4
  • Interpret class-specific performance alongside true negatives, false positives, and false negatives rather than relying only on overall accuracy. section 6.3.4

Raisin classification

Among Besni raisins labeled 1, the logistic regression correctly predicted 384 as Besni, producing 384 true positives. The same confusion matrix also records 397 true negatives, 53 false positives, and 66 false negatives. section 5.2.4

Table 5.1 Confusion matrix for raisin classification. A confusion matrix stores classification metrics from a regression with actual and predicted binary outcomes.
Predicted
Kecimen (0)
Besni (1)
Actual
Kecimen (0)
tn
fp
Besni (1)
fn
tp

The confusion matrix locates true positives at the intersection of actual positive and predicted positive outcomes. section 5.2.4

How Statistics Every Programmer Needs covers it

How deep it goes
Defines the count, locates it in a confusion matrix, computes related rates, and demonstrates Python extraction without deriving classifier internals.
Examples
Demonstrates raisin classification with 384 true positives, plus decision-tree and random-forest confusion matrices containing 91 and 95 true positives.
What it assumes
Assumes binary class labels and predicted labels, while introducing confusion-matrix terminology and positive-versus-negative outcome counts.
What you can do after
Diagnose model performance by extracting true-positive counts and using them to calculate sensitivity or recall.
How it connects
Connects true positives to confusion matrices, false positives, false negatives, true negatives, sensitivity, recall, accuracy, and ROC analysis.

Also explained in

Compare how 2 books explain true positive →

Related concepts

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