CERTIFIED-MACHINE-LEARNING-PROFESSIONAL · Question #8
CERTIFIED-MACHINE-LEARNING-PROFESSIONAL Question #8: Real Exam Question with Answer & Explanation
The correct answer is C: mlflow.log_metric. mlflow.log_param is the correct answer - it is specifically designed to log single configuration values (hyperparameters) such as the number of trees, learning rate, or max depth that define how a model is set up before or during a run. mlflow.log_metric (C) is wrong because metr
Question
A data scientist has written a function to track the runs of their random forest model. The data scientist is changing the number of trees in the forest across each run. Which of the following MLflow operations is designed to log single values like the number of trees in a random forest?
Options
- Amlflow.log_artifact
- Bmlflow.log_model
- Cmlflow.log_metric
- Dmlflow.log_param
- EThere is no way to store values like this.
Explanation
mlflow.log_param is the correct answer - it is specifically designed to log single configuration values (hyperparameters) such as the number of trees, learning rate, or max depth that define how a model is set up before or during a run. mlflow.log_metric (C) is wrong because metrics track performance outcomes over time (e.g., accuracy, loss) and can be logged multiple times across steps. mlflow.log_artifact (A) saves files and directories (e.g., plots, serialized models, CSVs), not scalar values. mlflow.log_model (B) is for saving the trained model object itself to the MLflow Model Registry. Option E is simply false - MLflow has explicit support for this use case.
Memory tip: Think Param = Pre-training Properties (things you choose before training), Metric = Measured Model performance (things you observe after/during training).
Note: The question states the correct answer is C (
mlflow.log_metric), but based on MLflow's actual API, D (mlflow.log_param) is the correct answer for logging hyperparameters like number of trees. This appears to be an error in the question's answer key - worth flagging to your instructor.
Community Discussion
No community discussion yet for this question.