| plot_varimp | R Documentation |
Draw importance recorded by a rtemis Supervised or SupervisedRes object,
or computed from a SHAP explanation by get_varimp, using
rtemis.draw::draw_varimp().
plot_varimp(x, ...)
x |
|
... |
Additional arguments to |
Named measures and variable identities are preserved. Resampled records
retain their fold IDs before summarizing. The first measure in the first
available fold is selected when measure is omitted; columns missing in
other folds are unavailable scores. The full fold list is passed to the
renderer, including folds with no importance result.
CART's importance and LightGBM's Gain, Cover, and Frequency come
from sparse split summaries: omitted variables in a reporting fold have
zero importance. These measures use absent = "zero". Other measures use
absent = "missing"; pass absent explicitly to declare another contract.
Explicit NA values and wholly unavailable folds are always kept missing.
Use type = "boxplot" for resampled fold distributions with all contributing
scores overlaid. Summary bars remain the default. Both views share selection,
ranking, and the producer's missing-score contract. Ordinary models have no
fold distribution and require the bar view.
A SHAP explanation is drawn from the mean absolute contribution of each
feature, with one measure per class for a multiclass outcome.
Models without any importance records produce an informative error.
The default title names the algorithm; title = NULL omits it.
See rtemis.draw::draw_varimp() for selection, ranking, and missing-score semantics.
htmlwidget: ECharts importance bars or fold distributions.
model <- train(
mtcars[, c("wt", "hp", "mpg")],
hyperparameters = setup_GLM(), verbosity = 0L
)
plot_varimp(model)
features <- mtcars[, c("wt", "hp")]
plot_varimp(explain(model, features, background = features, verbosity = 0L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.