Skip to contents

Trains an Extreme Gradient Boosting (XGBoost) model using caret::train for binary classification.

Usage

xb_dia(X, y, tune = FALSE, cv_folds = 5, tune_length = 20)

Arguments

X

A data frame of features.

y

A factor vector of class labels.

tune

Logical, whether to perform hyperparameter tuning using caret's default grid (if TRUE) or use fixed values (if FALSE).

cv_folds

An integer, the number of cross-validation folds for caret.

tune_length

An integer, the number of random parameter combinations to try when tune=TRUE. Only used when search="random". Default is 20.

Value

A caret::train object representing the trained XGBoost model.