# All metrics

{% hint style="info" %}
**You are looking at the old Evidently documentation**: this API is available with versions 0.6.7 or lower. Check the newer version [here](https://docs.evidentlyai.com/introduction).
{% endhint %}

<details>

<summary>How to use this page</summary>

This is a reference page. It shows all the available Metrics, Descriptors and Presets.

You can use the menu on the right to navigate the sections. We organize the Metrics by logical groups. Note that these groups do **not** match the Presets with a similar name. For example, there are more Data Quality Metrics than included in the `DataQualityPreset`.

## How to read the tables

* **Name**: the name of the Metric.
* **Description**: plain text explanation. For Metrics, we also specify whether it applies to the whole dataset or individual columns.
* **Parameters**: required and optional parameters for the Metric or Preset. We also specify the defaults that apply if you do not pass a custom parameter.

**Metric visualizations**. Each Metric includes a default render. To see the visualization, navigate to the [example notebooks](https://github.com/evidentlyai/docs-old/blob/main/get-started/examples.md) and run the notebook with all Metrics or Metric Presets.

</details>

{% hint style="info" %}
We are doing our best to maintain this page up to date. In case of discrepancies, check the "All metrics" notebook in [examples](/tutorials-and-examples/examples.md). If you notice an error, please send us a pull request with an update!
{% endhint %}

## Metric Presets

**Defaults**: Presets use the default parameters for each Metric. You can see them in the tables below.

<details>

<summary>Data Quality Preset</summary>

`DataQualityPreset` captures column and dataset summaries. Input columns are required. Prediction and target are optional.

**Composition**:

* `DatasetSummaryMetric()`
* `ColumnSummaryMetric()` for `all` or specified `сolumns`
* `DatasetMissingValuesMetric()`

**Optional parameters**:

* `columns`

</details>

<details>

<summary>Data Drift Preset</summary>

`DataDriftPreset` evaluates the data distribution drift in all individual columns, and share of drifting columns in the dataset. Input columns are required.

**Composition**:

* `DataDriftTable()` for all or specified `columns`
* `DatasetDriftMetric()` for all or specified `columns`

**Optional parameters**:

* `columns`
* `stattest`
* `cat_stattest`
* `num_stattest`
* `per_column_stattest`
* `text_stattest`
* `stattest_threshold`
* `cat_stattest_threshold`
* `num_stattest_threshold`
* `per_column_stattest_threshold`
* `text_stattest_threshold`
* `embeddings`
* `embeddings_drift_method`
* `drift_share`

How to set [data drift parameters](/user-guide/customization/options-for-statistical-tests.md), [embeddings drift parameters](/user-guide/customization/embeddings-drift-parameters.md).

</details>

<details>

<summary>Target Drift Preset</summary>

`TargetDriftPreset` evaluates the prediction or target drift. Target and/or prediction is required. Input features are optional.

**Composition**:

* `ColumnDriftMetric()` for `target` and/or `prediction` columns
* `ColumnCorrelationsMetric()` for `target` and/or `prediction` columns
* `TargetByFeaturesTable()` for all or specified `columns`
* `ColumnValuePlot()` for `target` and/or `prediction` columns - if the task is `regression`

**Optional parameters**:

* `columns`
* `stattest`
* `cat_stattest`
* `num_stattest`
* `per_column_stattest`
* `stattest_threshold`
* `cat_stattest_threshold`
* `num_stattest_threshold`
* `per_column_stattest_threshold`

How to set [data drift parameters](/user-guide/customization/options-for-statistical-tests.md).

</details>

<details>

<summary>Regression Preset</summary>

`RegressionPreset` evaluates the quality of a regression model. Prediction and target are required. Input features are optional.

**Composition**:

* `RegressionQualityMetric()`
* `RegressionPredictedVsActualScatter()`
* `RegressionPredictedVsActualPlot()`
* `RegressionErrorPlot()`
* `RegressionAbsPercentageErrorPlot()`
* `RegressionErrorDistribution()`
* `RegressionErrorNormality()`
* `RegressionTopErrorMetric()`
* `RegressionErrorBiasTable()` for all or specified `columns`

**Optional parameters**:

* `columns`

</details>

<details>

<summary>Classification Preset</summary>

`ClassificationPreset` evaluates the quality of a classification model. Prediction and target are required. Input features are optional.

**Composition**:

* `ClassificationQualityMetric()`
* `ClassificationClassBalance()`
* `ClassificationConfusionMatrix()`
* `ClassificationQualityByClass()`
* `ClassificationClassSeparationPlot()` - if probabilistic classification
* `ClassificationProbDistribution()`- if probabilistic classification
* `ClassificationRocCurve()` - if probabilistic classification
* `ClassificationPRCurve()` - if probabilistic classification
* `ClassificationPRTable()` - if probabilistic classification
* `ClassificationQualityByFeatureTable()` for all or specified `columns`

**Optional parameters**:

* `columns`
* `probas_threshold`

</details>

<details>

<summary>Text Evals</summary>

`TextEvals()` provides a simplified interface to list `Descriptors` for a given text column. It it returns a summary of evaluation results.

**Composition**:

* `ColumnSummaryMetric()` for text descriptors for the specified text column:
  * `Sentiment()`
  * `SentenceCount()`
  * `OOV()`
  * `TextLength()`
  * `NonLetterCharacterPercentage()`

**Required parameters**:

* `column_name`

**Optional parameters**:

* `descriptors` list

</details>

<details>

<summary>RecSys (Recommender System) Preset</summary>

`RecsysPreset` evaluates the quality of the recommender system. Recommendations and true relevance scores are required. For some metrics, training data and item features are required.

**Composition**:

* `PrecisionTopKMetric()`
* `RecallTopKMetric()`
* `FBetaTopKMetric()`
* `MAPKMetric()`
* `NDCGKMetric()`
* `MRRKMetric()`
* `HitRateKMetric()`
* `PersonalizationMetric()`
* `PopularityBias()`
* `RecCasesTable()`
* `ScoreDistribution()`
* `DiversityMetric()`
* `SerendipityMetric()`
* `NoveltyMetric()`
* `ItemBiasMetric()` (pass column as a parameter)
* `UserBiasMetric()`(pass column as a parameter)

**Required parameter**:

* `k`

**Optional parameters**:

* `min_rel_score: Optional[int]`
* `no_feedback_users: bool`
* `normalize_arp: bool`
* `user_ids: Optional[List[Union[int, str]]]`
* `display_features: Optional[List[str]]`
* `item_features: Optional[List[str]]`
* `user_bias_columns: Optional[List[str]]`
* `item_bias_columns: Optional[List[str]]`

</details>

## Data Quality

| Metric                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Parameters                                                                                                                                                                                                                                                                                                           |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>DatasetSummaryMetric()</strong><br><br>Dataset-level.<br><br>Calculates descriptive dataset statistics, including:</p><ul><li>Number of columns by type</li><li>Number of rows</li><li>Missing values</li><li>Empty columns</li><li>Constant and almost constant columns</li><li>Duplicated and almost duplicated columns</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                  | <p><strong>Required</strong>:<br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>missing\_values = \[], replace = True/False</code> (see default types below)</li><li><code>almost\_constant\_threshold</code> (default = 0.95)</li><li><code>almost\_duplicated\_threshold</code> (default = 0.95)</li></ul> |
| <p><strong>DatasetMissingValuesMetric()</strong><br><br>Dataset-level.<br><br>Calculates the number and share of missing values in the dataset.<br><br>Displays the number of missing values per column.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | <p><strong>Required</strong>:<br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>missing\_values = \[], replace = True/False</code> (default = four types of missing values, see above)</li></ul>                                                                                                             |
| <p><strong>DatasetCorrelationsMetric()</strong><br><br>Dataset-level.<br><br>Calculates the correlations between all columns in the dataset. Uses: Pearson, Spearman, Kendall, Cramer\_V.<br><br>Visualizes the heatmap.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                                    |
| <p><strong>ColumnSummaryMetric()</strong><br><br>Column-level.<br><br>Calculates various descriptive statistics for numerical, categorical, text or DateTime columns, including:</p><ul><li>Count</li><li>Min, max, mean (for numerical)</li><li>Standard deviation (for numerical)</li><li>Quantiles - 25%, 50%, 75% (for numerical)</li><li>Unique value share</li><li>Most common value share</li><li>Missing value share</li><li>New and missing categories (for categorical)</li><li>Last and first date (for DateTime)</li><li>Length, OOV% and Non-letter % (for text)</li></ul><p><br>Plots the distribution histogram. If DateTime is provided, also plots the distribution over time. If Target is provided, also plots the relation with Target.</p> | <p><strong>Required</strong>:<br><code>column\_name</code><br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                              |
| <p><strong>ColumnMissingValuesMetric()</strong><br><br>Column-level.<br><br>Calculates the number and share of missing values in the column.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | <p><strong>Required</strong>:<br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>missing\_values = \[], replace = True/False</code> (default = four types of missing values, see below)</li></ul>                                                                                                             |
| <p><strong>ColumnRegExpMetric()</strong><br><br>Column-level.<br><br>Calculates the number and share of the values that do not match a defined regular expression.<br><br>Example use: <code>ColumnRegExpMetric(column\_name="status", reg\_exp=r".*child.*")</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | <p><strong>Required:</strong></p><ul><li><code>column\_name</code></li><li><code>reg\_exp</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>top</code> (the number of the most mismatched columns to return, default = 10)</li></ul>                                                                    |
| <p><strong>ColumnDistributionMetric()</strong><br><br>Column-level.<br><br>Plots the distribution histogram and returns bin positions and values for the given column.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | <p><strong>Required:</strong><br><code>column\_name</code><br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                              |
| <p><strong>ColumnValuePlot()</strong><br><br>Column-level.<br><br>Plots the values in time.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | <p><strong>Required:</strong><br><code>column\_name</code><br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                              |
| <p><strong>ColumnQuantileMetric()</strong><br><br>Column-level.<br><br>Calculates the defined quantile value and plots the distribution for the given numerical column.<br><br>Example use: <code>ColumnQuantileMetric(column\_name="name", quantile=0.75)</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | <p><strong>Required:</strong></p><ul><li><code>column\_name</code></li><li><code>quantile</code></li></ul><p><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                   |
| <p><strong>ColumnCorrelationsMetric()</strong><br><br>Column-level.<br><br>Calculates the correlations between the defined column and all the other columns in the dataset.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | <p><strong>Required:</strong><br><code>column\_name</code><br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                              |
| <p><strong>ColumnValueListMetric()</strong><br><br>Column-level.<br><br>Calculates the number of values in the list / out of the list / not found in a given column. The value list should be specified.<br><br>Example use: <code>ColumnValueListMetric(column\_name="city", values=\["London", "Paris"])</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                           | <p><strong>Required:</strong></p><ul><li><code>column\_name</code></li><li><code>values</code></li></ul><p><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                     |
| <p><strong>ColumnValueRangeMetric()</strong><br><br>Column-level.<br><br>Calculates the number and share of values in the specified range / out of range in a given column. Plots the distributions.<br><br>Example use: <code>ColumnValueRangeMetric(column\_name="age", left=10, right=20)</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                         | <p><strong>Required:</strong></p><ul><li><code>column\_name</code></li><li><code>left</code></li><li><code>right</code></li></ul>                                                                                                                                                                                    |
| <p><strong>ConflictPredictionMetric()</strong><br><br>Dataset-level.<br><br>Calculates the number of instances where the model returns a different output for an identical input. Can be a signal of low-quality model or data errors.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                                    |
| <p><strong>ConflictTargetMetric()</strong><br><br>Dataset-level.<br><br>Calculates the number of instances where there is a different target value or label for an identical input. Can be a signal of a labeling or data error.</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                                    |

**Defaults for Missing Values**. The metrics that calculate the number or share of missing values detect four types of missing values by default: Pandas nulls (None, NAN, etc.), "" (empty string), Numpy "-inf" value, Numpy "inf" value. You can also pass custom missing values as a parameter and specify if you want to replace the default list. Example:

```python
DatasetMissingValuesMetric(missing_values=["", 0, "n/a", -9999, None], replace=True)
```

## Text Evals

Text Evals only apply to text columns. To compute a Descriptor for a single text column, use a `TextEvals` Preset. Read [docs](/user-guide/tests-and-reports/text-descriptors.md).

You can also explicitly specify the Evidently Metric (e.g., `ColumnSummaryMetric`) to visualize the descriptor, or pick a [Test](/reference/all-tests.md) (e.g., `TestColumnValueMin`) to run validations.

### Descriptors: Text Patterns

Check for regular expression matches.

| Descriptor                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Parameters                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>RegExp()</strong></p><ul><li>Matches text against any specified regular expression.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>RegExp(reg\_exp=r"^I")</code></p>                                                                                                                                                                                                                                                                                               | <p><strong>Required:</strong><br><code>reg\_exp</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                    |
| <p><strong>BeginsWith()</strong></p><ul><li>Checks if the text begins with a specified combination.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>BeginsWith(prefix="How")</code></p>                                                                                                                                                                                                                                                                                        | <p><strong>Required:</strong><br><code>prefix</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul>                                                                    |
| <p><strong>EndsWith()</strong></p><ul><li>Checks if the text ends with a specified combination.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>EndsWith(suffix="Thank you.")</code></p>                                                                                                                                                                                                                                                                                       | <p><strong>Required:</strong><br><code>suffix</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul>                                                                    |
| <p><strong>Contains()</strong></p><ul><li>Checks if the text contains any or all specified items (e.g. competitor names, etc.)</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>Contains(items=\["medical leave"])</code></p>                                                                                                                                                                                                                                                   | <p><strong>Required:</strong><br><code>items: List\[str]</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'any'</code> or <code>'all'</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul> |
| <p><strong>DoesNotContain()</strong></p><ul><li>Checks if the text does not contain any or all specified items.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>DoesNotContain(items=\["as a large language model"]</code></p>                                                                                                                                                                                                                                                 | <p><strong>Required:</strong><br><code>items: List\[str]</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'all'</code> or <code>'any'</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul> |
| <p><strong>IncludesWords()</strong></p><ul><li>Checks if the text includes <strong>any</strong> (default) or <strong>all</strong> specified words.</li><li>Considers only vocabulary words (from NLTK vocabulary).</li><li>By default, considers inflected and variant forms of the same word.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>IncludesWords(words\_list=\['booking', 'hotel', 'flight']</code></p>                                                            | <p><strong>Required:</strong><br><code>words\_list: List\[str]</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'any'</code> or <code>'all'</code></li><li><code>lemmatize = True</code> or <code>False</code></li></ul> |
| <p><strong>ExcludesWords()</strong></p><ul><li>Checks if the text excludes all specified words.</li><li>Considers only vocabulary words (from NLTK vocabulary).</li><li>By default, considers inflected and variant forms of the same word.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>ExcludesWords(words\_list=\['buy', 'sell', 'bet']</code></p>                                                                                                                       | <p><strong>Required:</strong><br><code>words\_list: List\[str]</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'all'</code> or <code>'any'</code></li><li><code>lemmatize = True</code> or <code>False</code></li></ul> |
| <p><strong>ItemMatch()</strong></p><ul><li>Checks whether the text contains <strong>any</strong> (default) or <strong>all</strong> specified items that are specific to each row (represented as tuples)</li><li>Returns True/False for each row.</li></ul><p>Example use:<br><code>ItemMatch(with\_column="expected")</code></p>                                                                                                                                                                            | <p><strong>Required:</strong><br><code>with\_column: str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'all'</code> or <code>'any'</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul> |
| <p><strong>ItemNoMatch()</strong></p><ul><li>Checks whether the text excludes <strong>any</strong> (default) or <strong>all</strong> specified items that are specific to each row (represented as tuples)</li><li>Returns True/False for each row.</li></ul><p>Example use:<br><code>ItemMatch(with\_column="forbidden")</code></p>                                                                                                                                                                         | <p><strong>Required:</strong><br><code>with\_column: str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'all'</code> or <code>'any'</code></li><li><code>case\_sensitive = True</code> or <code>False</code></li></ul> |
| <p><strong>WordMatch()</strong></p><ul><li>Checks whether the text includes <strong>any</strong> (default) or <strong>all</strong> specified words for each row (represented as tuples).</li><li>Considers only vocabulary words (from NLTK vocabulary).</li><li>By default, considers inflected and variant forms of the same word.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>WordMatch(with\_column="expected")</code></p>                                             | <p><strong>Required:</strong><br><code>with\_column: str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'any'</code> or <code>'all'</code></li><li><code>lemmatize = True</code> or <code>False</code></li></ul>       |
| <p><strong>WordNoMatch()</strong></p><ul><li>Checks whether the text excludes <strong>any</strong> (default) or <strong>all</strong> specified words for each row (represented as tuples).</li><li>Considers only vocabulary words (from NLTK vocabulary).</li><li>By default, considers inflected and variant forms of the same word.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>WordMatch(with\_column="forbidden")</code></p>                                          | <p><strong>Required:</strong><br><code>with\_column: str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>mode = 'any'</code> or <code>'all'</code></li><li><code>lemmatize = True</code> or <code>False</code></li></ul>       |
| <p><strong>ExactMatch()</strong></p><ul><li>Checks if the text matches between two columns.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>ExactMatch(with\_column='reference')</code></p>                                                                                                                                                                                                                                                                                    | <p><strong>Required:</strong><br><code>with\_column: str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                           |
| <p><strong>IsValidJSON()</strong></p><ul><li>Checks if the text in a specified column is a valid JSON.</li><li>Returns True/False for every input.</li></ul>                                                                                                                                                                                                                                                                                                                                                 | <p><strong>Required:</strong> n/a<br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                             |
| <p><strong>JSONSchemaMatch()</strong></p><ul><li>Checks if the text contains a JSON object matching the expected\_schema.</li><li>Supports exact (<strong>exact=True</strong>) or minimal (<strong>exact=False</strong>) matching, with optional strict type validation (<strong>validate\_types=True</strong>).</li><li>Returns True/False for each row.</li></ul><p>Example use:<br><code>JSONSchemaMatch(expected\_schema={"name": str, "age": int}, exact\_match=False, validate\_types=True)</code></p> | <p><strong>Required:</strong><br><code>expected\_schema: Dict\[str, type]</code><br><br><strong>Optional:</strong></p><ul><li><code>exact\_match = True</code> or <code>False</code></li><li><code>validate\_types = True</code> or <code>False</code></li></ul>            |
| <p><strong>JSONMatch()</strong></p><ul><li>Compares two columns of a dataframe and checks whether the two objects in each row of the dataframe are matching JSONs or not.</li><li>Returns True/False for every input.</li></ul><p>Example use:<br><code>JSONMatch(with\_column="column\_2")</code></p>                                                                                                                                                                                                       | <p><strong>Required:</strong><br><code>with\_column : str</code><br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                          |
| <p><strong>ContainsLink()</strong></p><ul><li>Checks if the text contains at least one valid URL.</li><li>Returns True/False for each row.</li></ul>                                                                                                                                                                                                                                                                                                                                                         | <p><strong>Required:</strong> n/a<br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                             |
| <p><strong>IsValidPython()</strong></p><ul><li>Checks if the text is valid Python code without syntax errors.</li><li>Returns True/False for every input.</li></ul>                                                                                                                                                                                                                                                                                                                                          | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                      |
| <p><strong>IsValidSQL()</strong></p><ul><li>Checks if the text in a specified column is a valid SQL query without executing the query.</li><li>Returns True/False for every input.</li></ul>                                                                                                                                                                                                                                                                                                                 | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                      |

### Descriptors: Text stats

Computes descriptive text statistics.

| Descriptor                                                                                                                                                                          | Parameters                                                                                                                                                            |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>TextLength()</strong></p><ul><li>Measures the length of the text in symbols.</li><li>Returns an absolute number.</li></ul>                                               | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                |
| <p><strong>OOV()</strong></p><ul><li>Calculates the percentage of out-of-vocabulary words based on imported NLTK vocabulary.</li><li>Return a score on a scale: 0 to 100.</li></ul> | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li><li><code>ignore\_words: Tuple = ()</code></li></ul> |
| <p><strong>NonLetterCharacterPercentage()</strong></p><ul><li>Calculates the percentage of non-letter characters.</li><li>Return a score on a scale: 0 to 100.</li></ul>            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                |
| <p><strong>SentenceCount()</strong></p><ul><li>Counts the number of sentences in the text.</li><li>Returns an absolute number.</li></ul>                                            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                |
| <p><strong>WordCount()</strong></p><ul><li>Counts the number of words in the text.</li><li>Returns an absolute number.</li></ul>                                                    | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                |

### Descriptors: LLM-based

Use external LLMs with an evaluation prompt to score text data. (Also known as LLM-as-a-judge method).

| Descriptor                                                                                                                                                                                                                                   | Parameters                                                                                                                                                          |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>LLMEval()</strong><br><br>Scores the text using the user-defined criteria, automatically formatted in a templated evaluation prompt.</p>                                                                                          | See [docs](/user-guide/customization/llm_as_a_judge.md) for examples and parameters.                                                                                |
| <p><strong>DeclineLLMEval()</strong><br><br>Detects texts containing a refusal or a rejection to do something. Returns a label (DECLINE or OK) or score.</p>                                                                                 | See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters.                                                                                             |
| <p><strong>PIILLMEval()</strong><br><br>Detects texts containing PII (Personally Identifiable Information). Returns a label (PII or OK) or score.</p>                                                                                        | See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters.                                                                                             |
| <p><strong>NegativityLLMEval()</strong><br><br>Detects negative texts (containing critical or pessimistic tone). Returns a label (NEGATIVE or POSITIVE) or score.</p>                                                                        | See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters.                                                                                             |
| <p><strong>BiasLLMEval()</strong><br><br>Detects biased texts (containing prejudice for or against a person or group). Returns a label (BIAS or OK) or score.</p>                                                                            | See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters.                                                                                             |
| <p><strong>ToxicityLLMEval()</strong><br><br>Detects toxic texts (containing harmful, offensive, or derogatory language). Returns a label (TOXICITY or OK) or score.</p>                                                                     | See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters.                                                                                             |
| <p><strong>ContextQualityLLMEval()</strong><br><br>Evaluates if CONTEXT is VALID (has sufficient information to answer the QUESTION) or INVALID (has missing or contradictory information). Returns a label (VALID or INVALID) or score.</p> | Run the descriptor over the `context` column and pass the `question` column as a parameter. See [docs](/user-guide/customization/llm_as_a_judge.md) for parameters. |

### Descriptors: Model-based

Use pre-trained machine learning models for evaluation.

| Descriptor                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>Semantic Similarity()</strong></p><ul><li>Calculates pairwise semantic similarity between columns.</li><li>Generates text embeddings using a <a href="https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2">transformer model</a>.</li><li>Calculates Cosine Similarity between each pair of texts.</li><li>Return a score on a scale: 0 to 1. (0: different, 0.5: unrelated, 1: identical).</li></ul><p>Example use:<br><code>SemanticSimilarity(with\_column="response")</code></p> | <p><strong>Required:</strong></p><ul><li><code>with\_column</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                                                                                                                                                         |
| <p><strong>Sentiment()</strong></p><ul><li>Analyzes the sentiment of the text using a word-based model.</li><li>Return a score on a scale: -1 (negative) to 1 positive).</li></ul>                                                                                                                                                                                                                                                                                                                        | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>display\_name</code></li></ul>                                                                                                                                                                                                                                                                                                                            |
| <p><strong>HuggingFaceModel()</strong><br><br>Scores the text using the user-selected HuggingFace model.</p>                                                                                                                                                                                                                                                                                                                                                                                              | See [docs](/user-guide/customization/huggingface_descriptor.md) with some example models (classification by topic, emotion, etc.)                                                                                                                                                                                                                                                                                                                 |
| <p><strong>HuggingFaceToxicityModel()</strong></p><ul><li>Detects hate speech using <a href="https://huggingface.co/facebook/roberta-hate-speech-dynabench-r4-target">HuggingFace Model</a>.</li><li>Returns predicted probability for the “hate” label.</li><li>Scale: 0 to 1.</li></ul>                                                                                                                                                                                                                 | <p><strong>Optional</strong>:</p><ul><li><code>toxic\_label="hate"</code> (default)</li><li><code>display\_name</code></li></ul>                                                                                                                                                                                                                                                                                                                  |
| <p><strong>BERTScore()</strong></p><ul><li>Calculates similarity between two text columns based on token embeddings from a pre-trained BERT model.</li><li>Returns <a href="https://arxiv.org/pdf/1904.09675">BERTScore</a> (F1 Score) based on cosine similarity between token embeddings.</li></ul>                                                                                                                                                                                                     | <p><strong>Required:</strong></p><ul><li><code>with\_column</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>model</code>:Name of the pre-trained BERT model to use (default: <code>"bert-base-uncased"</code>).</li><li><code>tfidf\_weighted</code>: Boolean indicating if embeddings should be weighted with inverse document frequency (IDF) scores (default: <code>False</code>).</li><li><code>display\_name</code></li></ul> |

## Data Drift

**Defaults for Data Drift**. By default, all data drift metrics use the Evidently [drift detection logic](/reference/data-drift-algorithm.md) that selects a drift detection method based on feature type and volume. You always need a reference dataset.

To modify the logic or select a different test, you should set [data drift parameters](/user-guide/customization/options-for-statistical-tests.md) or [embeddings drift parameters](/user-guide/customization/embeddings-drift-parameters.md). You can choose from 20+ drift detection methods and optionally pass [feature importances](/user-guide/customization/feature-importance.md).

| Metric                                                                                                                                                                                                                                                                             | Parameters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>DatasetDriftMetric()</strong></p><ul><li>Dataset-level.</li><li>Calculates the number and share of drifted features in the dataset.</li><li>Each feature is tested for drift individually using the default algorithm, unless a custom approach is specified.</li></ul> | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>сolumns</code> (default=all)</li><li><code>drift\_share</code>(default for dataset drift = 0.5)</li><li><code>stattest</code></li><li><code>cat\_stattest</code></li><li><code>num\_stattest</code></li><li><code>per\_column\_stattest</code></li><li><code>stattest\_threshold</code></li><li><code>cat\_stattest\_threshold</code></li><li><code>num\_stattest\_threshold</code></li><li><code>per\_column\_stattest\_threshold</code></li></ul><p><a href="/pages/loKOxHo4NEuE2fwDQzBL">How to set data drift parameters</a>.</p> |
| <p><strong>DataDriftTable()</strong></p><ul><li>Dataset-level.</li><li>Calculates data drift for all or selected columns.</li><li>Returns drift detection results for each column.</li><li>Visualizes distributions for all columns in a table.</li></ul>                          | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>сolumns</code></li><li><code>stattest</code></li><li><code>cat\_stattest</code></li><li><code>num\_stattest</code></li><li><code>per\_column\_stattest</code></li><li><code>stattest\_threshold</code></li><li><code>cat\_stattest\_threshold</code></li><li><code>num\_stattest\_threshold</code></li><li><code>per\_column\_stattest\_threshold</code></li></ul><p><a href="/pages/loKOxHo4NEuE2fwDQzBL">How to set data drift parameters</a>, <a href="/pages/Q1NbuGfep5byI8JEA6NG">embeddings drift parameters</a>.</p>           |
| <p><strong>ColumnDriftMetric()</strong></p><ul><li>Column-level.</li><li>Calculates data drift for a defined column (tabular or text).</li><li>Visualizes distributions.</li></ul>                                                                                                 | <p><strong>Required:</strong></p><ul><li><code>column\_name</code></li></ul><p><br><strong>Optional:</strong></p><ul><li><code>stattest</code></li><li><code>stattest\_threshold</code></li></ul><p><a href="/pages/loKOxHo4NEuE2fwDQzBL">How to set data drift parameters</a></p>                                                                                                                                                                                                                                                                                                                                            |
| <p><strong>EmbeddingsDriftMetric()</strong></p><ul><li>Column-level.</li><li>Calculates data drift for embeddings.</li><li>Requires embedding column mapping.</li></ul>                                                                                                            | <p><strong>Required:</strong></p><ul><li><code>embeddings\_name</code></li></ul><p><br><strong>Optional:</strong></p><ul><li><code>drift\_method</code></li></ul><p><a href="/pages/Q1NbuGfep5byI8JEA6NG">How to set embeddings drift parameters</a>.</p>                                                                                                                                                                                                                                                                                                                                                                     |

## Classification

The metrics work both for probabilistic and non-probabilistic classification. All metrics are dataset-level. All metrics require column mapping of target and prediction.

| Metric                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Parameters                                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>ClassificationDummyMetric()</strong><br><br>Calculates the quality of the dummy model built on the same data. This can serve as a baseline.</p>                                                                                                                                                                                                                                                                                                    | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationQualityMetric()</strong><br><br>Calculates various classification performance metrics, including:</p><ul><li>Accuracy</li><li>Precision</li><li>Recall</li><li>F-1 score</li><li>TPR (True Positive Rate)</li><li>TNR (True Negative Rate)</li><li>FPR (False Positive Rate)</li><li>FNR (False Negative Rate)</li><li>ROC AUC Score (for probabilistic classification)</li><li>LogLoss (for probabilistic classification)</li></ul> | <p><strong>Required:</strong>:<br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>probas\_threshold</code> (default for classification = None; default for probabilistic classification = 0.5)</li><li><code>k</code> (default = None)</li></ul> |
| <p><strong>ClassificationClassBalance()</strong><br><br>Calculates the number of objects for each label. Plots the histogram.</p>                                                                                                                                                                                                                                                                                                                             | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationConfusionMatrix()</strong><br><br>Calculates the TPR, TNR, FPR, FNR, and plots the confusion matrix.</p>                                                                                                                                                                                                                                                                                                                             | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>probas\_threshold</code>(default for classification = None; default for probabilistic classification = 0.5)</li><li><code>k</code> (default = None)</li></ul>   |
| <p><strong>ClassificationQualityByClass()</strong><br><br>Calculates the classification quality metrics for each class. Plots the matrix.</p>                                                                                                                                                                                                                                                                                                                 | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>probas\_threshold</code>(default for classification = None; default for probabilistic classification = 0.5)</li><li><code>k</code> (default = None)</li></ul>   |
| <p><strong>ClassificationClassSeparationPlot()</strong><br><br>Visualization of the predicted probabilities by class. Applicable for probabilistic classification only.</p>                                                                                                                                                                                                                                                                                   | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationProbDistribution()</strong><br><br>Visualization of the probability distribution by class. Applicable for probabilistic classification only.</p>                                                                                                                                                                                                                                                                                     | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationRocCurve()</strong><br><br>Plots ROC Curve. Applicable for probabilistic classification only.</p>                                                                                                                                                                                                                                                                                                                                    | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationPRCurve()</strong><br><br>Plots Precision-Recall Curve. Applicable for probabilistic classification only.</p>                                                                                                                                                                                                                                                                                                                        | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationPRTable()</strong><br><br>Calculates the Precision-Recall table that shows model quality at a different decision threshold.</p>                                                                                                                                                                                                                                                                                                      | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                       |
| <p><strong>ClassificationQualityByFeatureTable()</strong><br><br>Plots the relationship between feature values and model quality.</p>                                                                                                                                                                                                                                                                                                                         | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>columns</code>(default = all categorical and numerical columns)</li></ul>                                                                                       |

## Regression

All metrics are dataset-level. All metrics require column mapping of target and prediction.

| Metric                                                                                                                                                                                                                                                                                                                                                             | Parameters                                                                                                                                                                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>RegressionDummyMetric()</strong><br><br>Calculates the quality of the dummy model built on the same data. This can serve as a baseline.</p>                                                                                                                                                                                                             | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionQualityMetric()</strong><br><br>Calculates various regression performance metrics, including:</p><ul><li>RMSE</li><li>Mean error (+ standard deviation)</li><li>MAE(+ standard deviation)</li><li>MAPE (+ standard deviation)</li><li>Max absolute error</li></ul>                                                                            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionPredictedVsActualScatter()</strong><br><br>Visualizes predicted vs actual values in a scatter plot.</p>                                                                                                                                                                                                                                       | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionPredictedVsActualPlot()</strong><br><br>Visualizes predicted vs. actual values in a line plot.</p>                                                                                                                                                                                                                                            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionErrorPlot()</strong><br><br>Visualizes the model error (predicted - actual) in a line plot.</p>                                                                                                                                                                                                                                               | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionAbsPercentageErrorPlot()</strong><br><br>Visualizes the absolute percentage error in a line plot.</p>                                                                                                                                                                                                                                         | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionErrorDistribution()</strong><br><br>Visualizes the distribution of the model error in a histogram.</p>                                                                                                                                                                                                                                        | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionErrorNormality()</strong><br><br>Visualizes the quantile-quantile plot (Q-Q plot) to estimate value normality.</p>                                                                                                                                                                                                                            | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong><br>n/a</p>                                                                                                                                                                                                                            |
| <p><strong>RegressionTopErrorMetric()</strong><br><br>Calculates the regression performance metrics for different groups:</p><ul><li>top-X% of predictions with overestimation</li><li>top-X% of predictions with underestimation</li><li>Majority(the rest)</li></ul><p><br>Visualizes the group division on a scatter plot with predicted vs. actual values.</p> | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>top\_error</code> (default=0.05; the metrics are calculated for top-5% predictions with overestimation and underestimation).</li></ul>                                                                               |
| <p><strong>RegressionErrorBiasTable()</strong><br><br>Plots the relationship between feature values and model quality per group (for top-X% error groups, as above).</p>                                                                                                                                                                                           | <p><strong>Required:</strong><br>n/a<br><br><strong>Optional:</strong></p><ul><li><code>columns</code>(default = all categorical and numerical columns)</li><li><code>top\_error</code> (default=0.05; the metrics are calculated for top-5% predictions with overestimation and underestimation).</li></ul> |

## Ranking and Recommendations

All metrics are dataset-level. Check individual metric descriptions [here](/reference/all-metrics/ranking-metrics.md). All metrics require recommendations column mapping.

Optional shared parameters for multiple metrics:

* `no_feedback_users: bool = False`. Specifies whether to include the users who did not select any of the items, when computing the quality metric. Default: False.
* `min_rel_score: Optional[int] = None`. Specifies the minimum relevance score to consider relevant when calculating the quality metrics for non-binary targets (e.g., if a target is a rating or a custom score).

| Metric                                                                                                                                                                                                                                                                        | Parameters                                                                                                                                                                                                                                             |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><strong>RecallTopKMetric()</strong><br><br>Calculates the recall at <code>k</code>.</p>                                                                                                                                                                                    | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                                                              |
| <p><strong>PrecisionTopKMetric()</strong><br><br>Calculates the precision at <code>k</code>.</p>                                                                                                                                                                              | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                                                              |
| <p><strong>FBetaTopKMetric()</strong><br><br>Calculates the F-measure at <code>k</code>.</p>                                                                                                                                                                                  | <p><strong>Required</strong>:</p><ul><li><code>beta</code>(default = 1)</li><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                       |
| <p><strong>MAPKMetric()</strong><br><br>Calculates the Mean Average Precision (MAP) at <code>k</code>.</p>                                                                                                                                                                    | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                                                              |
| <p><strong>MARKMetric()</strong><br><br>Calculates the Mean Average Recall (MAR) at <code>k</code>.</p>                                                                                                                                                                       | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                                                              |
| <p><strong>NDCGKMetric()</strong><br><br>Calculates the Normalized Discounted Cumulative Gain at <code>k</code>.</p>                                                                                                                                                          | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional:</strong></p><ul><li><code>no\_feedback\_users</code></li><li><code>min\_rel\_score</code></li></ul>                                                              |
| <p><strong>MRRKMetric()</strong><br><br>Calculates the Mean Reciprocal Rank (MRR) at <code>k</code>.</p>                                                                                                                                                                      | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional</strong>:</p><ul><li><code>min\_rel\_score</code></li><li><code>no\_feedback\_users</code></li></ul>                                                              |
| <p><strong>HitRateKMetric()</strong><br><br>Calculates the hit rate at <code>k</code>: a share of users for which at least one relevant item is included in the K.</p>                                                                                                        | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional</strong>:</p><ul><li><code>min\_rel\_score</code></li><li><code>no\_feedback\_users</code></li></ul>                                                              |
| <p><strong>DiversityMetric()</strong><br><br>Calculates intra-list Diversity at <code>k</code>: diversity of recommendations shown to each user in top-K recommendations, averaged by all users.</p>                                                                          | <p><strong>Required</strong>:</p><ul><li><code>k</code></li><li><code>item\_features: List</code></li></ul><p><strong>Optional:</strong></p><ul><li>-</li></ul>                                                                                        |
| <p><strong>NoveltyMetric()</strong><br><br>Calculates novelty at <code>k</code>: novelty of recommendations shown to each user in top-K recommendations, averaged by all users.<br><br>Requires a training dataset.</p>                                                       | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul>                                                                                                                                  |
| <p><strong>SerendipityMetric()</strong><br><br>Calculates serendipity at <code>k</code>: how unusual the relevant recommendations are in top-K, averaged by all users.<br><br>Requires a training dataset.</p>                                                                | <p><strong>Required</strong>:</p><ul><li><code>k</code></li><li><code>item\_features: List</code></li></ul><p><strong>Optional</strong>:</p><ul><li><code>min\_rel\_score</code></li></ul>                                                             |
| <p><strong>PersonalizationMetric()</strong><br><br>Measures the average uniqueness of each user's top-K recommendations.<br><br></p>                                                                                                                                          | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul>                                                                                                                                  |
| <p><strong>PopularityBias()</strong><br><br>Evaluates the popularity bias in recommendations by computing ARP (average recommendation popularity), Gini index, and coverage.<br><br>Requires a training dataset.</p>                                                          | <p><strong>Required</strong>:</p><ul><li><code>K</code></li><li><code>normalize\_arp (default: False)</code> - whether to normalize ARP calculation by the most popular item in training</li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul> |
| <p><strong>ItemBiasMetric()</strong><br><br>Visualizes the distribution of recommendations by a chosen dimension (column), сomparative to its distribution in the training set.<br><br>Requires a training dataset.</p>                                                       | <p><strong>Required</strong>:</p><ul><li><code>k</code></li><li><code>column\_name</code></li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul>                                                                                                |
| <p><strong>UserBiasMetric()</strong><br><br>Visualizes the distribution of the chosen category (e.g. user characteristic), comparative to its distribution in the training dataset.<br><br>Requires a training dataset.</p>                                                   | <p><strong>Required</strong>:</p><ul><li><code>k</code></li><li><code>column\_name</code></li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul>                                                                                                |
| <p><strong>ScoreDistribution()</strong><br><br>Computes the predicted score entropy. Visualizes the distribution of the scores at <code>k</code> (and all scores, if available).<br><br>Applies only when the <code>recommendations\_type</code> is a <code>score</code>.</p> | <p><strong>Required</strong>:</p><ul><li><code>k</code></li></ul><p><strong>Optional</strong>:</p><ul><li>-</li></ul>                                                                                                                                  |
| <p><strong>RecCasesTable()</strong><br><br>Shows the list of recommendations for specific user IDs (or 5 random if not specified).</p>                                                                                                                                        | <p><strong>Required</strong>:</p><ul><li>-</li></ul><p><strong>Optional</strong>:</p><ul><li><code>display\_features: List</code></li><li><code>user\_ids: List</code></li><li><code>train\_item\_num: int</code></li></ul>                            |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-old.evidentlyai.com/reference/all-metrics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
