如何在R中使用包装器特征选择算法? [英] How to use wrapper feature selection algorithms in R?
问题描述
我有几种算法:rpart,kNN,逻辑回归,randomForest,朴素贝叶斯和SVM。我想使用前进/后退和遗传算法选择来找到要用于特定算法的最佳功能子集。
I have several algorithms: rpart, kNN, logistic regression, randomForest, Naive Bayes, and SVM. I'd like to use forward/backward and genetic algorithm selection for finding the best subset of features to use for the particular algorithms.
如何实现包装器类型forward /
How can I implement wrapper type forward/backward and genetic selection of features in R?
推荐答案
我现在正在测试包装器,所以我给你一些R中的包裹名称。什么是
I'm testing wrappers at the moment so I'll give you a few Pacckage names in R. What is a
现在使用方法:
MASS软件包:由AIC逐步选择模型算法
stepAIC(model,direction = both,trace = FALSE)
stepAIC(model,direction = backward,跟踪= FALSE)
stepAIC(model,direction = forward,跟踪= FALSE)
Carte Package :向后功能选择
Carte Package: Backwards Feature Selection
control <- rfeControl(functions = lmFuncs, method = "repeatedcv", number = 5, verbose = TRUE)
rfe_results <- rfe(x, y, sizes = c(1:10), rfeControl = control)
或使用遗传算法进行监督的特征选择
gafs_results <- gafs(x, y, gafsControl = control)
或模拟退火ling功能选择
safs_results <- safs(x, y, iters = 10, safsControl = control)
希望我能给您一个很好的概述。还有很多方法...
hope i could give you a good overview. There are a lot more Methods out there...
这篇关于如何在R中使用包装器特征选择算法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!