Registering a model using MLflow SDK

You can register a model using the user interface or the MLFlow SDK.

Using MLflow SDK to register a model

Registering a model enables you to track your model and upload and share the model. Registering a model stores the model archives in the model registry with a version tag. The first time you register a model, Model Registry automatically creates a model repository with the first version of the model.

  1. To register a model using MLFlow SDK, specify the registered_model_name and assign a value:
    mlflow.<model_flavor>.log_model()
    For example:
    mlflow.sklearn.log_model(lr, "model", registered_model_name="ElasticnetWineModel")
  2. If you run the Python code again with the same model_name it will create an additional version for the model_name.