Method: projects.locations.modelMonitors.searchModelMonitoringStats

Searches Model Monitoring Stats generated within a given time window.

Endpoint

post https://{endpoint}/v1beta1/{modelMonitor}:searchModelMonitoringStats

Where {service-endpoint} is one of the supported service endpoints.

Path parameters

modelMonitor string

Required. ModelMonitor resource name. Format: projects/{project}/locations/{location}/modelMonitors/{modelMonitor}

Request body

The request body contains data with the following structure:

Fields
statsFilter object (SearchModelMonitoringStatsFilter)

Filter for search different stats.

timeInterval object (Interval)

The time interval for which results should be returned.

pageSize integer

The standard list page size.

pageToken string

A page token received from a previous ModelMonitoringService.SearchModelMonitoringStats call.

Response body

Response message for ModelMonitoringService.SearchModelMonitoringStats.

If successful, the response body contains data with the following structure:

Fields
monitoringStats[] object (ModelMonitoringStats)

Stats retrieved for requested objectives.

nextPageToken string

The page token that can be used by the next ModelMonitoringService.SearchModelMonitoringStats call.

JSON representation
{
  "monitoringStats": [
    {
      object (ModelMonitoringStats)
    }
  ],
  "nextPageToken": string
}

SearchModelMonitoringStatsFilter

Filter for searching ModelMonitoringStats.

Fields

Union field filter.

filter can be only one of the following:

tabularStatsFilter object (TabularStatsFilter)

Tabular statistics filter.

JSON representation
{

  // Union field filter can be only one of the following:
  "tabularStatsFilter": {
    object (TabularStatsFilter)
  }
  // End of list of possible types for union field filter.
}

TabularStatsFilter

Tabular statistics filter.

Fields
statsName string

If not specified, will return all the stats_names.

objectiveType string

One of the supported monitoring objectives: raw-feature-drift prediction-output-drift feature-attribution

modelMonitoringJob string

From a particular monitoring job.

modelMonitoringSchedule string

From a particular monitoring schedule.

algorithm string

Specify the algorithm type used for distance calculation, eg: jensen_shannon_divergence, l_infinity.

JSON representation
{
  "statsName": string,
  "objectiveType": string,
  "modelMonitoringJob": string,
  "modelMonitoringSchedule": string,
  "algorithm": string
}

ModelMonitoringStats

Represents the collection of statistics for a metric.

Fields

Union field stats.

stats can be only one of the following:

tabularStats object (ModelMonitoringTabularStats)

Generated tabular statistics.

JSON representation
{

  // Union field stats can be only one of the following:
  "tabularStats": {
    object (ModelMonitoringTabularStats)
  }
  // End of list of possible types for union field stats.
}

ModelMonitoringTabularStats

A collection of data points that describes the time-varying values of a tabular metric.

Fields
statsName string

The stats name.

objectiveType string

One of the supported monitoring objectives: raw-feature-drift prediction-output-drift feature-attribution

dataPoints[] object (ModelMonitoringStatsDataPoint)

The data points of this time series. When listing time series, points are returned in reverse time order.

JSON representation
{
  "statsName": string,
  "objectiveType": string,
  "dataPoints": [
    {
      object (ModelMonitoringStatsDataPoint)
    }
  ]
}

ModelMonitoringStatsDataPoint

Represents a single statistics data point.

Fields
currentStats object (TypedValue)

Statistics from current dataset.

baselineStats object (TypedValue)

Statistics from baseline dataset.

thresholdValue number

Threshold value.

hasAnomaly boolean

Indicate if the statistics has anomaly.

modelMonitoringJob string

Model monitoring job resource name.

schedule string

Schedule resource name.

createTime string (Timestamp format)

Statistics create time.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

algorithm string

algorithm used to calculated the metrics, eg: jensen_shannon_divergence, l_infinity.

JSON representation
{
  "currentStats": {
    object (TypedValue)
  },
  "baselineStats": {
    object (TypedValue)
  },
  "thresholdValue": number,
  "hasAnomaly": boolean,
  "modelMonitoringJob": string,
  "schedule": string,
  "createTime": string,
  "algorithm": string
}

TypedValue

Typed value of the statistics.

Fields
Union field value. The typed value. value can be only one of the following:
doubleValue number

Double.

distributionValue object (DistributionDataValue)

Distribution.

JSON representation
{

  // Union field value can be only one of the following:
  "doubleValue": number,
  "distributionValue": {
    object (DistributionDataValue)
  }
  // End of list of possible types for union field value.
}

DistributionDataValue

Summary statistics for a population of values.

Fields
distribution value (Value format)

Predictive monitoring drift distribution in tensorflow.metadata.v0.DatasetFeatureStatistics format.

distributionDeviation number

Distribution distance deviation from the current dataset's statistics to baseline dataset's statistics. * For categorical feature, the distribution distance is calculated by L-inifinity norm or Jensen–Shannon divergence. * For numerical feature, the distribution distance is calculated by Jensen–Shannon divergence.

JSON representation
{
  "distribution": value,
  "distributionDeviation": number
}