most_important: Most Important Variables.

View source: R/light_importance.R

most_importantR Documentation

Most Important Variables.

Description

Returns the most important variable names sorted descendingly.

Usage

most_important(x, top_m = Inf)

Arguments

x

An object of class "light_importance".

top_m

Maximum number of important variables to be returned.

Value

A character vector of variable names sorted in descending importance.

See Also

light_importance()

Examples

fit <- lm(Sepal.Length ~ ., data = iris)
fl <- flashlight(model = fit, label = "lm", data = iris, y = "Sepal.Length")
imp <- light_importance(fl)
most_important(imp)
most_important(imp, top_m = 2)

mayer79/flashlight documentation built on Feb. 13, 2024, 1:09 p.m.