liveBook · Manning

Matthews correlation coefficient

As explained in Starting Data Analytics with Generative AI and Python

A binary-classification metric ranging from -1 to +1 that summarizes agreement between predicted and observed classes using all four confusion-matrix counts.

Matthews correlation coefficient (MCC) evaluates binary classifications with one balanced score, even when the classes differ greatly. It uses true positives, false positives, false negatives, and true negatives: +1 means perfect prediction, 0 means no better than random, and −1 means total disagreement. section 5.5.5

Customer-review classification

For review sentiment, compare keyword-based positive predictions with observed positives defined by review scores of 4 or 5. Derive the four confusion-matrix counts, then use MCC to summarize classification quality and compare models. Validate quality with a small manually labeled dataset rather than automatically labeled examples. section 5.5.5

How Starting Data Analytics with Generative AI and Python covers it

How deep it goes
Defines the score and its range, but stops short of presenting its mathematical formula or calculation steps.
Examples
Uses keyword-based customer-review sentiment predictions compared with review-score labels and manually labeled assessment data.
What it assumes
Assumes binary predictions and observed classes, while requiring awareness of true and false positives and negatives.
What you can do after
Evaluate binary-classification quality and compare models using a score that incorporates all four confusion-matrix counts.
How it connects
Connects MCC with confusion matrices, sensitivity, specificity, ROC curves, and AUC.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Starting Data Analytics with Generative AI and Python. The section links point to the parts of the book it draws on.