{
  "status": "shipping",
  "advantages": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-10-17",
  "slug": "matthews-correlation-coefficient",
  "term": "Matthews correlation coefficient",
  "aliases": [
    "MCC",
    "phi coefficient"
  ],
  "definition": "For binary classification, the Matthews correlation coefficient is the Pearson correlation between predicted class labels and observed outcomes, calculated from all four confusion-matrix counts.",
  "note": "MCC = (TP*TN - FP*FN) / sqrt((TP+FP)*(TP+FN)*(TN+FP)*(TN+FN)), where TP, FP, FN and TN count true positives, false positives, false negatives and true negatives in the same evaluation population. When defined, it ranges from -1 for complete disagreement to +1 for complete agreement; zero means zero binary correlation, not proof of a particular guessing mechanism. [sklearn-mcc]\n\nIf either labels or predictions are constant, the denominator is zero and the correlation is undefined. scikit-learn 1.7.2 returns 0.0 in this case; Hesela's accompanying calculation returns null to keep that distinction visible. [sklearn-mcc-1-7-2]",
  "limitations": [
    {
      "text": "MCC is not a failure probability or the fraction of correct alerts; report the positive event, horizon, threshold, counts and population alongside it.",
      "citationIds": [
        "sklearn-mcc"
      ]
    }
  ],
  "related": [
    "f1-score",
    "precision",
    "recall",
    "false-positive-rate",
    "class-prevalence",
    "probability-calibration"
  ],
  "citations": [
    {
      "id": "sklearn-mcc",
      "title": "scikit-learn: Matthews correlation coefficient and binary confusion-matrix formula.",
      "url": "https://scikit-learn.org/stable/modules/model_evaluation.html#matthews-correlation-coefficient",
      "accessed": "2026-10-17"
    },
    {
      "id": "sklearn-mcc-1-7-2",
      "title": "scikit-learn 1.7.2: matthews_corrcoef, zero-denominator convention.",
      "url": "https://raw.githubusercontent.com/scikit-learn/scikit-learn/1.7.2/sklearn/metrics/_classification.py",
      "accessed": "2026-10-17"
    },
    {
      "id": "hesela-calibration",
      "title": "Hesela: synthetic ranking, decision and calibration example; not measured drive results.",
      "url": "https://hesela.com/analyses/ml-disk-failure-prediction/#probability-calibration",
      "accessed": "2026-10-17"
    }
  ]
}
