開始使用免費開始

評估 UMAP 決策樹模型

在前一個練習中,你已建立一個 workflow 來套用 UMAP 並訓練決策樹模型。現在要使用訓練資料來擬合模型,並將其效能與未降維的決策樹模型相比。因為目標變數 credit_score 為類別型,你會使用 f_meas() 來評估模型效能。未降維模型與其測試預測分別存於 dt_fitpredict_df。你建立的 UMAP workflow 在 umap_dt_workflow。同時也提供了 traintest 資料集。

已為你載入 tidyversetidymodelsembed 套件。

本練習屬於課程

R 的降維

檢視課程

練習說明

  • 使用 f_meas 評估未降維的 dt_fit 之效能。
  • 使用 umap_dt_workflow 擬合 UMAP 降維後的模型。
  • 建立降維後 UMAP 模型在測試集上的預測資料框。
  • 使用 f_meas 評估降維後的 umap_dt_fit 效能。

動手互動練習

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

# Evaluate the unreduced decision tree model performance
___(___, ___, ___)

# Fit the UMAP decision tree model
umap_dt_fit <- ___ %>% 
  fit(___ = ___)

# Create test set prediction data frame for the UMAP model
predict_umap_df <- ___ %>% 
  ___(predict = ___(___, ___))

# Calculate F1 performance of the UMAP model
___(___, ___, ___)
編輯並執行程式碼