{
  "slug": "label-shift",
  "term": "Label shift",
  "aliases": [
    "prior probability shift",
    "target shift"
  ],
  "definition": "Label shift is a distribution change in which class proportions change while the distribution of features conditional on each class remains unchanged.",
  "note": "For source distribution P and target Q, label shift assumes P(X | Y) = Q(X | Y), while class probabilities may differ. This is a specific distribution-shift model, not a synonym for any change between fleets or time periods. [lipton-icml18]\n\nWith a fixed prediction rule and unchanged class-conditional feature distributions, population recall and false-positive rate remain unchanged. Precision depends on prevalence: TPR x pi / (TPR x pi + FPR x (1 - pi)), where pi is the positive-class proportion and the denominator must be positive. Finite-sample estimates can still vary. [lipton-icml18]\n\nIn a constructed 10,000-observation example, 80% recall and 10% FPR give precision 4000/4500 with 50% positives and 80/1070 with 1% positives. At the same 1% prevalence, changing the healthy-class alarm rate to 20% gives 80/2060 instead. The last population violates the fixed-rule label-shift model; prevalence alone cannot select the right result. [worked-example]\n\nFor storage, retain the observation unit, failure definition and prediction horizon. Changes in device mix, telemetry or within-class sampling can change the conditional distributions, so prior correction needs more than a new fleet failure count. [lipton-icml18]",
  "limitations": [
    {
      "text": "Estimating unseen target class proportions with BBSE additionally needs source support for target labels and an invertible expected confusion matrix.",
      "citationIds": [
        "lipton-icml18"
      ]
    },
    {
      "text": "Posterior reweighting requires justified probabilities; arbitrary classifier scores do not become calibrated by changing class priors.",
      "citationIds": [
        "podkopaev-uai21"
      ]
    }
  ],
  "related": [
    "class-prevalence",
    "temporal-validation",
    "covariate-shift"
  ],
  "citations": [
    {
      "id": "lipton-icml18",
      "title": "Lipton, Wang and Smola. Detecting and Correcting for Label Shift with Black Box Predictors. ICML 2018, assumptions A.1-A.3 and Lemma 1.",
      "url": "https://proceedings.mlr.press/v80/lipton18a/lipton18a.pdf",
      "accessed": "2026-11-23"
    },
    {
      "id": "podkopaev-uai21",
      "title": "Podkopaev and Ramdas. Distribution-free uncertainty quantification for classification under label shift. UAI 2021, section 3.2.",
      "url": "https://proceedings.mlr.press/v161/podkopaev21a/podkopaev21a.pdf",
      "accessed": "2026-11-23"
    },
    {
      "id": "worked-example",
      "title": "Hesela: exact synthetic class-mixture counts and a conditional-shift counterexample.",
      "url": "https://hesela.dev/research/label-shift/model.py",
      "accessed": "2026-11-23"
    },
    {
      "id": "worked-tests",
      "title": "Hesela: exact-count invariance, zero-denominator and invalid-input regression tests.",
      "url": "https://hesela.dev/research/label-shift/test_model.py",
      "accessed": "2026-11-23"
    },
    {
      "id": "cloud-reading",
      "title": "Hesela: cloud disk-error prediction and time-forward evaluation.",
      "url": "https://hesela.com/analyses/cloud-disk-error-prediction/",
      "accessed": "2026-11-23"
    }
  ],
  "status": "unknown",
  "advantages": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-23",
  "provenance": [
    "2026-11-23: reviewed Lipton et al., assumptions A.1-A.3 and Lemma 1; definition and fixed-rule rate invariance are distinct from BBSE estimation conditions.",
    "2026-11-23: reviewed Podkopaev and Ramdas, section 3.2, equation 16, for posterior and calibration scope.",
    "The 10,000-observation populations are exact constructed counts, not measured drives, estimated fleet rates or a reproduction of a published storage experiment.",
    "Device-mix and label-horizon cautions apply the conditional-distribution assumption to storage; no named fleet is asserted to satisfy label shift.",
    "2026-11-23: added a reciprocal covariate-shift relation, contrasting which conditional distribution is held fixed; existing definition and example unchanged."
  ]
}
