feature_monitoring_stats.proto 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.aiplatform.v1beta1;
  16. import "google/protobuf/timestamp.proto";
  17. option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
  18. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform";
  19. option java_multiple_files = true;
  20. option java_outer_classname = "FeatureMonitoringStatsProto";
  21. option java_package = "com.google.cloud.aiplatform.v1beta1";
  22. option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
  23. option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
  24. // Stats and Anomaly generated at specific timestamp for specific Feature.
  25. // The start_time and end_time are used to define the time range of the dataset
  26. // that current stats belongs to, e.g. prediction traffic is bucketed into
  27. // prediction datasets by time window. If the Dataset is not defined by time
  28. // window, start_time = end_time. Timestamp of the stats and anomalies always
  29. // refers to end_time. Raw stats and anomalies are stored in stats_uri or
  30. // anomaly_uri in the tensorflow defined protos. Field data_stats contains
  31. // almost identical information with the raw stats in Vertex AI
  32. // defined proto, for UI to display.
  33. message FeatureStatsAnomaly {
  34. // Feature importance score, only populated when cross-feature monitoring is
  35. // enabled. For now only used to represent feature attribution score within
  36. // range [0, 1] for
  37. // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_SKEW] and
  38. // [ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT][google.cloud.aiplatform.v1beta1.ModelDeploymentMonitoringObjectiveType.FEATURE_ATTRIBUTION_DRIFT].
  39. double score = 1;
  40. // Path of the stats file for current feature values in Cloud Storage bucket.
  41. // Format: gs://<bucket_name>/<object_name>/stats.
  42. // Example: gs://monitoring_bucket/feature_name/stats.
  43. // Stats are stored as binary format with Protobuf message
  44. // [tensorflow.metadata.v0.FeatureNameStatistics](https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/statistics.proto).
  45. string stats_uri = 3;
  46. // Path of the anomaly file for current feature values in Cloud Storage
  47. // bucket.
  48. // Format: gs://<bucket_name>/<object_name>/anomalies.
  49. // Example: gs://monitoring_bucket/feature_name/anomalies.
  50. // Stats are stored as binary format with Protobuf message
  51. // Anoamlies are stored as binary format with Protobuf message
  52. // [tensorflow.metadata.v0.AnomalyInfo]
  53. // (https://github.com/tensorflow/metadata/blob/master/tensorflow_metadata/proto/v0/anomalies.proto).
  54. string anomaly_uri = 4;
  55. // Deviation from the current stats to baseline stats.
  56. // 1. For categorical feature, the distribution distance is calculated by
  57. // L-inifinity norm.
  58. // 2. For numerical feature, the distribution distance is calculated by
  59. // Jensen–Shannon divergence.
  60. double distribution_deviation = 5;
  61. // This is the threshold used when detecting anomalies.
  62. // The threshold can be changed by user, so this one might be different from
  63. // [ThresholdConfig.value][google.cloud.aiplatform.v1beta1.ThresholdConfig.value].
  64. double anomaly_detection_threshold = 9;
  65. // The start timestamp of window where stats were generated.
  66. // For objectives where time window doesn't make sense (e.g. Featurestore
  67. // Snapshot Monitoring), start_time is only used to indicate the monitoring
  68. // intervals, so it always equals to (end_time - monitoring_interval).
  69. google.protobuf.Timestamp start_time = 7;
  70. // The end timestamp of window where stats were generated.
  71. // For objectives where time window doesn't make sense (e.g. Featurestore
  72. // Snapshot Monitoring), end_time indicates the timestamp of the data used to
  73. // generate stats (e.g. timestamp we take snapshots for feature values).
  74. google.protobuf.Timestamp end_time = 8;
  75. }