Reputation: 28159
I'm using bayesglm
for a logistic regression problem. It's a dataset of 150 rows and 2000 variables. I'm trying to do variable selection and usually look at glmnet
in caret::rfe
. However there isn't a method for bayesglm
.
Is there anyway to manually define a method for rfe
?
Upvotes: 2
Views: 1847
Reputation: 439
As for the the question I can only think of rewriting lmFuncs$fit
function, for example:
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)
Upvotes: 5