Skip to contents

Produces a styled gt table of feature importance with a colour gradient. Supports tree-based, regularised, and xgboost models.

Usage

tl_table_importance(model, top_n = 20, digits = 2, ...)

Arguments

model

A tidylearn model object

top_n

Maximum number of features to display (default: 20)

digits

Number of decimal places (default: 2)

...

Additional arguments (currently unused)

Value

A gt table object.

Examples

# \donttest{
model <- tl_model(iris, Species ~ ., method = "forest")
tl_table_importance(model)
Feature Importance
Top 4 features
Feature Importance
Petal.Length 100.00
Petal.Width 94.03
Sepal.Length 32.18
Sepal.Width 15.82
tidylearn | forest (classification) | Species ~ . | n = 150
# }