評估 UMAP 決策樹模型
在前一個練習中,你已建立一個 workflow 來套用 UMAP 並訓練決策樹模型。現在要使用訓練資料來擬合模型,並將其效能與未降維的決策樹模型相比。因為目標變數 credit_score 為類別型,你會使用 f_meas() 來評估模型效能。未降維模型與其測試預測分別存於 dt_fit 與 predict_df。你建立的 UMAP workflow 在 umap_dt_workflow。同時也提供了 train 與 test 資料集。
已為你載入 tidyverse、tidymodels 與 embed 套件。
本練習屬於課程
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
___(___, ___, ___)