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

feat: add ImportModelEvaluation in aiplatform v1 model_service.proto #280

Merged
merged 6 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 47 additions & 8 deletions protos/google/cloud/aiplatform/v1/model_evaluation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,70 @@ message ModelEvaluation {
pattern: "projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}"
};

message ModelEvaluationExplanationSpec {
// Explanation type.
//
// For AutoML Image Classification models, possible values are:
//
// * `image-integrated-gradients`
// * `image-xrai`
string explanation_type = 1;

// Explanation spec details.
ExplanationSpec explanation_spec = 2;
}

// Output only. The resource name of the ModelEvaluation.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

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

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

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

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

// Points to a YAML file stored on Google Cloud Storage describing
// [EvaluatedDataItemView.data_item_payload][] and
// [EvaluatedAnnotation.data_item_payload][]. The schema is defined as an
// OpenAPI 3.0.2 [Schema
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
//
// This field is not populated if there are neither EvaluatedDataItemViews nor
// EvaluatedAnnotations under this ModelEvaluation.
string data_item_schema_uri = 6;

// Output only. Aggregated explanation metrics for the Model's prediction output over the
// Points to a YAML file stored on Google Cloud Storage describing
// [EvaluatedDataItemView.predictions][],
// [EvaluatedDataItemView.ground_truths][],
// [EvaluatedAnnotation.predictions][], and
// [EvaluatedAnnotation.ground_truths][]. The schema is defined as an
// OpenAPI 3.0.2 [Schema
// Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
//
// This field is not populated if there are neither EvaluatedDataItemViews nor
// EvaluatedAnnotations under this ModelEvaluation.
string annotation_schema_uri = 7;

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

// Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1.ExplanationSpec] that are used for explaining
// the predicted values on the evaluated data.
repeated ModelEvaluationExplanationSpec explanation_specs = 9;
}
24 changes: 24 additions & 0 deletions protos/google/cloud/aiplatform/v1/model_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ service ModelService {
};
}

// Imports an externally generated ModelEvaluation.
rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/models/*}/evaluations:import"
body: "*"
};
option (google.api.method_signature) = "parent,model_evaluation";
}

// Gets a ModelEvaluation.
rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) {
option (google.api.http) = {
Expand Down Expand Up @@ -334,6 +343,21 @@ message ExportModelResponse {

}

// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1.ModelService.ImportModelEvaluation]
message ImportModelEvaluationRequest {
// Required. The name of the parent model resource.
// Format: `projects/{project}/locations/{location}/models/{model}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Model"
}
];

// Required. Model evaluation resource to be imported.
ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1.ModelService.GetModelEvaluation].
message GetModelEvaluationRequest {
// Required. The name of the ModelEvaluation resource.
Expand Down
20 changes: 10 additions & 10 deletions protos/google/cloud/aiplatform/v1beta1/model_evaluation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,32 @@ message ModelEvaluation {
// Output only. The resource name of the ModelEvaluation.
string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

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

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

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

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

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

// Output only. Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining
// Describes the values of [ExplanationSpec][google.cloud.aiplatform.v1beta1.ExplanationSpec] that are used for explaining
// the predicted values on the evaluated data.
repeated ModelEvaluationExplanationSpec explanation_specs = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
repeated ModelEvaluationExplanationSpec explanation_specs = 9;
}
24 changes: 24 additions & 0 deletions protos/google/cloud/aiplatform/v1beta1/model_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ service ModelService {
};
}

// Imports an externally generated ModelEvaluation.
rpc ImportModelEvaluation(ImportModelEvaluationRequest) returns (ModelEvaluation) {
option (google.api.http) = {
post: "/v1beta1/{parent=projects/*/locations/*/models/*}/evaluations:import"
body: "*"
};
option (google.api.method_signature) = "parent,model_evaluation";
}

// Gets a ModelEvaluation.
rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) {
option (google.api.http) = {
Expand Down Expand Up @@ -327,6 +336,21 @@ message ExportModelResponse {

}

// Request message for [ModelService.ImportModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.ImportModelEvaluation]
message ImportModelEvaluationRequest {
// Required. The name of the parent model resource.
// Format: `projects/{project}/locations/{location}/models/{model}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "aiplatform.googleapis.com/Model"
}
];

// Required. Model evaluation resource to be imported.
ModelEvaluation model_evaluation = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1beta1.ModelService.GetModelEvaluation].
message GetModelEvaluationRequest {
// Required. The name of the ModelEvaluation resource.
Expand Down
Loading