View source: R/plot_feature_importance.R
plot_feature_importance | R Documentation |
This function plots the feature importance scores from inbuilt_feature_importance
and permutation_importance
in the PipelineResults
object.
plot_feature_importance(pipelineresults, top_n_features = 10)
pipelineresults |
An object of class |
top_n_features |
An integer specifying the top N features to plot based on their mean importance. |
A list of grid plot objects (ggplot objects) for each feature selection method in the PipelineResults
object.
Each plot visualizes the top N features based on their mean importance scores, including both inbuilt and permutation importances (if available).
The plots are arranged in a grid layout for easy comparison.
# Assuming `pipelineresults` is a PipelineResults object
pipelineresults <- new("PipelineResults",
inbuilt_feature_importance = list("Method1" = data.frame(
feature = LETTERS[1:10],
mean_importance = runif(10)),
"Method2" = data.frame(
feature = LETTERS[1:10],
mean_importance = runif(10))),
permutation_importance = list("Method1" = data.frame(
feature = LETTERS[1:10],
mean_importance = runif(10))))
# Plot the feature importance
importance_plots <- plot_feature_importance(pipelineresults, top_n_features = 5)
print(importance_plots)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.