nerdexam
DatabricksDatabricks

CERTIFIED-MACHINE-LEARNING-PROFESSIONAL · Question #1

CERTIFIED-MACHINE-LEARNING-PROFESSIONAL Question #1: Real Exam Question with Answer & Explanation

The correct answer is A: log_artifact. There appears to be an error in the provided answer key. Option C (log_metric) is the correct answer, not A. mlflow.log_metric("rmse", rmse) is the proper MLflow call for storing a scalar numerical value like RMSE. Metrics are numeric values tracked over time (or at a point in ti

Question

A data scientist has developed a model model and computed the RMSE of the model on the test set. They have assigned this value to the variable rmse. They now want to manually store the RMSE value with the MLflow run. They write the following incomplete code block: Which of the following lines of code can be used to fill in the blank so the code block can successfully complete the task?

Options

  • Alog_artifact
  • Blog_model
  • Clog_metric
  • Dlog_param
  • EThere is no way to store values like this.

Explanation

There appears to be an error in the provided answer key. Option C (log_metric) is the correct answer, not A.

mlflow.log_metric("rmse", rmse) is the proper MLflow call for storing a scalar numerical value like RMSE. Metrics are numeric values tracked over time (or at a point in time) and are exactly what log_metric is designed for.

Why the other options are wrong:

  • A (log_artifact) - logs a local file or directory (e.g., a CSV, plot image, or pickle file) to the artifact store. It cannot directly accept a float variable like rmse.
  • B (log_model) - logs a trained model object with its metadata and serialization format, not a scalar value.
  • D (log_param) - logs hyperparameters (e.g., learning rate, max depth), which are inputs to the model, not output evaluation metrics.
  • E - incorrect; MLflow absolutely supports storing evaluation metrics.

Memory tip: Think Param = Pre-training inputs, Metric = Measurement of performance. RMSE measures how your model performed, so it's a metric.

I'd recommend double-checking the source of this question - the answer key marking A as correct is a mistake that could mislead your exam preparation.

Community Discussion

No community discussion yet for this question.

Full CERTIFIED-MACHINE-LEARNING-PROFESSIONAL PracticeBrowse All CERTIFIED-MACHINE-LEARNING-PROFESSIONAL Questions