Databricks Certified Machine Learning Associate · Free Practice Question Easy
Question 1
A data scientist is using MLflow to manage machine learning experiments and versions. They want to update the metadata of an existing model version, such as changing its description or adding tags.
Which MLflow operation should they use?
-
A
mlflow.update_model_metadata -
B
mlflow.register_model -
C
mlflow.update_model_version -
D
mlflow.edit_model_version
Reveal correct answer
Correct answer: C
Explanation
Correct Answer:
✅ mlflow.update_model_version
Explanation:
In MLflow Model Registry, the update_model_version() method is used to update metadata of an existing model version, such as:
Changing its description
Adding or modifying tags
Updating other metadata fields
This allows data scientists to manage model documentation and tracking efficiently without re-registering a new version.
Example: Updating a Model Version’s Metadata in MLflow
- import mlflow
- from mlflow.tracking import MlflowClient
- # Initialize MLflow Client
- client = MlflowClient()
- # Define model details
- model_name = "my_model"
- model_version = 2 # The model version to update
- # Update model description
- client.update_model_version(
- name=model_name,
- version=model_version,
- description="Updated model description: Improved accuracy and retrained on new dataset."
- )
- # Add a new tag to the model version
- client.set_model_version_tag(
- name=model_name,
- version=model_version,
- key="dataset_version",
- value="v2.1"
- )
- print(f"Updated metadata for {model_name} version {model_version}")
update_model_version()updates the model version's description.set_model_version_tag()adds tags for better tracking.
Why Other Options Are Incorrect?
mlflow.update_model_metadataIncorrect, because no such function exists in MLflow.
Metadata updates are done using
update_model_version()instead.
mlflow.register_modelIncorrect, because registering a model creates a new model version, rather than updating an existing one.
mlflow.edit_model_versionIncorrect, because this function does not exist in MLflow.
The correct function is
update_model_version().
Final Answer:
✅ Use mlflow.update_model_version() to modify metadata, descriptions, and tags for an existing MLflow model version.
Discussion
Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.
