Repository navigation
v0.1.0
First release of vgi-xgboost, a VGI worker that brings XGBoost into DuckDB/SQL. You can train gradient-boosted models, save them in a model registry, run predictions over SQL tables, and interpret the models with feature importance and SHAP, all through SQL functions.
Functions
- Datasets (from scikit-learn):
iris,wine,breast_cancer,diabetes,california_housing,make_classification,make_regression - Fit / registry:
fitand typedfit_xgb_*functions (xgb_classifier,xgb_regressor,xgb_rf_classifier,xgb_rf_regressor), pluslist_models,model_info,drop_model - Predict: streaming
predict(withwith_proba) - Validation and tuning:
cross_val_predict,cross_val_score,grid_search,randomized_search - Interpretation:
feature_importance,permutation_importance, SHAPexplain,partial_dependence
String columns become native categorical features. Classification targets can use any label type and are decoded back to the original labels when you call predict.
Composed examples
cross_val_predictout-of-fold predictions joined back toiristo build a confusion matrix- Out-of-fold predictions on
diabetes, with held-out error grouped by BMI quartile - An out-of-fold agent test task on
breast_cancer
Quick start
INSTALL vgi FROM community; LOAD vgi;
ATTACH 'xgboost' (TYPE vgi, LOCATION 'uv run xgboost_worker.py');
SELECT * FROM xgboost.fit(
(SELECT * EXCLUDE (target_name) FROM xgboost.iris()),
model_name := 'iris_clf', estimator := 'xgb_classifier', target := 'target', id := 'sample_id');Run it from a checkout of this tag (git clone --branch v0.1.0 https://github.com/Query-farm/vgi-xgboost). A container image is published to ghcr.io/query-farm/vgi-xgboost:0.1.0.
Known limits
- Requires
vgi-python>=0.51.1(VGI protocol 3.3). Older protocol-3.2 builds fail ATTACH against the current community extension. - The model registry is stored on local disk. An S3/R2
ModelStoreseam exists but isn't implemented yet. - The package has no console-script entry point, so
uvx --from git+…can't launch it directly. Use a checkout or the container image. - This is a source-only release. The worker isn't published to PyPI.