draw_varimp | R Documentation |
Plot variable importance using plotly
draw_varimp(
x,
names = NULL,
main = NULL,
type = c("bar", "line"),
xlab = NULL,
ylab = NULL,
plot_top = 1,
orientation = "v",
line_width = 12,
labelify = TRUE,
col = NULL,
alpha = 1,
palette = rtemis_palette,
mar = NULL,
font_size = 16,
axis_font_size = 14,
theme = choose_theme(),
showlegend = TRUE,
filename = NULL,
file_width = 500,
file_height = 500,
file_scale = 1
)
x |
Numeric vector: Input. |
names |
Vector, string: Names of features. |
main |
Character: Main title. |
type |
Character: "bar" or "line". |
xlab |
Character: x-axis label. |
ylab |
Character: y-axis label. |
plot_top |
Integer: Plot this many top features. |
orientation |
Character: "h" or "v". |
line_width |
Numeric: Line width. |
labelify |
Logical: If TRUE, labelify feature names. |
col |
Vector, colors: Single value, or multiple values to define bar (feature) color(s). |
alpha |
Numeric: Transparency. |
palette |
Character: Name of rtemis palette to use. |
mar |
Vector, numeric, length 4: Plot margins in pixels (NOT inches). |
font_size |
Integer: Overall font size to use (essentially for the title at this point). |
axis_font_size |
Integer: Font size to use for axis labels and tick labels. |
theme |
Theme object. |
showlegend |
Logical: If TRUE, show legend. |
filename |
Character: Path to save the plot image. |
file_width |
Numeric: Width of the saved plot image. |
file_height |
Numeric: Height of the saved plot image. |
file_scale |
Numeric: Scale of the saved plot image. |
A simple plotly
wrapper to plot horizontal barplots, sorted by value,
which can be used to visualize variable importance, model coefficients, etc.
plotly
object.
EDG
## Not run:
# made-up data
x <- rnorm(10)
names(x) <- paste0("Feature_", seq(x))
draw_varimp(x)
draw_varimp(x, orientation = "v")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.