如何在R中使用包装器特征选择算法? [英] How to use wrapper feature selection algorithms in R?

查看:275
本文介绍了如何在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆