Variable importance using the caret package (error); RandomForest algorithm

后端 未结 2 383
清歌不尽
清歌不尽 2021-01-17 09:23

I am trying to obtain the variable importance of a rf model in any way. This is the approach I have tried so far, but alternate suggestions are very welcome.

I have

2条回答
  •  萌比男神i
    2021-01-17 10:19

    That is becouse the obtained from train() object is not a pure Random Forest model, but a list of different objects (containing the final model itself as well as cross-validation results etc). You may see them with ls(model2). So to use the final model just call varImp(model2$finalModel) .

提交回复
热议问题