Skip to contents

Plot Variable Importance for Supervised objects.

Usage

plot_varimp(x, ...)

Arguments

x

Supervised or SupervisedRes object.

...

Additional arguments passed to methods.

Value

plotly object or invisible NULL if no variable importance is available.

Details

This method calls draw_varimp internally. If you pass an integer to the plot_top argument, the method will plot this many top features. If you pass a number between 0 and 1 to the plot_top argument, the method will plot this fraction of top features.

See also

draw_varimp, which is called by this method

Author

EDG

Examples

if (FALSE) { # interactive()
ir <- set_outcome(iris, "Sepal.Length")
seplen_cart <- train(ir, algorithm = "CART")
plot_varimp(seplen_cart)
# Plot horizontally
plot_varimp(seplen_cart, orientation = "h")
plot_varimp(seplen_cart, orientation = "h", plot_top = 3L)
plot_varimp(seplen_cart, orientation = "h", plot_top = 0.5)
}