MODEL_MONITOR_PERFORMANCE_METRIC

functionsupportedAI & ML

docs.snowflake.com ↗

Model monitor functions

Gets performance metrics from a model monitor. Each model monitor monitors one machine learning model. See ML Observability for model version monitors and Gateway Monitoring & A/B Testing for gateway model monitors.

Syntax

supportedpartialnot supportednot scored

MODEL_MONITOR_PERFORMANCE_METRIC(<model_monitor_name>, <performance_metric_name>,
    [, <granularity> [, <start_time> [, <end_time> [, <extra_args> ] ] ] ] )
MODEL_MONITOR_PERFORMANCE_METRIC(
  <model_monitor_name>, <performance_metric_name>
  [, <granularity> [, <start_time> [, <end_time> ] ] ],
  SERVICE => <service_name>
)

Parameters

NameRequiredDescription
model_monitor_namerequiredName of the model monitor used to compute the metric. Valid values: A string that’s the name of the model monitor. It can be a simple or fully qualified name.
performance_metric_namerequiredName of the performance metric. Valid values if the model monitor is attached to a regression model: 'RMSE' 'MAE' 'MAPE' 'MSE' Valid values if the model monitor is attached to a binary classification model: 'ROC_AUC' 'CLASSIFICATION_ACCURACY' 'PRECISION' 'RECALL' 'F1_SCORE' Valid values if the model monitor is attached to a multi-class classification model: 'CLASSIFICATION_ACCURACY' 'MACRO_AVERAGE_PRECISION' 'MACRO_AVERAGE_RECALL' 'MICRO_AVERAGE_PRECISION' 'MICRO_AVERAGE_RECALL'
SERVICE => service_namerequiredName of the inference service whose performance metrics you are measuring. Valid values: A simple or fully qualified inference service identifier.
granularityoptionalGranularity of the time range being queried. Default value is 1 DAY for model version monitors and AGGREGATION_WINDOW for gateway model monitors. Valid values: '<num> HOUR' (valid for gateway model monitors only) '<num> DAY' '<num> WEEK' '<num> MONTH' '<num> QUARTER' '<num> YEAR' 'ALL' NULL
start_timeoptionalStart of the time range used to compute the metric. The default value is 60 days before the current time for model version monitors, and 1 day before the current time for gateway model monitors. The default value is calculated each time you call the function. Valid values: A timestamp expression or NULL.
end_timeoptionalEnd of the time range used to compute the metric. The default value is the current time, and is calculated each time you call the function. Valid values: A timestamp expression or NULL.
extra_argsoptionalAdditional arguments for segment-specific queries. This parameter is optional: if not provided, the query returns metrics for all data (non-segment query). The segment queries are not supported for gateway model monitors. Valid values: A string in JSON format specifying segment column and value pairs: '{"SEGMENTS": [{"column": "<segment_column_name>", "value": "<segment_value>"}]}' Note Currently, segment queries support only 1 segment column:value pair per query. You cannot query multiple segments simultaneously in a single function call. For more information about segments, see ML Observability: Monitoring model behavior over time.

Usage notes