2 A complete example🔗ℹ

A full train-and-predict run is short. Build a DMatrix with labels, fit a booster, and predict:

(require xgboost)
 
(define dtrain
  (make-dmatrix '((1.0 2.0 0.5)
                  (2.0 1.0 1.5)
                  (3.0 0.5 0.0)
                  (0.5 3.0 2.0))
                #:labels '(3.5 3.5 6.5 2.0)))
 
(define booster
  (train dtrain
         #:objective "reg:squarederror"
         #:max-depth 2
         #:eta 0.2
         #:verbosity 0
         #:rounds 10))
 
(predict booster dtrain)

The train/predict pair is the single training interface; there is no separate scikit-learn-style estimator. The sections below break the workflow down step by step.