diff options
| author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
|---|---|---|
| committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
| commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
| tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py | |
| parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
| download | gn-ai-master.tar.gz | |
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py')
| -rw-r--r-- | .venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py new file mode 100644 index 00000000..73a11895 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_monitoring/target.py @@ -0,0 +1,55 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +from typing import Optional, Union + +from azure.ai.ml._restclient.v2023_06_01_preview.models import MonitoringTarget as RestMonitoringTarget +from azure.ai.ml.constants._monitoring import MonitorTargetTasks + + +class MonitoringTarget: + """Monitoring target. + + :keyword ml_task: Type of task. Allowed values: Classification, Regression, and QuestionAnswering + :paramtype ml_task: Optional[Union[str, MonitorTargetTasks]] + :keyword endpoint_deployment_id: The ARM ID of the target deployment. Mutually exclusive with model_id. + :paramtype endpoint_deployment_id: Optional[str] + :keyword model_id: ARM ID of the target model ID. Mutually exclusive with endpoint_deployment_id. + :paramtype model_id: Optional[str] + + .. admonition:: Example: + + .. literalinclude:: ../samples/ml_samples_spark_configurations.py + :start-after: [START spark_monitor_definition] + :end-before: [END spark_monitor_definition] + :language: python + :dedent: 8 + :caption: Setting a monitoring target using endpoint_deployment_id. + """ + + def __init__( + self, + *, + ml_task: Optional[Union[str, MonitorTargetTasks]] = None, + endpoint_deployment_id: Optional[str] = None, + model_id: Optional[str] = None, + ): + self.endpoint_deployment_id = endpoint_deployment_id + self.model_id = model_id + self.ml_task = ml_task + + def _to_rest_object(self) -> RestMonitoringTarget: + return RestMonitoringTarget( + task_type=self.ml_task if self.ml_task else "classification", + deployment_id=self.endpoint_deployment_id, + model_id=self.model_id, + ) + + @classmethod + def _from_rest_object(cls, obj: RestMonitoringTarget) -> "MonitoringTarget": + return cls( + ml_task=obj.task_type, + endpoint_deployment_id=obj.endpoint_deployment_id, + model_id=obj.model_id, + ) |
