Geometric Mean Score
When one class is rare—fraud, disease, churn—plain accuracy can look great even if your model misses almost every important case. The Geometric Mean Score (usually shortened to G-Mean) is a way to reward models that do well on both classes, not just the majority.
What it measures
In binary classification, G-Mean is the geometric mean of sensitivity/recall for the positive class and specificity for the negative class:
G-Mean = sqrt(TPR * TNR)
TPR = TP / (TP + FN) (recall for positives)
TNR = TN / (TN + FP) (specificity for negatives)
The key idea is the multiplication: if either TPR or TNR is low, the product collapses, and so does G-Mean. That makes it hard to “cheat” by predicting the majority class all the time.
Why it matters for imbalanced data
G-Mean directly reflects balanced performance. Two practical consequences:
- It discourages models that get high accuracy by ignoring the minority class (e.g., 99% non-fraud).
- It helps compare models when you care about both types of errors—missing positives (FN) and over-flagging negatives (FP).
Because it depends on a decision threshold, you can compute G-Mean across thresholds and pick the operating point that maximizes it.
Concrete examples and tooling
- Disease screening: a model with high recall but terrible specificity floods clinicians with false alarms; G-Mean penalizes that.
- Fraud detection: a model that flags everything catches fraud (high TPR) but harms customers (low TNR); G-Mean pushes toward a workable balance.
In Python, you’ll see it in imbalanced-learn as imblearn.metrics.geometric_mean_score, and it pairs naturally with resampling methods like SMOTE or class-weighted classifiers.
Geometric Mean Score (often G-mean) is a classification metric defined as the geometric mean of class-wise recall rates—commonly sqrt(sensitivity × specificity) in binary problems, and the nth root of the product of per-class recalls in multiclass settings. It matters for imbalanced learning because it rewards balanced performance across classes; a model that ignores the minority class yields a low G-mean even if accuracy is high.
Imagine you’re judging a smoke alarm. If it catches every real fire but also screams constantly when you make toast, it’s not really “good.” You want it to do well on both kinds of situations.
Geometric Mean Score (often called G-Mean) is a way to grade an AI classifier that has to spot rare things, like fraud or a disease. It rewards models that perform well on the common cases and the rare cases. If the model does great on one group but badly on the other, the score drops a lot. That makes it useful when plain accuracy would look misleadingly high.