I wanted to use the Random Forest to find the most important features for a classification problem (I have two classes: 0 and 1).
I created the model:
rf = randomForest(y ~ ., data = df, sampsize=100000,ntree=100, importance = TRUE, keep.forest = FALSE)
And then I used the following to check the importance:
importance(rf, type = 1, class = 1)
I read that the class parameter can be used for a classification problem.
My question is if I have to sort the results by their absolute value in Mean Decrease accuracy. When I use the VarImpPlot
seems that I should consider also the negative values. And what exactly does the parameter class = 1
?