| gbt.importance {agtboost} | R Documentation |
gbt.importance creates a data.frame of feature importance in a model
gbt.importance(feature_names, object)
feature_names |
character vector of feature names |
object |
object or pointer to object of class |
Sums up "expected reduction" in generalization loss (scaled using learning_rate)
at each node for each tree in the model, and attributes it to
the feature the node is split on. Returns result in terms of percents.
data.frame with percentwise reduction in loss of total attributed to each feature.
## Load data data(caravan.train, package = "agtboost") train <- caravan.train mod <- gbt.train(train$y, train$x, loss_function = "logloss", verbose=10) feature_names <- colnames(train$x) imp <- gbt.importance(feature_names, mod) imp