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/api/field_behavior.proto"; 20import "google/api/resource.proto"; 21import "google/cloud/aiplatform/v1beta1/explanation.proto"; 22import "google/cloud/aiplatform/v1beta1/model_evaluation_slice.proto"; 23import "google/protobuf/struct.proto"; 24import "google/protobuf/timestamp.proto"; 25 26option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 27option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 28option java_multiple_files = true; 29option java_outer_classname = "ModelEvaluationProto"; 30option java_package = "com.google.cloud.aiplatform.v1beta1"; 31option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 32option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 33 34// A collection of metrics calculated by comparing Model's predictions on all of 35// the test data against annotations from the test data. 36message ModelEvaluation { 37 option (google.api.resource) = { 38 type: "aiplatform.googleapis.com/ModelEvaluation" 39 pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}" 40 }; 41 42 message ModelEvaluationExplanationSpec { 43 // Explanation type. 44 // 45 // For AutoML Image Classification models, possible values are: 46 // 47 // * `image-integrated-gradients` 48 // * `image-xrai` 49 string explanation_type = 1; 50 51 // Explanation spec details. 52 ExplanationSpec explanation_spec = 2; 53 } 54 55 // Configuration for bias detection. 56 message BiasConfig { 57 // Specification for how the data should be sliced for bias. It contains a 58 // list of slices, with limitation of two slices. The first slice of data 59 // will be the slice_a. The second slice in the list (slice_b) will be 60 // compared against the first slice. If only a single slice is provided, 61 // then slice_a will be compared against "not slice_a". 62 // Below are examples with feature "education" with value "low", "medium", 63 // "high" in the dataset: 64 // 65 // Example 1: 66 // 67 // bias_slices = [{'education': 'low'}] 68 // 69 // A single slice provided. In this case, slice_a is the collection of data 70 // with 'education' equals 'low', and slice_b is the collection of data with 71 // 'education' equals 'medium' or 'high'. 72 // 73 // Example 2: 74 // 75 // bias_slices = [{'education': 'low'}, 76 // {'education': 'high'}] 77 // 78 // Two slices provided. In this case, slice_a is the collection of data 79 // with 'education' equals 'low', and slice_b is the collection of data with 80 // 'education' equals 'high'. 81 ModelEvaluationSlice.Slice.SliceSpec bias_slices = 1; 82 83 // Positive labels selection on the target field. 84 repeated string labels = 2; 85 } 86 87 // Output only. The resource name of the ModelEvaluation. 88 string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; 89 90 // The display name of the ModelEvaluation. 91 string display_name = 10; 92 93 // Points to a YAML file stored on Google Cloud Storage describing the 94 // [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics] of this 95 // ModelEvaluation. The schema is defined as an OpenAPI 3.0.2 [Schema 96 // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). 97 string metrics_schema_uri = 2; 98 99 // Evaluation metrics of the Model. The schema of the metrics is stored in 100 // [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics_schema_uri] 101 google.protobuf.Value metrics = 3; 102 103 // Output only. Timestamp when this ModelEvaluation was created. 104 google.protobuf.Timestamp create_time = 4 105 [(google.api.field_behavior) = OUTPUT_ONLY]; 106 107 // All possible 108 // [dimensions][google.cloud.aiplatform.v1beta1.ModelEvaluationSlice.Slice.dimension] 109 // of ModelEvaluationSlices. The dimensions can be used as the filter of the 110 // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] 111 // request, in the form of `slice.dimension = <dimension>`. 112 repeated string slice_dimensions = 5; 113 114 // Aggregated explanation metrics for the Model's prediction output over the 115 // data this ModelEvaluation uses. This field is populated only if the Model 116 // is evaluated with explanations, and only for AutoML tabular Models. 117 // 118 ModelExplanation model_explanation = 8; 119 120 // Describes the values of 121 // [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are 122 // used for explaining the predicted values on the evaluated data. 123 repeated ModelEvaluationExplanationSpec explanation_specs = 9; 124 125 // The metadata of the ModelEvaluation. 126 // For the ModelEvaluation uploaded from Managed Pipeline, metadata contains a 127 // structured value with keys of "pipeline_job_id", "evaluation_dataset_type", 128 // "evaluation_dataset_path", "row_based_metrics_path". 129 google.protobuf.Value metadata = 11; 130 131 // Specify the configuration for bias detection. 132 BiasConfig bias_configs = 12; 133} 134