I'm using varImpPlot() to evaluate the importance of variables from my rf model, and I can't decide wich variable I have to delete from my model. I'm not sure about the diference between "MeanDecreaseAccuracy" and "MeanDecreaseGini", I guess the last one can measure the purity of the tree nodes, but as an example of my model: I have a variable that has a MeanDecreaseGini of about 100 and at the same time a MeanDecreaseAccuracy of about zero.! Because of this I can't decide if this variable is good or bad.
1 Answer
If the features scale of measurement and/or number of categories vary, permutation accuracy is more reliable than the GINI index (Strob et al. 2007).
However, better yet is to use Boruta all relevant variable selection prior to running random forests to determine which variables are relevant to the target property, and which are not. This allows you to trim your dataset to only useful, or relevant variables.
Strobl, Carolin, Anne-Laure Boulesteix, Achim Zeileis, and Torsten Hothorn. “Bias in Random Forest Variable Importance Measures: Illustrations, Sources and a Solution.” BMC Bioinformatics 8 (2007): 25. doi:10.1186/1471-2105-8-25.