cla_xgboost: XGBoost

View source: R/cla_xgboost.R

cla_xgboostR Documentation

XGBoost

Description

Gradient boosting classifier using xgboost.

Usage

cla_xgboost(attribute, params = list(), nrounds = 20)

Arguments

attribute

target attribute name

params

list of xgboost parameters

nrounds

number of boosting rounds

Value

returns a cla_xgboost object

Examples

if (requireNamespace("xgboost", quietly = TRUE)) {
 data(iris)
 # This setup keeps the example fast for checks and documentation builds.
 # A more typical starting point is:
 # model <- cla_xgboost("Species")
 model <- cla_xgboost(
   "Species",
   params = list(max_depth = 1, nthread = 1),
   nrounds = 1
 )
 model <- fit(model, iris)
 pred <- predict(model, iris)
 eval <- evaluate(model, adjust_class_label(iris$Species), pred)
 eval$metrics
}

daltoolbox documentation built on May 14, 2026, 9:06 a.m.