Plot Variable Importance for Supervised objects.
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
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)
}