plot_variable_importance | R Documentation |
This function plots variable importance based data obtained
during feature selection or after training a model, which are stored in a
familiarCollection
object.
plot_variable_importance(
object,
type,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
feature_cluster_cut_method = waiver(),
feature_similarity_threshold = waiver(),
aggregation_method = waiver(),
rank_threshold = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
color_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
show_cluster = TRUE,
ggtheme = NULL,
discrete_palette = NULL,
gradient_palette = waiver(),
x_label = "feature",
rotate_x_tick_labels = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
y_range = NULL,
y_n_breaks = 5,
y_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
## S4 method for signature 'ANY'
plot_variable_importance(
object,
type,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
feature_cluster_cut_method = waiver(),
feature_similarity_threshold = waiver(),
aggregation_method = waiver(),
rank_threshold = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
color_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
show_cluster = TRUE,
ggtheme = NULL,
discrete_palette = NULL,
gradient_palette = waiver(),
x_label = "feature",
rotate_x_tick_labels = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
y_range = NULL,
y_n_breaks = 5,
y_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
## S4 method for signature 'familiarCollection'
plot_variable_importance(
object,
type,
feature_cluster_method = waiver(),
feature_linkage_method = waiver(),
feature_cluster_cut_method = waiver(),
feature_similarity_threshold = waiver(),
aggregation_method = waiver(),
rank_threshold = waiver(),
draw = FALSE,
dir_path = NULL,
split_by = NULL,
color_by = NULL,
facet_by = NULL,
facet_wrap_cols = NULL,
show_cluster = TRUE,
ggtheme = NULL,
discrete_palette = NULL,
gradient_palette = waiver(),
x_label = "feature",
rotate_x_tick_labels = waiver(),
y_label = waiver(),
legend_label = waiver(),
plot_title = waiver(),
plot_sub_title = waiver(),
caption = NULL,
y_range = NULL,
y_n_breaks = 5,
y_breaks = NULL,
width = waiver(),
height = waiver(),
units = waiver(),
export_collection = FALSE,
...
)
plot_feature_selection_occurrence(...)
plot_feature_selection_variable_importance(...)
plot_model_signature_occurrence(...)
plot_model_signature_variable_importance(...)
object |
A |
type |
Determine what variable importance should be shown. Can be
|
feature_cluster_method |
The method used to perform clustering. These are
the same methods as for the
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
feature_linkage_method |
The method used for agglomerative clustering in
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
feature_cluster_cut_method |
The method used to divide features into
separate clusters. The available methods are the same as for the
If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
feature_similarity_threshold |
The threshold level for pair-wise
similarity that is required to form feature clusters with the If not provided explicitly, this parameter is read from settings used at
creation of the underlying |
aggregation_method |
(optional) The method used to aggregate variable importances over different data subsets, e.g. bootstraps. The following methods can be selected:
|
rank_threshold |
(optional) The threshold used to define the subset of highly important features. If not set, this threshold is determined by maximising the variance in the occurrence value over all features over the subset size. This parameter is only relevant for |
draw |
(optional) Draws the plot if TRUE. |
dir_path |
(optional) Path to the directory where created figures are
saved to. Output is saved in the |
split_by |
(optional) Splitting variables. This refers to column names on which datasets are split. A separate figure is created for each split. See details for available variables. |
color_by |
(optional) Variables used to determine fill colour of plot
objects. The variables cannot overlap with those provided to the |
facet_by |
(optional) Variables used to determine how and if facets of
each figure appear. In case the |
facet_wrap_cols |
(optional) Number of columns to generate when facet wrapping. If NULL, a facet grid is produced instead. |
show_cluster |
(optional) Show which features were clustered together. Currently not available in combination with variable importance obtained during feature selection. |
ggtheme |
(optional) |
discrete_palette |
(optional) Palette to use for coloring bar plots,
in case a non-singular variable was provided to the |
gradient_palette |
(optional) Palette to use for filling the bars in
case the |
x_label |
(optional) Label to provide to the x-axis. If NULL, no label is shown. |
rotate_x_tick_labels |
(optional) Rotate tick labels on the x-axis by
90 degrees. Defaults to |
y_label |
(optional) Label to provide to the y-axis. If NULL, no label is shown. |
legend_label |
(optional) Label to provide to the legend. If NULL, the legend will not have a name. |
plot_title |
(optional) Label to provide as figure title. If NULL, no title is shown. |
plot_sub_title |
(optional) Label to provide as figure subtitle. If NULL, no subtitle is shown. |
caption |
(optional) Label to provide as figure caption. If NULL, no caption is shown. |
y_range |
(optional) Value range for the y-axis. |
y_n_breaks |
(optional) Number of breaks to show on the y-axis of the
plot. |
y_breaks |
(optional) Break points on the y-axis of the plot. |
width |
(optional) Width of the plot. A default value is derived from the number of facets and the number of features. |
height |
(optional) Height of the plot. A default value is derived
from number of facets, and the length of the longest feature name (if
|
units |
(optional) Plot size unit. Either |
export_collection |
(optional) Exports the collection if TRUE. |
... |
Arguments passed on to
|
This function generates a barplot based on variable importance of features.
The only allowed values for split_by
, color_by
or facet_by
are
fs_method
and learner
, but note that learner
has no effect when
plotting variable importance of features acquired during feature selection.
Available palettes for discrete_palette
and gradient_palette
are those
listed by grDevices::palette.pals()
(requires R >= 4.0.0),
grDevices::hcl.pals()
(requires R >= 3.6.0) and rainbow
, heat.colors
,
terrain.colors
, topo.colors
and cm.colors
, which correspond to the
palettes of the same name in grDevices
. If not specified, a default
palette based on palettes in Tableau are used. You may also specify your
own palette by using colour names listed by grDevices::colors()
or
through hexadecimal RGB strings.
Labeling methods such as set_feature_names
or set_fs_method_names
can
be applied to the familiarCollection
object to update labels, and order
the output in the figure.
NULL
or list of plot objects, if dir_path
is NULL
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.