提问人:Matyas K. 提问时间:8/13/2023 更新时间:8/13/2023 访问量:15
使用PCA预处理(插入符号包)时如何解释随机森林模型中的调优mtry参数
How to interpret tuning mtry parameter in random forest model when using PCA preprocessing (caret package)
问:
在将预处理与带有插入符号包的 PCA 一起使用后,我正在尝试运行带有交叉验证的随机森林模型。我使用 381 个参数预测两个类(变量 dg),我有 100 个观测值。
我原以为预处理后模型将仅适用于主成分,但是当我评估模型结果时,我得到了 2、191 和 381 个变量的 mtry 值。
模型的创建:
cntrl <- trainControl(method="repeatedcv",
number=10,
repeats = 100,
returnResamp="all",
savePredictions="all",
preProcOptions =list(thresh = 0.8), #80% of variance explained
classProbs=TRUE,
summaryFunction=twoClassSummary
)
rf_mod <- train(dg ~ .,
data = training,
method = "rf",
trControl = cntrl,
preProcess = c("pca"),
metric = "ROC")
模型结果:
mtry ROC Sens Spec
2 0.7770833 0.59750 0.8291667
191 0.7776042 0.60250 0.8141667
381 0.7765625 0.60375 0.8183333
这个输出的反作用是什么?为什么包括所有预测变量?
答: 暂无答案
评论