简体   繁体   中英

variable importance using caret package in R

I'm using the caret package in R to run both random forest and xgboost models. And I want to get the variable importance of all 65 variables. I've tried varimp() function, and it could give me variable importance of the top 20 variables. Is there any way or options that I could have them for all 65 variables?

Thank you!!!

It computes them all. If you are printing or plotting, there is an argument called top that let's you control how many that are shown. The argument coming out of varImp has them all. I could give more details if you show a small reproducible example.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM