Convert Trained 'XGBoost' Model to SQL Query
Overview
This tool enables in-database scoring of 'XGBoost' models built in R, by translating trained model objects into SQL query. 'XGBoost' https://github.com/dmlc/xgboost provides parallel tree boosting (also known as gradient boosting machine, or GBM) algorithms in a highly efficient, flexible and portable way. GBM algorithm is introduced by Friedman (2001) doi:10.1214/aos/1013203451, and more details on 'XGBoost' can be found in Chen & Guestrin (2016) doi:10.1145/2939672.2939785.
- Fix issue for
onehot2sql()processing data.frame with only one categorical feature. - Stop
onehot2sql()and add stop message when there is no categorical feature in the input data. - Fix example, vignette, and README following breaking changes on package xgboost.
- When missing
input_table_nameforonehot2sql(), the query will be printed to console.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-04
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 2
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- not measured
- Median days to close, 50 most recently updated closed issues
- 4
- Median days to close, 50 most recently updated closed PRs
- not measured
Stars over time
3 development-tooling and community-health practices detected across 3 families in the upstream repository
Checks run against github.com/chengjunhou/xgb2sql on 2026-10-11.
Dependencies
Installing xgb2sql adds 3 packages (3 with compiled code, 8.2 MB of source tarballs). Heaviest: data.table 5.7 MB, xgboost 1.5 MB, jsonlite 1.0 MB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 0.1.3Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- 0.1.22019-03-13
- RR 3.5.0 released · 2018-04-23
Package metadata
- First published
- 2019-03-13
- Total releases
- 2 / 7 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 3.1.0
- Download size
- 25 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("xgb2sql")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-19, which the citation names so these numbers can be found later. More on citing and the projects behind them.