评估 UMAP 决策树模型
在上一个练习中,您已创建工作流来应用 UMAP 并构建决策树模型。现在请使用训练数据拟合该模型,并将其性能与未降维的决策树模型进行比较。由于目标变量 credit_score 是分类型,您将使用 f_meas() 来评估模型表现。未降维模型及其在测试集上的预测分别存储在 dt_fit 和 predict_df 中。您创建的 UMAP 工作流为 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
___(___, ___, ___)