I've been experimenting with the
rfe function in the
caret package to do logistic regression with feature selection. I used the
lmFuncs functions with the following
ctrl <- rfeControl(functions = lmFuncs,
method = 'cv',
verbose = TRUE,
returnResamp = "all",
Below is the structure of the
fit.rfe=rfe(df.preds,df.depend, metric='RMSE',sizes=c(5,10,15,20), rfeControl=ctrl)
df.preds is a data frame of inputs to the model.
df.depend is a vector of 1 or 0 corresponding to each row in
df.preds to indicate response.
The resulting model accessed in from the
fit object in the
rfe object is of class
lm and produces predicted values of less than zero and greater than 1 when I use the following code with the
Given I'm expecting this to be a logistic, all predicted values should greater than zero and less than one.
Any help will be appreciated.