Skip to main content

Definition

The group by column statistic test allows you to measure a statistical property of one column grouped by the unique values of another column, and then set thresholds on how many groups fail to meet your criteria. For each unique value in the grouping column, the test calculates the specified statistic on the target column and checks if it meets your defined condition. The test then counts how many groups fail this condition and compares against your threshold.

Taxonomy

  • Task types: LLM, tabular classification, tabular regression.
  • Availability: and .

Why it matters

  • This test helps ensure statistical consistency across different segments or categories in your data.
  • It can detect bias, inconsistencies, or quality issues that affect specific subgroups differently.
  • It’s essential for fairness validation, ensuring that model inputs have similar statistical properties across different demographics or categories.
  • It helps identify data collection issues that might affect certain groups disproportionately.

How it works

The test follows these steps:
  1. Group the data by unique values in the specified grouping column
  2. Calculate the statistic (mean, median, etc.) on the target column for each group
  3. Apply the condition to each group’s statistic (e.g., mean >= 25)
  4. Count failing groups that don’t meet the condition
  5. Compare the count/percentage of failing groups against your threshold

Available statistics

The following statistical measures are supported for the target column:

Test configuration examples

If you are writing a tests.json, here are a few valid configurations for the group by column statistic test: