Definition

The geometric mean test measures the geometric mean of the precision and the recall. This metric provides a balanced measure that considers both precision and recall performance, calculated as the square root of their product.

Taxonomy

  • Task types: Tabular classification, text classification.
  • Availability: and .

Why it matters

  • Geometric mean provides an alternative to F1 score for balancing precision and recall, particularly useful when both metrics are equally important.
  • It’s more sensitive to low values than arithmetic mean, making it effective at identifying models with poor performance in either precision or recall.
  • Higher geometric mean values indicate better balanced performance, with 1.0 representing perfect precision and recall.
  • This metric is particularly valuable for imbalanced datasets where you want to ensure good performance on both classes.

Required columns

To compute this metric, your dataset must contain the following columns:
  • Predictions: The predicted class labels from your classification model
  • Ground truths: The actual/true class labels

Test configuration examples

If you are writing a tests.json, here are a few valid configurations for the geometric mean test:
[
  {
    "name": "Geometric mean above 0.75",
    "description": "Ensure that the geometric mean of precision and recall is above 0.75",
    "type": "performance",
    "subtype": "metricThreshold",
    "thresholds": [
      {
        "insightName": "metrics",
        "insightParameters": null,
        "measurement": "geometricMean",
        "operator": ">",
        "value": 0.75
      }
    ],
    "subpopulationFilters": null,
    "mode": "development",
    "usesValidationDataset": true,
    "usesTrainingDataset": false,
    "usesMlModel": true,
    "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689"
  }
]