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

# METRICS

`METRICS(X)`: This function displays performance metrics for
trained ML models. For classification tasks, these metrics are
accuracy, logloss, and AUC. For regressions tasks, these metrics are
MAE, MSE, RMSE, and R-Squared.

This is a table-valued function (TVF). It should be used in a `FROM`
clause. The argument for this function should be either the name of the
trained model or a string literal. String literal arguments support wildcards,
enabling this function to display the metrics for multiple ML models in one table.

### Syntax

```sql
SELECT <COLUMNS> FROM METRICS(<MODEL> | <STRING>);
```

### Args

<ParamField query="X" type="model or str (literal)">
  The name of the trained model for which to retrieve metrics.
  If `X` is a string literal, then wildcards may be used.
  In that case, the metrics for all matching model names
  are displayed in the table.
</ParamField>

### Examples

```sql
CREATE MODEL my_model AS SELECT * FROM train_data;
SELECT * FROM METRICS(my_model);
```

```sql
-- Fetch metrics for multiple models with a wildcard
CREATE MODEL my_model_v1 AS SELECT * FROM train_data_1;
CREATE MODEL my_model_v2 AS SELECT * FROM train_data_2;
SELECT * FROM METRICS('my_model_v*');
```
