Learn R Programming

glossa (version 1.0.0)

variable_importance: Variable Importance in BART Model

Description

This function computes the variable importance scores for a fitted BART (Bayesian Additive Regression Trees) model using a permutation-based approach. It measures the impact of each predictor variable on the model's performance by permuting the values of that variable and evaluating the change in performance (F-score is the performance metric).

Usage

variable_importance(bart_model, cutoff = 0, n_repeats = 10, seed = NULL)

Value

A data frame where each column corresponds to a predictor variable, and each row contains the variable importance scores across permutations.

Arguments

bart_model

A BART model object.

cutoff

A numeric threshold for converting predicted probabilities into presence-absence.

n_repeats

An integer indicating the number of times to repeat the permutation for each variable.

seed

An optional seed for random number generation.