简体   繁体   English

R Caret / RFE / Bayesglm功能选择

[英]R caret / rfe / bayesglm feature selection

I'm using bayesglm for a logistic regression problem. 我将bayesglm用于逻辑回归问题。 It's a dataset of 150 rows and 2000 variables. 它是一个包含150行和2000个变量的数据集。 I'm trying to do variable selection and usually look at glmnet in caret::rfe . 我正在尝试进行变量选择,通常会在caret::rfe查看glmnet However there isn't a method for bayesglm . 但是,没有用于bayesglm的方法。

Is there anyway to manually define a method for rfe ? 无论如何,有手动定义rfe的方法吗?

As for the the question I can only think of rewriting lmFuncs$fit function, for example: 至于这个问题,我只能想到重写lmFuncs$fit函数,例如:

lmFuncs$fit<-function (x, y, first, last, ...){   
     tmp <- as.data.frame(x)   
     tmp$y <- y   
 bayesglm (y ~ ., family = gaussian, data = tmp)
}

and then do your rfe.fit with rfeControl(functions = lmFuncs) 然后做你的rfe.fitrfeControl(functions = lmFuncs)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM