如何查看递归特征消除(RFE)生成的每个模型的预测变量?

发布于 2025-01-17 02:12:05 字数 529 浏览 4 评论 0原文

我使用 RFE(递归特征消除)方法从 39 个变量中找到最佳模型。我使用了以下代码:

set.seed(10)
ctrl <- rfeControl(functions = caretFuncs, method = "repeatedcv",repeats = 5,number= 5,allowParallel = TRUE)

RF_39 <- rfe(X, Y,sizes = c(1:39),method ='rf',rfeControl = ctrl,tuneGrid = data.frame(mtry=6))

最好的模型是使用 36 个变量构建的。 如果我想查看这 36 个变量,我可以使用 预测器(RF_39)RF_39$optVariable 函数。

但是,我需要查看用于制作其他模型而不是最佳模型的变量。 例如,用于制造型号 12 的变量是什么? 如何查看RFE方法制作的特定模型的变量? 感谢您的帮助。

I have used RFE (Recursive Feature Elimination) method to find the best model out of 39 variables. I used the following codes:

set.seed(10)
ctrl <- rfeControl(functions = caretFuncs, method = "repeatedcv",repeats = 5,number= 5,allowParallel = TRUE)

RF_39 <- rfe(X, Y,sizes = c(1:39),method ='rf',rfeControl = ctrl,tuneGrid = data.frame(mtry=6))

The best model is made using 36 variables.
If I want to see those 36 variables I can use
predictors(RF_39) or RF_39$optVariable functions.

However, I need to see the variables used for making the other models rather than the best model.
For example, what are the variables used for making model number 12?
How can I see the variables of a specific model made by RFE method?
Thanks for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文