Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit b769264

Browse files
feat: add ImportModelEvaluation in aiplatform v1 model_service.proto (#280)
- [ ] Regenerate this pull request now. feat: add data_item_schema_uri, annotation_schema_uri, explanation_specs to ModelEvaluationExplanationSpec in aiplatform v1 model_evaluation.proto feat: add ImportModelEvaluation in aiplatform v1beta1 model_service.proto PiperOrigin-RevId: 436869915 Source-Link: googleapis/googleapis@9ba488b Source-Link: https://github.com/googleapis/googleapis-gen/commit/908e7f896f876da6a4d05cd0cc4f8eb19c3cc7a9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTA4ZTdmODk2Zjg3NmRhNmE0ZDA1Y2QwY2M0ZjhlYjE5YzNjYzdhOSJ9
1 parent 0fb9efb commit b769264

19 files changed

+2081
-54
lines changed

protos/google/cloud/aiplatform/v1/model_evaluation.proto

+47-8
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,70 @@ message ModelEvaluation {
3838
pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}"
3939
};
4040

41+
message ModelEvaluationExplanationSpec {
42+
// Explanation type.
43+
//
44+
// For AutoML Image Classification models, possible values are:
45+
//
46+
// * `image-integrated-gradients`
47+
// * `image-xrai`
48+
string explanation_type = 1;
49+
50+
// Explanation spec details.
51+
ExplanationSpec explanation_spec = 2;
52+
}
53+
4154
// Output only. The resource name of the ModelEvaluation.
4255
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
4356

44-
// Output only. Points to a YAML file stored on Google Cloud Storage describing the
57+
// Points to a YAML file stored on Google Cloud Storage describing the
4558
// [metrics][google.cloud.aiplatform.v1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is
4659
// defined as an OpenAPI 3.0.2 [Schema
4760
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
48-
string metrics_schema_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
61+
string metrics_schema_uri = 2;
4962

50-
// Output only. Evaluation metrics of the Model. The schema of the metrics is stored in
63+
// Evaluation metrics of the Model. The schema of the metrics is stored in
5164
// [metrics_schema_uri][google.cloud.aiplatform.v1.ModelEvaluation.metrics_schema_uri]
52-
google.protobuf.Value metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
65+
google.protobuf.Value metrics = 3;
5366

5467
// Output only. Timestamp when this ModelEvaluation was created.
5568
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
5669

57-
// Output only. All possible [dimensions][ModelEvaluationSlice.slice.dimension] of
70+
// All possible [dimensions][ModelEvaluationSlice.slice.dimension] of
5871
// ModelEvaluationSlices. The dimensions can be used as the filter of the
5972
// [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] request, in the form of
6073
// `slice.dimension = <dimension>`.
61-
repeated string slice_dimensions = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
74+
repeated string slice_dimensions = 5;
75+
76+
// Points to a YAML file stored on Google Cloud Storage describing
77+
// [EvaluatedDataItemView.data_item_payload][] and
78+
// [EvaluatedAnnotation.data_item_payload][]. The schema is defined as an
79+
// OpenAPI 3.0.2 [Schema
80+
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
81+
//
82+
// This field is not populated if there are neither EvaluatedDataItemViews nor
83+
// EvaluatedAnnotations under this ModelEvaluation.
84+
string data_item_schema_uri = 6;
6285

63-
// Output only. Aggregated explanation metrics for the Model's prediction output over the
86+
// Points to a YAML file stored on Google Cloud Storage describing
87+
// [EvaluatedDataItemView.predictions][],
88+
// [EvaluatedDataItemView.ground_truths][],
89+
// [EvaluatedAnnotation.predictions][], and
90+
// [EvaluatedAnnotation.ground_truths][]. The schema is defined as an
91+
// OpenAPI 3.0.2 [Schema
92+
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
93+
//
94+
// This field is not populated if there are neither EvaluatedDataItemViews nor
95+
// EvaluatedAnnotations under this ModelEvaluation.
96+
string annotation_schema_uri = 7;
97+
98+
// Aggregated explanation metrics for the Model's prediction output over the
6499
// data this ModelEvaluation uses. This field is populated only if the Model
65100
// is evaluated with explanations, and only for AutoML tabular Models.
66101
//
67-
ModelExplanation model_explanation = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
102+
ModelExplanation model_explanation = 8;
103+
104+
// Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] that are used for explaining
105+
// the predicted values on the evaluated data.
106+
repeated ModelEvaluationExplanationSpec explanation_specs = 9;
68107
}

protos/google/cloud/aiplatform/v1/model_service.proto

+24
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ service ModelService {
110110
};
111111
}
112112

113+
// Imports an externally generated ModelEvaluation.
114+
rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) {
115+
option (google.api.http) = {
116+
post: "/v1/{parent=projects/*/locations/*/models/*}/evaluations:import"
117+
body: "*"
118+
};
119+
option (google.api.method_signature) = "parent,model_evaluation";
120+
}
121+
113122
// Gets a ModelEvaluation.
114123
rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) {
115124
option (google.api.http) = {
@@ -334,6 +343,21 @@ message ExportModelResponse {
334343

335344
}
336345

346+
// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1.ModelService.ImportModelEvaluation]
347+
message ImportModelEvaluationRequest {
348+
// Required. The name of the parent model resource.
349+
// Format: `projects/{project}/locations/{location}/models/{model}`
350+
string parent = 1 [
351+
(google.api.field_behavior) = REQUIRED,
352+
(google.api.resource_reference) = {
353+
type: "aiplatform.googleapis.com/Model"
354+
}
355+
];
356+
357+
// Required. Model evaluation resource to be imported.
358+
ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED];
359+
}
360+
337361
// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1.ModelService.GetModelEvaluation].
338362
message GetModelEvaluationRequest {
339363
// Required. The name of the ModelEvaluation resource.

protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto

+10-10
Original file line numberDiff line numberDiff line change
@@ -55,32 +55,32 @@ message ModelEvaluation {
5555
// Output only. The resource name of the ModelEvaluation.
5656
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
5757

58-
// Output only. Points to a YAML file stored on Google Cloud Storage describing the
58+
// Points to a YAML file stored on Google Cloud Storage describing the
5959
// [metrics][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics] of this ModelEvaluation. The schema is
6060
// defined as an OpenAPI 3.0.2 [Schema
6161
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
62-
string metrics_schema_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
62+
string metrics_schema_uri = 2;
6363

64-
// Output only. Evaluation metrics of the Model. The schema of the metrics is stored in
64+
// Evaluation metrics of the Model. The schema of the metrics is stored in
6565
// [metrics_schema_uri][google.cloud.aiplatform.v1beta1.ModelEvaluation.metrics_schema_uri]
66-
google.protobuf.Value metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
66+
google.protobuf.Value metrics = 3;
6767

6868
// Output only. Timestamp when this ModelEvaluation was created.
6969
google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
7070

71-
// Output only. All possible [dimensions][ModelEvaluationSlice.slice.dimension] of
71+
// All possible [dimensions][ModelEvaluationSlice.slice.dimension] of
7272
// ModelEvaluationSlices. The dimensions can be used as the filter of the
7373
// [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1beta1.ModelService.ListModelEvaluationSlices] request, in the form of
7474
// `slice.dimension = <dimension>`.
75-
repeated string slice_dimensions = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
75+
repeated string slice_dimensions = 5;
7676

77-
// Output only. Aggregated explanation metrics for the Model's prediction output over the
77+
// Aggregated explanation metrics for the Model's prediction output over the
7878
// data this ModelEvaluation uses. This field is populated only if the Model
7979
// is evaluated with explanations, and only for AutoML tabular Models.
8080
//
81-
ModelExplanation model_explanation = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
81+
ModelExplanation model_explanation = 8;
8282

83-
// Output only. Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining
83+
// Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining
8484
// the predicted values on the evaluated data.
85-
repeated ModelEvaluationExplanationSpec explanation_specs = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
85+
repeated ModelEvaluationExplanationSpec explanation_specs = 9;
8686
}

protos/google/cloud/aiplatform/v1beta1/model_service.proto

+24
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ service ModelService {
113113
};
114114
}
115115

116+
// Imports an externally generated ModelEvaluation.
117+
rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) {
118+
option (google.api.http) = {
119+
post: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations:import"
120+
body: "*"
121+
};
122+
option (google.api.method_signature) = "parent,model_evaluation";
123+
}
124+
116125
// Gets a ModelEvaluation.
117126
rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) {
118127
option (google.api.http) = {
@@ -327,6 +336,21 @@ message ExportModelResponse {
327336

328337
}
329338

339+
// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.ImportModelEvaluation]
340+
message ImportModelEvaluationRequest {
341+
// Required. The name of the parent model resource.
342+
// Format: `projects/{project}/locations/{location}/models/{model}`
343+
string parent = 1 [
344+
(google.api.field_behavior) = REQUIRED,
345+
(google.api.resource_reference) = {
346+
type: "aiplatform.googleapis.com/Model"
347+
}
348+
];
349+
350+
// Required. Model evaluation resource to be imported.
351+
ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED];
352+
}
353+
330354
// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluation].
331355
message GetModelEvaluationRequest {
332356
// Required. The name of the ModelEvaluation resource.

0 commit comments

Comments
 (0)