plot_feature_importance {GeneSelectR} | R Documentation |
Plot Feature Importance
Description
This function plots the feature importance scores from inbuilt_feature_importance
and permutation_importance
in the PipelineResults
object.
Usage
plot_feature_importance(pipelineresults, top_n_features = 10)
Arguments
pipelineresults |
An object of class |
top_n_features |
An integer specifying the top N features to plot based on their mean importance. |
Value
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.
Examples
# 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)
[Package GeneSelectR version 1.0.1 Index]