PROFESSIONAL-MACHINE-LEARNING-ENGINEER · Question #279
You want to migrate a scikit-learn classifier model to TensorFlow. You plan to train the TensorFlow classifier model using the same training set that was used to train the scikit-learn model, and then
The correct answer is B. Use the aiplatform.log_classification_metrics function to log the F1 score and the confusion. When migrating a scikit-learn classifier to TensorFlow and manually logging evaluation metrics like F1 scores and confusion matrices using the Vertex AI Python SDK, utilize the aiplatform.log_classification_metrics function.
Question
Options
- AUse the aiplatform.log_classification_metrics function to log the F1 score, and use the
- BUse the aiplatform.log_classification_metrics function to log the F1 score and the confusion
- CUse the aiplatform.log_metrics function to log the F1 score and the confusion matrix.
- DUse the aiplatform.log_metrics function to log the F1 score: and use the
How the community answered
(26 responses)- A4% (1)
- B69% (18)
- C19% (5)
- D8% (2)
Why each option
When migrating a scikit-learn classifier to TensorFlow and manually logging evaluation metrics like F1 scores and confusion matrices using the Vertex AI Python SDK, utilize the `aiplatform.log_classification_metrics` function.
This choice is incomplete as it suggests logging the F1 score using `aiplatform.log_classification_metrics` but implies a separate or different method for the confusion matrix, whereas the `log_classification_metrics` function can log both.
The `aiplatform.log_classification_metrics` function is specifically designed to log common classification metrics such as F1 score, precision, recall, and the confusion matrix, providing a structured way to record and visualize these evaluations within Vertex AI Experiments.
The `aiplatform.log_metrics` function is used for logging simple scalar metrics. It is not designed to directly log structured data like a confusion matrix in its appropriate format for visualization or structured storage within Vertex AI for classification specific evaluation.
The `aiplatform.log_metrics` function is used for logging simple scalar metrics. It is not designed to directly log structured data like a confusion matrix in its appropriate format for visualization or structured storage within Vertex AI for classification specific evaluation.
Concept tested: Logging classification metrics with Vertex AI SDK
Source: https://cloud.google.com/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.log_classification_metrics
Topics
Community Discussion
No community discussion yet for this question.