Get startedGet started for free

Loading models from the Model Registry

In this exercise, you will use the scikit-learn flavor to deploy the most stable "Insurance" model from the MLflow Model Registry and then use test data to get a prediction from the model.

The model uses LogisticRegression to predict whether an insurance claim is for a male or female, which is labeled as 1 or 0. You'll load the model and then make predictions using a test set called X_test.

The MLflow module will be imported.

This exercise is part of the course

Introduction to MLflow

View Course

Exercise instructions

  • With the scikit-learn flavor, load the "Production" version of the "Insurance" model using the convention for fetching models from the Registry as the model URI.
  • Using the loaded model, run a prediction on the test data from train_test_split used during training the model.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Load the Production stage of Insurance model using scikit-learn flavor
model = ____.____.____("____")

# Run prediction on our test data
____.____(____)
Edit and Run Code