nerdexam
Google

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.

Submitted by viktor_hu· Apr 18, 2026ML model development

Question

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 compare the performances using a common test set. You want to use the Vertex AI Python SDK to manually log the evaluation metrics of each model and compare them based on their F1 scores and confusion matrices. How should you log the metrics?

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)
  • A
    4% (1)
  • B
    69% (18)
  • C
    19% (5)
  • D
    8% (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.

AUse the aiplatform.log_classification_metrics function to log the F1 score, and use the

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.

BUse the aiplatform.log_classification_metrics function to log the F1 score and the confusionCorrect

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.

CUse the aiplatform.log_metrics function to log the F1 score and the confusion matrix.

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.

DUse the aiplatform.log_metrics function to log the F1 score: and use the

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

#Vertex AI SDK#Model Evaluation#Classification Metrics#Metric Logging

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-MACHINE-LEARNING-ENGINEER Practice