Inside an MLflow run, which calls record a metric, a plot file and the trained model?
- Exam domain
- Databricks Machine Learning36% of the exam
- Difficulty
- Easy
- In this mock
- 18 questions on this domainPractise this domain
Why the exam asks this
Databricks Machine Learning (36% of the exam)
Objective in the exam guide: Manually log metrics, artifacts, and models in an MLflow Run
Manual logging is named.
Why C is the answer
mlflow.log_metric, mlflow.log_artifact and mlflow.sklearn.log_model
log_metric records numbers, log_artifact uploads files such as plots, and flavor-specific log_model functions save models with their environment.
Remember: log_metric, log_artifact, log_model.
How it works
MLflow runs store parameters, metrics, artifacts and models.
In detail
- Metrics, artifacts, models.
- Flavor log_model saves environment too.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. mlflow.set_tag for all three, since tags accept any type of value including filesWrongMost tempting
Tags are string metadata.
Why it tempts: Tags seem flexible.
B. print statements, which MLflow captures automaticallyWrong
Prints are not tracked.
C. mlflow.log_metric, mlflow.log_artifact and mlflow.sklearn.log_modelRight
log_metric, log_artifact, log_model.
D. spark.write for the metric, plot and modelWrong
spark.write saves data, not run records.
Use case
An illustrative scenario, not a real incident.
Illustrative: a run stores rmse, a residual plot and the model for later comparison.
See it in different ways
mindmap
root(("MLflow run"))
n1["Parameters"]
n2["log_param"]
n3["Metrics"]
n4["log_metric"]
n5["Artifacts"]
n6["log_artifact"]
n7["Model"]
n8["log_model"]How to read this chart
- The centre is "MLflow run".
- "Parameters" covers "log_param".
- "Metrics" covers "log_metric".
- "Artifacts" covers "log_artifact".
- "Model" covers "log_model".
flowchart LR S0["start_run"] --> S1["log_param"] --> S2["log_metric"] --> S3["log_artifact"] --> S4["log_model"]
How to read this chart
- Read it in order: start_run, then log_param, then log_metric, then log_artifact, then log_model.