> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Column average

> Learn how to use the column average test

## Definition

The column average test allows you to assert that the mean of a column is within a certain range.

## Taxonomy

* **Task types**: LLM, tabular classification, tabular regression, text classification.
* **Availability**: <Tooltip tip="Continuously evaluate your models and datasets as you iterate on their versions.">development</Tooltip>
  and <Tooltip tip="Monitor a model in production, measure its health, check for drifts and set up alerts.">monitoring</Tooltip>.

## Why it matters

* If you are tracking quantities such as latency or cost (e.g. per LLM request), you can use the column average test to assert these quantities are within the expected range.
* Some features may have a known average value, and you can use the column average test to assert that it is within the expected range.

## Test configuration examples

If you are writing a `tests.json`, here are a few valid configurations for the character length test:

<CodeGroup>
  ```json Development theme={null}
  [
    {
      "name": "Average of column 'Age' is greater than 20",
      "description": "Asserts that the average value of the numeric column 'Age' is greater than 20",
      "type": "integrity",
      "subtype": "columnAverage",
      "thresholds": [
        {
          "insightName": "columnAverage",
          "insightParameters": [{ "name": "column_name", "value": "Age" }], // Check average on column `Age`
          "measurement": "columnAverage",
          "operator": ">",
          "value": 20.0
        }
      ],
      "subpopulationFilters": null,
      "mode": "development",
      "usesValidationDataset": true, // Apply test to the validation set
      "usesTrainingDataset": false,
      "usesMlModel": false,
      "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689" // Some unique id
    }
  ]
  ```

  ```json Monitoring theme={null}
  [
    {
      "name": "Average of column 'Age' is greater than 20",
      "description": "Asserts that the average value of the numeric column 'Age' is greater than 20",
      "type": "integrity",
      "subtype": "columnAverage",
      "thresholds": [
        {
          "insightName": "columnAverage",
          "insightParameters": [{ "name": "column_name", "value": "Age" }], // Check average on column `Age`
          "measurement": "columnAverage",
          "operator": ">",
          "value": 20.0
        }
      ],
      "subpopulationFilters": null,
      "mode": "monitoring",
      "usesProductionData": true,
      "evaluationWindow": 3600, // 1 hour
      "delayWindow": 0,
      "syncId": "b4dee7dc-4f15-48ca-a282-63e2c04e0689" // Some unique id
    }
  ]
  ```
</CodeGroup>

## Related

* [Great Expectations test](/tests/integrity/great-expectations) with expectations such as
  `expect_column_mean_to_be_between`, `expect_column_median_to_be_between`, etc.
