variable_importance: Variable Importance in BART Model

View source: R/bart_functions.R

variable_importanceR Documentation

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)

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.

Value

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


glossa documentation built on Oct. 15, 2024, 5:08 p.m.