plot_pfi: Plotting Permutation Feature Importance Barplot

View source: R/plotting_utils.R

plot_pfiR Documentation

Plotting Permutation Feature Importance Barplot

Description

The plot_pfi() function generates bar plots to visualize feature importance through permutation, providing clear representation of each predictor variable's relative contribution to model performance. The function includes an option to display accompanying numerical results tables for comprehensive interpretation.

Usage

plot_pfi(analysis_object, show_table = FALSE)

Arguments

analysis_object

Fitted analysis_object with 'sensitivity_analysis(methods = "PFI")'.

show_table

Boolean. Whether to print PFI results table.

Value

analysis_object

Examples

# Note: For obtaining the PFI plot results the user needs to complete till
# sensitivity_analysis( ) function of the MLwrap pipeline using the PFI method.



wrap_object <- preprocessing(df = sim_data,
                             formula = psych_well ~ depression + emot_intel + resilience,
                             task = "regression")
wrap_object <- build_model(wrap_object, "Random Forest")
wrap_object <- fine_tuning(wrap_object, "Bayesian Optimization")
wrap_object <- sensitivity_analysis(wrap_object, methods = "PFI")

# And then, you can obtain the PFI plot.

plot_pfi(wrap_object)




MLwrap documentation built on Aug. 8, 2025, 6:43 p.m.