FES icon indicating copy to clipboard operation
FES copied to clipboard

02_Predicting_Risk_of_Ischemic_Stroke- Coefficients for RFE model

Open rodfloripa opened this issue 5 years ago • 1 comments

Trying to run the recursive feature elimination code I'm not able to see the log regression coefficients for all the RFE models created. The code is the following: https://github.com/topepo/FES/blob/master/02_Predicting_Risk_of_Ischemic_Stroke/02_04_Predictive_Modeling_Across_Sets.R

For example, when I run this code:

set.seed(63331)
img_int_filtered_rfe <- rfe(
  img_int_filtered_recipe,
  data = numericas_train,
  sizes = 1:nrow(img_int_filtered_recipe$var_info)-1,
  rfeControl = rfeCtrl,
  metric = "ROC",
  ## train options
  method = "glm",
  trControl = internal_ctrl
)

And type:
>img_int_filtered_rfe$fit
Thats what I get:
Generalized Linear Model 

30 samples
 1 predictor
 2 classes: 'N', 'Y' 

No pre-processing
Resampling: None 

Why I can't see the coefficients?

I modified the 'functions' parameter from 'caretFuncs' to 'lrFuncs' and now I get the coefficients.

rodfloripa avatar Sep 24 '20 13:09 rodfloripa

If you look at the class of that object, it is train. If you use img_int_filtered_rfe$fit$finalModel, you should get the glm model

topepo avatar Sep 24 '20 15:09 topepo