- 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.
语法
实参
必填:
model_monitor_name用于计算指标的模型监视器名称。
有效值:模型监视器名称字符串。它可以是一个简单或完全限定的名称。
drift_metric_name指标的名称。
有效值:
'JENSEN_SHANNON''DIFFERENCE_OF_MEANS''WASSERSTEIN''POPULATION_STABILITY_INDEX'
column_name用于计算漂移的列名称。
有效值:作为模型监视器中的特征列、预测列或实际列存在的任何字符串。
可选:
granularityGranularity of the time range being queried. Default value is 1 DAY.
有效值:
'<num> DAY''<num> WEEK''<num> MONTH''<num> QUARTER''<num> YEAR''ALL'NULL
start_time用于计算指标的时间范围的起始点。默认值为当前时间前 60 天,每次调用该函数时都会计算。
Valid values: A timestamp expression or
NULL.end_time用于计算指标的时间范围的终点。默认值是当前时间,每次调用该函数时都会计算。
Valid values: A timestamp expression or
NULL.extra_argsAdditional arguments for segment-specific queries. This parameter is optional - if not provided, the query returns metrics for all data (non-segment query).
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.
返回
| Column | Description | Example values |
|---|---|---|
EVENT_TIMESTAMP | Timestamp at the start of the time range. | 2024-01-01 00:00:00.000 |
METRIC_VALUE | Value of the metric within the specified time range. | 5 |
COL_COUNT_USED | Number of records used to compute the metric. | 100 |
COL_COUNT_UNUSED | Number of records excluded from the metric computation. | 10 |
BASELINE_COL_COUNT_USED | Number of records used to compute the metric. | 10 |
BASELINE_COL_COUNT_UNUSED | Number of records excluded from the metric computation. | 0 |
METRIC_NAME | Name of the drift metric that has been computed. | DIFFERENCE_OF_MEANS |
COLUMN_NAME | Name of the column for which the drift metric has been computed. | FEATURE_NAME |
SEGMENT_COLUMN | Name of the segment column for which the metric is computed (or NULL for non-segment queries). | CUSTOMER_TIER |
SEGMENT_VALUE | Segment value for which the metric is computed (or NULL for non-segment queries). | PREMIUM |
使用说明
要计算漂移指标,模型监视器必须设置一个基线。
如果您执行以下操作,可能会遇到错误:
- 不设置模型监视器基线。
- 请求非数字特征的数值漂移指标。
- 使用模型监视器中不存在的漂移指标。
If values you’ve specified for column_name or model_monitor_name are case-sensitive, or contain special characters or spaces, enclose them in double quotes.
You must enclose the double quotes within single quotes, such as '"<model_monitor_name>"'.
If double-quotes are not provided in these two fields, the column_name or model_monitor_name will be assumed to be case-insensitive.
To minimize potential impact from schema changes, update your queries to explicitly select only the necessary columns instead of using a wildcard (*).
示例
The following example gets the differences of means drift metric for MY_MONITOR over a one-day period:
The following example gets the Jensen-Shannon drift metric for MY_MONITOR over the last 30 days: