[英]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.fit
与rfeControl(functions = lmFuncs)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.