- Categories:
MODEL_MONITOR_DRIFT_METRIC¶
Gets drift metrics from a model monitor. Each model monitor monitors one machine learning model.
- See also:
Querying monitoring results for more information.
Syntax¶
MODEL_MONITOR_DRIFT_METRIC(
<model_monitor_name>, <drift_metric_name>, <column_name>
[ , <granularity> [ , <start_time> [ , <end_time> ] ] ]
)
Arguments¶
Required:
model_monitor_name
Name 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.
drift_metric_name
Name of the metric.
Valid values:
'JENSEN_SHANNON'
'DIFFERENCE_OF_MEANS'
'WASSERSTEIN'
column_name
Name of the column used to compute drift.
Valid values: Any string that exists as a feature column, prediction column, or actual column in the model monitor.
Optional:
granularity
Granularity of the time range being queried.
Valid values:
'<num> DAY'
'<num> WEEK'
'<num> MONTH'
'<num> QUARTER'
'<num> YEAR'
'ALL'
NULL
start_time
Start of the time range used to compute the metric.
Valid values: A constant timestream expression or
NULL
.end_time
End of the time range used to compute the metric.
Valid values: A constant timestream expression or
NULL
.
Returns¶
Column |
Description |
Example values |
---|---|---|
|
Timestamp at the start of the time range. |
|
|
Value of the metric within the specified time range. |
|
|
Number of records used to compute the metric. |
|
|
Number of records excluded from the metric computation. |
|
|
Number of records used to compute the metric. |
|
|
Number of records excluded from the metric computation. |
|
|
Name of the drift metric that has been computed. |
|
|
Name of the column for which the drift metric has been computed. |
|
Usage Notes¶
The model monitor must have a baseline set for the drift metric to be computed.
You might run into errors if you:
Don’t set a baseline for the model monitor.
Requested a numerical drift metric for a non-numeric feature.
Use a drift metric that doesn’t exist in the model monitor.
Examples¶
The following example gets the differences of means drift metric for MY_MONITOR
over a one-day period:
SELECT * FROM TABLE(MODEL_MONITOR_DRIFT_METRIC(
'MY_MONITOR', 'DIFFERENCE_OF_MEANS', 'MODEL_PREDICTION', '1 DAY', TO_TIMESTAMP_TZ('2024-01-01'), TO_TIMESTAMP_TZ('2024-01-02'))
)