Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add model_monitoring_config to BatchPredictionJob in aiplatform v1beta1 batch_prediction_job.proto #1450

Merged
merged 2 commits into from
Jun 22, 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
2 changes: 2 additions & 0 deletions google/cloud/aiplatform_v1beta1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@
from .types.model_evaluation import ModelEvaluation
from .types.model_evaluation_slice import ModelEvaluationSlice
from .types.model_monitoring import ModelMonitoringAlertConfig
from .types.model_monitoring import ModelMonitoringConfig
from .types.model_monitoring import ModelMonitoringObjectiveConfig
from .types.model_monitoring import SamplingStrategy
from .types.model_monitoring import ThresholdConfig
Expand Down Expand Up @@ -841,6 +842,7 @@
"ModelEvaluationSlice",
"ModelExplanation",
"ModelMonitoringAlertConfig",
"ModelMonitoringConfig",
"ModelMonitoringObjectiveConfig",
"ModelMonitoringStatsAnomalies",
"ModelServiceClient",
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@
)
from .model_monitoring import (
ModelMonitoringAlertConfig,
ModelMonitoringConfig,
ModelMonitoringObjectiveConfig,
SamplingStrategy,
ThresholdConfig,
Expand Down Expand Up @@ -878,6 +879,7 @@
"ModelEvaluation",
"ModelEvaluationSlice",
"ModelMonitoringAlertConfig",
"ModelMonitoringConfig",
"ModelMonitoringObjectiveConfig",
"SamplingStrategy",
"ThresholdConfig",
Expand Down
11 changes: 11 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/batch_prediction_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from google.cloud.aiplatform_v1beta1.types import (
manual_batch_tuning_parameters as gca_manual_batch_tuning_parameters,
)
from google.cloud.aiplatform_v1beta1.types import model_monitoring
from google.cloud.aiplatform_v1beta1.types import (
unmanaged_container_model as gca_unmanaged_container_model,
)
Expand Down Expand Up @@ -214,6 +215,11 @@ class BatchPredictionJob(proto.Message):
BatchPredictionJob. If this is set, then all
resources created by the BatchPredictionJob will
be encrypted with the provided encryption key.
model_monitoring_config (google.cloud.aiplatform_v1beta1.types.ModelMonitoringConfig):
Model monitoring config will be used for
analysis model behaviors, based on the input and
output to the batch prediction job, as well as
the provided training dataset.
"""

class InputConfig(proto.Message):
Expand Down Expand Up @@ -528,6 +534,11 @@ class OutputInfo(proto.Message):
number=24,
message=gca_encryption_spec.EncryptionSpec,
)
model_monitoring_config = proto.Field(
proto.MESSAGE,
number=26,
message=model_monitoring.ModelMonitoringConfig,
)


__all__ = tuple(sorted(__protobuf__.manifest))
38 changes: 38 additions & 0 deletions google/cloud/aiplatform_v1beta1/types/model_monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
__protobuf__ = proto.module(
package="google.cloud.aiplatform.v1beta1",
manifest={
"ModelMonitoringConfig",
"ModelMonitoringObjectiveConfig",
"ModelMonitoringAlertConfig",
"ThresholdConfig",
Expand All @@ -29,6 +30,43 @@
)


class ModelMonitoringConfig(proto.Message):
r"""Next ID: 5

Attributes:
objective_configs (Sequence[google.cloud.aiplatform_v1beta1.types.ModelMonitoringObjectiveConfig]):
Model monitoring objective config.
alert_config (google.cloud.aiplatform_v1beta1.types.ModelMonitoringAlertConfig):
Model monitoring alert config.
analysis_instance_schema_uri (str):
YAML schema file uri in Cloud Storage
describing the format of a single instance that
you want Tensorflow Data Validation (TFDV) to
analyze.
If there are any data type differences between
predict instance and TFDV instance, this field
can be used to override the schema. For models
trained with Vertex AI, this field must be set
as all the fields in predict instance formatted
as string.
"""

objective_configs = proto.RepeatedField(
proto.MESSAGE,
number=3,
message="ModelMonitoringObjectiveConfig",
)
alert_config = proto.Field(
proto.MESSAGE,
number=2,
message="ModelMonitoringAlertConfig",
)
analysis_instance_schema_uri = proto.Field(
proto.STRING,
number=4,
)


class ModelMonitoringObjectiveConfig(proto.Message):
r"""Next ID: 8

Expand Down