Class prevalence
Class prevalence is the proportion of observations belonging to a specified class in a defined population or evaluation sample.
For a nonempty binary sample, positive prevalence = (TP + FN) / (TP + FP + FN + TN). Predicting every observation positive gives precision equal to that prevalence, which is where a precision-recall curve starts at recall 1. [1] A random classifier has the same precision, so the precision-recall baseline is P / (P + N) and moves with the class ratio. [2] [5]
Under a fixed decision rule and unchanged class-conditional feature distributions, changing only prevalence preserves population true and false positive rates while precision can change. Finite-sample estimates can still vary. This condition is satisfied by label shift; an arbitrary fleet change need not satisfy it. [6] With 80% recall and 10% FPR, precision is about 89% at a 1:1 ratio but about 44% at 1 positive per 10 negatives.
Sampling more failures changes the evaluation prevalence and may change precision, and a balanced test sample does not directly establish deployment alert quality. [2] For storage, specify whether an observation is a drive or a drive-day window, and whether positive means failure within a stated horizon. This proportion is not an annualized failure rate.
Relations
- related
- Precision, Recall, False positive rate, Average precision, Drive-day, Annualized failure rate (AFR), F1 score, Temporal validation, Probability calibration, Direct standardization, Label shift
Advantages
- A target prevalence and transferable class-conditional operating rates determine expected precision without retraining. [4, 6]
Limitations
- Prevalence measured on one window or fleet need not hold later, because class distributions can shift over time and between sites. [4]
- Areas under precision-recall curves from samples with different prevalence are not directly comparable. [2]
Citations
- scikit-learn: precision_recall_curve; the all-positive endpoint.
- Saito and Rehmsmeier. The Precision-Recall Plot Is More Informative than the ROC Plot When Evaluating Binary Classifiers on Imbalanced Datasets. PLOS ONE, 2015.
- Fawcett. An introduction to ROC analysis. Pattern Recognition Letters 27 (2006) 861-874, section 4.2. DOI: 10.1016/j.patrec.2005.10.010.
- Flach and Kull. Precision-Recall-Gain Curves: PR Analysis Done Right. NeurIPS 2015, section 2.
- Lipton, Wang and Smola. Detecting and Correcting for Label Shift with Black Box Predictors. ICML 2018, assumptions A.1-A.3 and Lemma 1.
Further reading
Sources & caveats
- sklearn-pr-curve re-read 2026-10-23 for the first precision value equal to class balance at recall 1.
- saito2015 re-read 2026-10-23 for the P / (P + N) baseline and its effect on the area under the precision-recall curve.
- fawcett2006 read 2026-10-23, section 4.2, for column-ratio invariance, the 1:10 skew example and the reported range of class skews.
- prg2015 read 2026-10-23, section 2, for the random-classifier precision baseline.
- The 89% and 44% values are arithmetic from the stated rates, not reported results.
- The direct-standardization entry links here because it adjusts rates for population composition, and prevalence is the composition term that changes precision between an evaluation sample and a target population.
- A companion analysis on disk failure prediction is listed but not used in prose.
- 2026-11-23: qualified rate transfer using Lipton et al. assumption A.1 and Lemma 1; preserved the earlier 89%/44% arithmetic and all stable IDs.