- Categories:
MODEL_ MONITOR_ STAT_ METRIC¶
Gets count metrics from a model monitor. Each model monitor monitors one machine learning model.
- See also:
Querying monitoring results for more information.
语法
实参
必填:
MODEL_MONITOR_NAME用于计算指标的模型监视器名称。
有效值:
模型监视器名称字符串。它可以是一个简单或完全限定的名称。
METRIC_NAME指标的名称。
有效值:
'COUNT''COUNT_NULL'
COLUMN_NAME用于计算计数的列名称。
有效值:
作为模型监视器中的特征列、预测列或实际列存在的任何字符串。
可选:
GRANULARITYGranularity of the time range being queried. The default value is 1 DAY.
有效值:
'<num> DAY''<num> WEEK''<num> MONTH''<num> QUARTER''<num> YEAR''ALL'NULL
START_TIME用于计算指标的时间范围的起始点。默认值为当前时间前 60 天,每次调用该函数时都会计算。
有效值:
A timestamp expression or
NULL.END_TIME用于计算指标的时间范围的终点。默认值是当前时间,每次调用该函数时都会计算。
有效值:
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 |
|---|---|
EVENT_TIMESTAMP | Timestamp at the start of the time range. |
METRIC_VALUE | Value of the metric within the specified time range. |
METRIC_NAME | Name of the metric that has been computed. |
COLUMN_NAME | Name of the column for which the stat metric has been computed. |
SEGMENT_COLUMN | Name of the segment column for which the metric is computed (or NULL for non-segment queries). |
SEGMENT_VALUE | Segment value for which the metric is computed (or NULL for non-segment queries). |
使用说明
模型监视器必须具有用于计算指标的列。
If the 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. For example, '"<example_model_monitor_name>"'.
If double-quotes are not provided in these two fields, the column_name or model_monitor_name are 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 count metric for MY_MONITOR over the last 30 days: