I trained a decision tree classifier by means the package caret
, This is the code:
library(caret)
trctrl <- trainControl(method = "repeatedcv", number = 10, repeats = 20,
search = "grid")
classifier = train(form = Target ~ ., data = training_set, method = 'rpart',
parms = list(split = "information"),trControl=trctrl,tuneLength = 10)
Since I would like to estimate the fatures importance, I executed:
importance <- varImp(classifier, scale=FALSE)
where str(importance)
returns:
List of 3
$ importance:'data.frame': 13 obs. of 1 variable:
..$ Overall: num [1:13] 234.1 409.4 46.5 22.8 618 ...
$ model : chr "rpart"
$ calledFrom: chr "varImp"
- attr(*, "class")= chr "varImp.train"
However, I don't understand how this command works. How is importance calculated?