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

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

Args

X
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.

Examples

CREATE MODEL my_model AS SELECT * FROM train_data;
SELECT * FROM METRICS(my_model);
-- 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*');