varimp_plot | R Documentation |
This function visualizes variable importance in models
varimp_plot(
model_list,
...,
type = "lollipop",
text_size = 10,
palette = "viridis",
n_row,
n_col,
save = FALSE,
file_path = NULL,
file_name = "VarImp_plot",
file_type = "pdf",
dpi = 80,
plot_width = 7,
plot_height = 7
)
model_list |
A |
... |
Additional arguments to be passed on to
|
type |
Type of plot to generate. Choices are "bar" or "lollipop."
Default is |
text_size |
Text size for plot labels, axis labels etc. Default is
|
palette |
Viridis color palette option for plots. Default is
|
n_row |
Number of rows to print the plots. |
n_col |
Number of columns to print the plots. |
save |
Logical. If |
file_path |
A string containing the directory path to save the file. |
file_name |
File name to save the plot.
Default is |
file_type |
File type to save the plot.
Default is |
dpi |
Plot resolution. Default is |
plot_width |
Width of the plot. Default is |
plot_height |
Height of the plot. Default is |
varimp_plot
produces a list of plots showing
variable importance measures calculated from models generated with different
machine-learning algorithms.
Note: Variables are ordered by variable importance in
descending order, and by default, importance values are scaled to 0 and 100.
This can be changed by specifying scale = FALSE
. See
varImp
for more information.
A list of ggplot2
objects.
Chathurani Ranathunge
train_models
, rem_feature
varImp
## Create a model_df object
covid_model_df <- pre_process(covid_fit_df, covid_norm_df)
## Split the data frame into training and test data sets
covid_split_df <- split_data(covid_model_df)
## Fit models based on the default list of machine learning (ML) algorithms
covid_model_list <- train_models(covid_split_df)
## Variable importance - lollipop plots
varimp_plot(covid_model_list)
## Bar plots
varimp_plot(covid_model_list, type = "bar")
## Do not scale variable importance values
varimp_plot(covid_model_list, scale = FALSE)
## Change color palette
varimp_plot(covid_model_list, palette = "magma")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.