quantlab.model.predefined.xgb#

XGBoost regression head for the tree-model layer.

XGBoostRegressor is a LibraryModel (the numpy-based model base class in quantlab.model.base). It trains an XGBoost Booster with xgb.train on the rows the base builds from the factor panel (one per cell with a valid training target) and predicts future returns row by row. The Booster is fit on a pooled concordance-correlation loss (pooled_ccc_loss) through the custom objective ccc_objective, early stopping uses xgboost’s native callback on the validation RMSE, and per-factor feature importance is written to the tracking run after training.

The module is named xgb.py rather than xgboost.py so it does not shadow the xgboost package inside this package.

Classes

XGBoostRegressor

Predict future returns with an XGBoost Booster.

Functions

boosters_on_cpu

Put boosters on device="cpu" for the block, then back on device.

ccc_loss_metric

Score a Booster's predictions for xgb.train(custom_metric=...).

ccc_objective

Gradient and hessian of the pooled CCC loss for xgb.train(obj=...).

pooled_ccc_loss

Return 1 - ccc, the pooled concordance correlation loss.

record_feature_importance

Write a Booster's per-factor importance to a tracking run.