開始使用免費開始

從 Model Registry 載入模型

在這個練習中,你會使用 scikit-learn 風味(flavor),從 MLflow Model Registry 部署最穩定的 "Insurance" 模型,接著用測試資料從模型取得預測。

此模型使用 LogisticRegression 來預測保險理賠申請的性別為男性或女性,分別以 1 與 0 標示。你將載入該模型,然後使用名為 X_test 的測試集進行預測。

已經匯入 MLflow 模組。

本練習屬於課程

MLflow 入門

檢視課程

練習說明

  • 使用 scikit-learn 風味,依照從 Registry 取得模型的慣用寫法,將模型 URI 指向 "Insurance" 模型在 "Production" 階段的版本,並將其載入。
  • 使用已載入的模型,對訓練時透過 train_test_split 產生的測試資料進行預測。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

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

# Run prediction on our test data
____.____(____)
編輯並執行程式碼