xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1beta1;
18
19import "google/protobuf/struct.proto";
20import "google/protobuf/timestamp.proto";
21
22option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
23option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
24option java_multiple_files = true;
25option java_outer_classname = "ModelMonitoringStatsProto";
26option java_package = "com.google.cloud.aiplatform.v1beta1";
27option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
28option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
29
30// Represents the collection of statistics for a metric.
31message ModelMonitoringStats {
32  oneof stats {
33    // Generated tabular statistics.
34    ModelMonitoringTabularStats tabular_stats = 1;
35  }
36}
37
38// Represents a single statistics data point.
39message ModelMonitoringStatsDataPoint {
40  // Typed value of the statistics.
41  message TypedValue {
42    // Summary statistics for a population of values.
43    message DistributionDataValue {
44      // tensorflow.metadata.v0.DatasetFeatureStatistics format.
45      google.protobuf.Value distribution = 1;
46
47      // Distribution distance deviation from the current dataset's statistics
48      // to baseline dataset's statistics.
49      //   * For categorical feature, the distribution distance is calculated
50      //     by L-inifinity norm or Jensen–Shannon divergence.
51      //   * For numerical feature, the distribution distance is calculated by
52      //     Jensen–Shannon divergence.
53      double distribution_deviation = 2;
54    }
55
56    // The typed value.
57    oneof value {
58      // Double.
59      double double_value = 1;
60
61      // Distribution.
62      DistributionDataValue distribution_value = 2;
63    }
64  }
65
66  // Statistics from current dataset.
67  TypedValue current_stats = 1;
68
69  // Statistics from baseline dataset.
70  TypedValue baseline_stats = 2;
71
72  // Threshold value.
73  double threshold_value = 3;
74
75  // Indicate if the statistics has anomaly.
76  bool has_anomaly = 4;
77
78  // Model monitoring job resource name.
79  string model_monitoring_job = 5;
80
81  // Schedule resource name.
82  string schedule = 6;
83
84  // Statistics create time.
85  google.protobuf.Timestamp create_time = 7;
86
87  // Algorithm used to calculated the metrics, eg: jensen_shannon_divergence,
88  // l_infinity.
89  string algorithm = 8;
90}
91
92// A collection of data points that describes the time-varying values of a
93// tabular metric.
94message ModelMonitoringTabularStats {
95  // The stats name.
96  string stats_name = 1;
97
98  // One of the supported monitoring objectives:
99  // `raw-feature-drift`
100  // `prediction-output-drift`
101  // `feature-attribution`
102  string objective_type = 2;
103
104  // The data points of this time series. When listing time series, points are
105  // returned in reverse time order.
106  repeated ModelMonitoringStatsDataPoint data_points = 3;
107}
108
109// Filter for searching ModelMonitoringStats.
110message SearchModelMonitoringStatsFilter {
111  // Tabular statistics filter.
112  message TabularStatsFilter {
113    // If not specified, will return all the stats_names.
114    string stats_name = 1;
115
116    // One of the supported monitoring objectives:
117    // `raw-feature-drift`
118    // `prediction-output-drift`
119    // `feature-attribution`
120    string objective_type = 2;
121
122    // From a particular monitoring job.
123    string model_monitoring_job = 3;
124
125    // From a particular monitoring schedule.
126    string model_monitoring_schedule = 4;
127
128    // Specify the algorithm type used for distance calculation, eg:
129    // jensen_shannon_divergence, l_infinity.
130    string algorithm = 5;
131  }
132
133  oneof filter {
134    // Tabular statistics filter.
135    TabularStatsFilter tabular_stats_filter = 1;
136  }
137}
138