BaşlayınÜcretsiz Başlayın

Package a machine learning model

In this exercise, you will train a LinearRegression model from scikit-learn to predict profit of a Unicorn Company.

You will use MLflow's built-in scikit-learn Flavor to package the model. You will use the Flavor's auto logging function to automatically log metrics, parameters and the model to MLflow Tracking when the fit estimator is called.

Bu egzersiz

Introduction to MLflow

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the sklearn Flavor from the mlflow module.
  • Set the Experiment to "Sklearn Model".
  • Use auto logging from the flavor to package your model.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import Scikit-learn flavor
import mlflow.____

# Set the experiment to "Sklearn Model"
mlflow.____("____")

# Set Auto logging for Scikit-learn flavor 
____.____.____()

lr = LinearRegression()
lr.fit(X_train, y_train)

# Get a prediction from test data
print(lr.predict(X_test.iloc[[5]]))
Kodu Düzenle ve Çalıştır