cv_bart: Cross-Validation for BART Model

View source: R/bart_functions.R

cv_bartR Documentation

Cross-Validation for BART Model

Description

This function performs k-fold cross-validation for a Bayesian Additive Regression Trees (BART) model using presence-absence data and environmental covariate layers. It calculates various performance metrics for model evaluation.

Usage

cv_bart(data, k = 10, seed = NULL)

Arguments

data

Data frame with a column (named 'pa') indicating presence (1) or absence (0) and columns for the predictor variables.

k

Integer; number of folds for cross-validation (default is 10).

seed

Optional; random seed.

Value

A data frame containing the true positives (TP), false positives (FP), false negatives (FN), true negatives (TN), and various performance metrics including precision (PREC), sensitivity (SEN), specificity (SPC), false discovery rate (FDR), negative predictive value (NPV), false negative rate (FNR), false positive rate (FPR), F-score, accuracy (ACC), balanced accuracy (BA), and true skill statistic (TSS) for each fold.


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

Related to cv_bart in glossa...