Skip to content

Commit 8ebcdbd

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: add a return value (ClassificationMetrics) for the log_classification_metrics()
PiperOrigin-RevId: 509927411
1 parent f474fe8 commit 8ebcdbd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

google/cloud/aiplatform/metadata/experiment_run_resource.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ def log_classification_metrics(
10091009
tpr: Optional[List[float]] = None,
10101010
threshold: Optional[List[float]] = None,
10111011
display_name: Optional[str] = None,
1012-
):
1012+
) -> google_artifact_schema.ClassificationMetrics:
10131013
"""Create an artifact for classification metrics and log to ExperimentRun. Currently supports confusion matrix and ROC curve.
10141014
10151015
```
@@ -1038,6 +1038,9 @@ def log_classification_metrics(
10381038
display_name (str):
10391039
Optional. The user-defined name for the classification metric artifact.
10401040
1041+
Returns:
1042+
ClassificationMetrics artifact.
1043+
10411044
Raises:
10421045
ValueError: if 'labels' and 'matrix' are not set together
10431046
or if 'labels' and 'matrix' are not in the same length
@@ -1102,6 +1105,7 @@ def log_classification_metrics(
11021105
self._metadata_node.add_artifacts_and_executions(
11031106
artifact_resource_names=[classfication_metrics.resource_name]
11041107
)
1108+
return classification_metrics
11051109

11061110
@_v1_not_supported
11071111
def log_model(

0 commit comments

Comments
 (0)