I am running into trouble with variable importance in R. It prints the importance but does not include the variable name. I cannot figure out where it is getting the index in the left column. Below is the code and the output.
#Random Forest training
set.seed(7)
rf_train <- train(Output~., data=training, method = "rf",
trControl = trainControl(method="cv",number=4,classProbs = T,summaryFunction = twoClassSummary),metric="ROC")
#Plot of variable importance
varImp(rf_train)
plot(varImp(rf_train))
print(rf)
Overall
8 100.00, 23 99.80, 21 98.19, 2 94.17, 634 92.06, 7 91.75, 1010 81.26, 636 69.02, 9 56.88, 630 49.90, 1 42.60, 4 36.95, 16 29.34, 15 29.10, 1008 28.83, 17 28.54, 18 27.50, 22 27.04, 3 26.78, 14 26.36,
Aucun commentaire:
Enregistrer un commentaire