I've trained a random forest for classification in R's caret package using the ranger method and impurity for measuring variable importance. I would like to figure out what the units are for the variable importance measure returned by the model. Here's what I get when I pull importance directly from the ranger object and sort it (i.e., mod$finalModel$variable.importance %>% sort(decreasing=T) %>% head()).

diffF3F1_60 diffF3F1_65 diffF3F1_55 diffF3F1_50 diffF3F1_70 diffF3F2_70 127.43557 118.43874 113.98248 108.31281 97.81280 89.38337

The help doc for ranger says "The 'impurity' measure is the Gini index for classification", but the Gini index has a range of [0, 1] and these importance figures are obviously out of that range. My best guess is that these figures are the summed Gini index over all splits for that variable across the forest (e.g., Measures of variable importance in random forests), but I'm not totally sure. What do these numbers mean?

For what it's worth, I know that I can get these measures scaled so that the max is 100 if I use mod %>% caret::varImp(). However, this doesn't address the underlying question of what the raw figures are that are being scaled to 100.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.