Skip to content

Releases

v0.2.0

Choose a tag to compare

@rustyconover rustyconover released this 25 Nov 17:55

Full Changelog: v0.1.1...v0.2.0

v0.1.1

Choose a tag to compare

@rustyconover rustyconover released this 16 Nov 23:55

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@rustyconover rustyconover released this 14 Nov 16:25

First tagged release of vgi-lightgbm, a VGI worker that brings LightGBM into DuckDB/SQL. Train gradient-boosted models, keep them in a model registry, predict over SQL tables, and interpret them (feature importance, permutation importance, SHAP contributions, partial dependence), all as SQL functions. String columns become native LightGBM categorical splits, so no one-hot encoding is needed.

Functions and tables

  • Datasets: iris, wine, breast_cancer, diabetes, california_housing
  • Fit: fit (JSON params), typed fit_lgbm_classifier / fit_lgbm_regressor, which return the model as a BLOB and persist it when model_name is given
  • Registry: models, model_info
  • Predict: predict (by model_name or inline model BLOB; with_proba, output_margin, pred_leaf)
  • Cross-validation: cross_val_predict, cross_val_score
  • Search: grid_search, randomized_search (typed, list-valued hyperparameter arguments)
  • Interpretation: feature_importance, permutation_importance, explain (SHAP), partial_dependence

Composed examples

The worker publishes example queries that combine its own functions:

  • an out-of-fold confusion matrix (cross_val_predict joined back to iris)
  • gain importance next to permutation importance (feature_importance + permutation_importance)
  • the SHAP drivers for each species (explain joined to iris)

Quick start

INSTALL vgi FROM community; LOAD vgi;
ATTACH 'lightgbm' (TYPE vgi, LOCATION 'uv run lightgbm_worker.py');  -- from a clone of this repo at v0.1.0

SELECT model_name, task FROM lightgbm.fit(
  (SELECT * EXCLUDE (target_name) FROM lightgbm.iris()),
  model_name := 'iris_clf', estimator := 'lgbm_classifier', target := 'target', id := 'sample_id');

SELECT * FROM lightgbm.predict((SELECT * FROM new_flowers), model_name := 'iris_clf', id := 'id');

Notes and known limits

  • This is a source-only release. Nothing is published to PyPI. Run the worker from a checkout (uv run lightgbm_worker.py).
  • It needs VGI protocol 3.2+ (vgi-python >= 0.50.0) and haybarn 2.0 with the current community vgi extension.
  • Models are stored on local disk. Every column of the input relation except id and target is treated as a feature, so SELECT only the columns you want to use as features.
  • Only numeric, boolean and string feature columns are supported. Other column types raise an error.

See CHANGELOG.md for the full history.