Registering a Scikit-Learn Model with MLFlow | DP-100 Exam Guide

Registering a Scikit-Learn Model with MLFlow

Question

You are using an Azure Databricks cluster for training your ML model.

After successfully training your model built using the scikit-learn framework, you want to register it to the backend tracking server, using the following code:

# register model mlflow.sklearn.log_model(model, artifact_path = "trained_model",   registered_model_name = 'my_trained_model') 
Is this the right formula to register your model with MLFlow backend tracking?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

Correct Answer: A.

Option A is CORRECT because it is the correct formula for registering a scikit-learn model with mlflow for tracking.

The <sklearn> must be used as “model flavor”.

Option B is incorrect because the formula actually does the registration of your trained model for being tracked with MLFlow.

References:

Yes, the given code is correct to register a trained ML model with the MLflow backend tracking server.

The code uses the mlflow.sklearn.log_model function to register a trained model with the MLflow tracking server. The function logs the model as an artifact and stores it in the specified artifact path, in this case, "trained_model". Additionally, it registers the model with the specified name, "my_trained_model", on the tracking server so that it can be easily retrieved and shared with others.

The mlflow.sklearn.log_model function is a part of the MLflow Python API, which provides a simple way to track and manage machine learning experiments, including model training, deployment, and versioning.

Overall, the given code is a correct and efficient way to register a trained model with the MLflow backend tracking server.