Searches Model Monitoring Statistics generated within a given time window.
HTTP request
POST https://{service-endpoint}/v1/{modelDeploymentMonitoringJob}:searchModelDeploymentMonitoringStatsAnomalies
Where {service-endpoint}
is one of the supported service endpoints.
Path parameters
Parameters | |
---|---|
modelDeploymentMonitoringJob |
Required. ModelDeploymentMonitoring Job resource name. Format: `projects/{project}/locations/{location}/modelDeploymentMonitoringJobs/{modelDeploymentMonitoringJob} |
Request body
The request body contains data with the following structure:
JSON representation | |
---|---|
{
"deployedModelId": string,
"featureDisplayName": string,
"objectives": [
{
object ( |
Fields | |
---|---|
deployedModelId |
Required. The DeployedModel ID of the [ModelDeploymentMonitoringObjectiveConfig.deployed_model_id]. |
featureDisplayName |
The feature display name. If specified, only return the stats belonging to this feature. Format: |
objectives[] |
Required. Objectives of the stats to retrieve. |
pageSize |
The standard list page size. |
pageToken |
A page token received from a previous |
startTime |
The earliest timestamp of stats being generated. If not set, indicates fetching stats till the earliest possible one. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
endTime |
The latest timestamp of stats being generated. If not set, indicates feching stats till the latest possible one. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
Response body
If successful, the response body contains data with the following structure:
Response message for JobService.SearchModelDeploymentMonitoringStatsAnomalies
.
JSON representation | |
---|---|
{
"monitoringStats": [
{
object ( |
Fields | |
---|---|
monitoringStats[] |
Stats retrieved for requested objectives. There are at most 1000 |
nextPageToken |
The page token that can be used by the next |
Authorization Scopes
Requires the following OAuth scope:
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the modelDeploymentMonitoringJob
resource:
aiplatform.modelDeploymentMonitoringJobs.searchStatsAnomalies
For more information, see the IAM documentation.
StatsAnomaliesObjective
Stats requested for specific objective.
JSON representation | |
---|---|
{
"type": enum ( |
Fields | |
---|---|
type |
|
topFeatureCount |
If set, all attribution scores between |
ModelDeploymentMonitoringObjectiveType
The Model Monitoring Objective types.
Enums | |
---|---|
MODEL_DEPLOYMENT_MONITORING_OBJECTIVE_TYPE_UNSPECIFIED |
Default value, should not be set. |
RAW_FEATURE_SKEW |
Raw feature values' stats to detect skew between Training-Prediction datasets. |
RAW_FEATURE_DRIFT |
Raw feature values' stats to detect drift between Serving-Prediction datasets. |
FEATURE_ATTRIBUTION_SKEW |
Feature attribution scores to detect skew between Training-Prediction datasets. |
FEATURE_ATTRIBUTION_DRIFT |
Feature attribution scores to detect skew between Prediction datasets collected within different time windows. |
ModelMonitoringStatsAnomalies
Statistics and anomalies generated by Model Monitoring.
JSON representation | |
---|---|
{ "objective": enum ( |
Fields | |
---|---|
objective |
Model Monitoring Objective those stats and anomalies belonging to. |
deployedModelId |
Deployed Model ID. |
anomalyCount |
Number of anomalies within all stats. |
featureStats[] |
A list of historical Stats and Anomalies generated for all Features. |
FeatureHistoricStatsAnomalies
Historical Stats (and Anomalies) for a specific Feature.
JSON representation | |
---|---|
{ "featureDisplayName": string, "threshold": { object ( |
Fields | |
---|---|
featureDisplayName |
Display Name of the Feature. |
threshold |
Threshold for anomaly detection. |
trainingStats |
Stats calculated for the Training Dataset. |
predictionStats[] |
A list of historical stats generated by different time window's Prediction Dataset. |
FeatureStatsAnomaly
Stats and Anomaly generated at specific timestamp for specific Feature. The startTime and endTime are used to define the time range of the dataset that current stats belongs to, e.g. prediction traffic is bucketed into prediction datasets by time window. If the Dataset is not defined by time window, startTime = endTime. Timestamp of the stats and anomalies always refers to endTime. Raw stats and anomalies are stored in statsUri or anomalyUri in the tensorflow defined protos. Field dataStats contains almost identical information with the raw stats in Vertex AI defined proto, for UI to display.
JSON representation | |
---|---|
{ "score": number, "statsUri": string, "anomalyUri": string, "distributionDeviation": number, "anomalyDetectionThreshold": number, "startTime": string, "endTime": string } |
Fields | |
---|---|
score |
Feature importance score, only populated when cross-feature monitoring is enabled. For now only used to represent feature attribution score within range [0, 1] for |
statsUri |
Path of the stats file for current feature values in Cloud Storage bucket. Format: gs:// |
anomalyUri |
Path of the anomaly file for current feature values in Cloud Storage bucket. Format: gs:// |
distributionDeviation |
Deviation from the current stats to baseline stats. 1. For categorical feature, the distribution distance is calculated by L-inifinity norm. 2. For numerical feature, the distribution distance is calculated by Jensen–Shannon divergence. |
anomalyDetectionThreshold |
This is the threshold used when detecting anomalies. The threshold can be changed by user, so this one might be different from |
startTime |
The start timestamp of window where stats were generated. For objectives where time window doesn't make sense (e.g. Featurestore Snapshot Monitoring), startTime is only used to indicate the monitoring intervals, so it always equals to (endTime - monitoringInterval). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
endTime |
The end timestamp of window where stats were generated. For objectives where time window doesn't make sense (e.g. Featurestore Snapshot Monitoring), endTime indicates the timestamp of the data used to generate stats (e.g. timestamp we take snapshots for feature values). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |