DeepGBoost
Machine Learning algorithm based on gradient boosting forest that merges the power of tree ensembles with neural network architectures.
⚙️ Installation
pip install deepgboost
Optional plotting support:
pip install deepgboost[plotting]
To install from source with development dependencies:
git clone https://github.com/iamthinbaker/deepgboost.git
cd deepgboost
pip install -e .
🚀 Usage
Quick Start
from sklearn.datasets import load_diabetes
from sklearn.model_selection import train_test_split
from deepgboost import DeepGBoostRegressor
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=42)
model = DeepGBoostRegressor(
n_trees=10,
n_layers=15,
max_depth=4,
learning_rate=0.1,
).fit(X_train, y_train)
predictions = model.predict(X_test)
📓 Examples
Detailed usage examples are available in the examples/ directory:
- quickstart.ipynb — full tour of the API (regression, classification, callbacks, feature importances)
- classifier.ipynb — binary and multiclass classification walkthrough
- regressor.ipynb — regression walkthrough
- serialization.ipynb — saving and loading trained models with pickle
🧠 DeepGBoost
Algorithm
DeepGBoost implements the Distributed Gradient Boosting Forest (DGBF), a novel tree ensemble algorithm introduced in:
Delgado-Panadero, Á., Benítez-Andrades, J. A., & García-Ordás, M. T. (2023). A generalized decision tree ensemble based on the NeuralNetworks architecture: Distributed Gradient Boosting Forest (DGBF). Applied Intelligence, 53, 22991–23003. https://doi.org/10.1007/s10489-023-04735-w
Classical tree ensemble methods — RandomForest (bagging) and GradientBoosting (boosting) — are powerful for tabular data but cannot perform hierarchical representation learning as Neural Networks do. DGBF addresses this by mathematically combining both bagging and boosting into a unified formulation that defines a graph-structured tree ensemble with distributed representation learning, without requiring back-propagation or parametric models.
The core idea is to distribute the gradient descent of each boosting step across the individual trees of a RandomForest layer, so that each tree learns an independent gradient component:
$$F_i(x) = \sum_{l=1}^{L} RF_l(x) = \frac{1}{T} \sum_{l=0}^{L} \sum_{t=0}^{T} h_{l,t}(x)$$
where L is the number of boosting layers and T is the number of trees per layer. This structure is a direct analogue of a Dense Neural Network, where each RandomForest layer corresponds to a network layer, with distributed gradients replacing back-propagation.
Fig. 1 — NeuralNetwork vs DGBF architecture: In NN (left), each neuron's output feeds into the next layer via back-propagation. In DGBF (right), the distributed gradients of all trees from each layer are forwarded to every tree of the following layer.
Both RandomForest and GradientBoosting emerge naturally as special cases of DGBF: RandomForest is recovered with a single layer (L = 1) and GradientBoosting with a single tree per layer (T = 1).
Fig. 2 — RandomForest & GradientBoosting as DGBF special cases: RandomForest (left) and GradientBoosting (right) represented as particular graph architectures of DGBF.
📊 Benchmark
DGBF was evaluated against RandomForest (RF) and GradientBoosting (GBDT) on 9 regression datasets from the UCI Machine Learning Repository (Parkinson, Wine, Concrete, Obesity, NavalVessel, Temperature, Cargo2000, BikeSales, Superconduct), using 200 randomized simulations per dataset with an 80/20 train-test split.
To reproduce the benchmark, run the experiment script from the benchmark/ directory:
cd benchmark
python run_experiments.py
The script reads its configuration from benchmark/config.json, where you can adjust the models, hyperparameters, datasets, and experiment settings (e.g. number of bootstrap runs). Results are saved to benchmark/results/.
🤝 Contributing
Contributions are welcome. See CONTRIBUTING.md for development setup, code style, and pull request guidelines.
📄 Citation
If you use DeepGBoost in your research, please cite using the metadata in CITATION.cff or the BibTeX entry provided by GitHub ("Cite this repository" button).
Metadata
Release files for deepgboost 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| deepgboost-0.3.4.tar.gz | 45.0 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepgboost-0.3.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 90.3 kB
Release files / deepgboost-0.3.4.tar.gz
| Download URL | deepgboost-0.3.4.tar.gz |
|---|---|
| Size | 45.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60a9a43e74bcaaf160f22a9107a3a614bec16e1819bee923474ac7892d54326c
|
|
BLAKE2b-256 checksum How to use checksums |
13196f5f7bcf7e834512b6406c6c02f39f1275c2454a85e84e041b93062b3684
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logRelease files / deepgboost-0.3.4-py3-none-any.whl
| Download URL | deepgboost-0.3.4-py3-none-any.whl |
|---|---|
| Size | 45.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e1daae7867a5686bb8b275ed13634cf8ffe3575332c1a8f86c1da8674be02aad
|
|
BLAKE2b-256 checksum How to use checksums |
4e95c8c582a45f3ce1d0d6e126305801a0cc3ac75e9951e7b2d34f684da12a1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logSecurity for deepgboost 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for deepgboost-0.3.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.