Creates a horizontal bar chart showing the average permutation importance (delta Net Benefit) for each predictor across the evaluated models.
Arguments
- all_models
Data frame returned in the
all_modelselement ofnb_varsel(). Must includeVIF_*columns (generated whenpermutation = TRUE).- filter
Integer or
NULL. If specified, only the topfiltermodels (byAvg_Net_Benefit) are used to compute average importance. Defaults toNULL(use all models).- color
Character string. Fill color for the bars. Defaults to
"#2A6EBB".
Value
A list containing two elements:
- plot
A ggplot2::ggplot object of the bar chart.
- data
A data frame containing the
VariableandAverage_Delta_NBvalues.
Examples
if (FALSE) { # \dontrun{
result <- nb_varsel(
data = df, outcome_var = "Y", costs = harms,
mode = "exhaustive", permutation = TRUE,
splines = FALSE, allow_parallel = FALSE
)
vif_results <- VIF_plot(result$all_models)
# View the plot
print(vif_results$plot)
# View the values
print(vif_results$data)
} # }