Certified Machine Learning Professional Exam QuestionsBrowse all questions from this exam

Certified Machine Learning Professional Exam - Question 4


A machine learning engineer wants to log feature importance data from a CSV file at path importance_path with an MLflow run for model model.

Which of the following code blocks will accomplish this task inside of an existing MLflow run block?

Show Answer
Correct Answer: D

A machine learning engineer who wants to log feature importance data from a CSV file within an MLflow run should use the function mlflow.log_artifact. This function is designed to log files or directories as artifacts of a run, allowing for easy tracking and analysis along with other relevant model information. Therefore, the correct code block to use is mlflow.log_artifact(importance_path, 'feature-importance.csv').

Discussion

9 comments
Sign in to comment
hugodscarvalhoOption: D
Jan 27, 2024

Doc: https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.log_artifact

BokNinjaOption: D
Dec 19, 2023

D. mlflow.log_artifact(importance_path, "feature-importance.csv")

dplyrOption: D
Dec 26, 2023

D. mlflow.log_artifact(importance_path, "feature-importance.csv")

trendy01Option: D
Dec 27, 2023

D. mlflow.log_artifact(importance_path, "feature-importance.csv")

mozucaOption: C
Dec 27, 2023

Agree!

srikanth923Option: D
Apr 29, 2024

Answer is D

c4b65b5Option: D
Jun 11, 2024

mlflow does not have log_data method

sindhu_gowdaOption: D
Jun 11, 2024

Answer is D

64934caOption: D
Jul 5, 2024

By using the mlflow.log_artifact function, you can log the feature importance CSV file as an artifact within an existing MLflow run. Additionally, you can log the model using the appropriate MLflow flavor and optionally log the feature importance data as metrics for easier access and analysis. This approach ensures that all relevant information is logged and tracked within the same MLflow run.