Returns the most important variable names sorted descendingly.
most_important(x, top_m = Inf)
A character vector of variable names sorted in descending importance.
fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "lm", data = iris, y = "Sepal.Length")
imp <- light_importance(fl)
most_important(imp)
#> [1] "Petal.Length" "Species" "Petal.Width" "Sepal.Width"
most_important(imp, top_m = 2)
#> [1] "Petal.Length" "Species"