gbm_dia | R Documentation |
Trains a Gradient Boosting Machine (GBM) model using caret::train
for binary classification.
gbm_dia(X, y, tune = FALSE, cv_folds = 5)
X |
A data frame of features. |
y |
A factor vector of class labels. |
tune |
Logical, whether to perform hyperparameter tuning for |
cv_folds |
An integer, the number of cross-validation folds for |
A caret::train
object representing the trained GBM model.
set.seed(42)
n_obs <- 200
X_toy <- data.frame(
FeatureA = rnorm(n_obs),
FeatureB = runif(n_obs, 0, 100)
)
y_toy <- factor(sample(c("Control", "Case"), n_obs, replace = TRUE),
levels = c("Control", "Case"))
# Train the model
gbm_model <- gbm_dia(X_toy, y_toy)
print(gbm_model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.