Skip to main content

A fast boosting implementation using Rust and Python

Project description

Genbooster

A gradient boosting and bagging (RandomBagClassifier, similar to RandomForestClassifier) implementation using Rust and Python. Any base learner can be employed. Base learners input features are engineered using a randomized artificial neural network layer.

For more details, see also https://www.researchgate.net/publication/386212136_Scalable_Gradient_Boosting_using_Randomized_Neural_Networks.

PyPI Downloads Documentation

1 - Installation

From PyPI:

pip install genbooster

From GitHub:

pip install git+https://github.com/Techtonique/genbooster.git

I might be required to install Rust and Cargo first:

Command line:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

Python:

import os
os.environ['PATH'] = f"/root/.cargo/bin:{os.environ['PATH']}"

Command line:

echo $PATH
rustc --version
cargo --version

2 - Usage

2.1 - Boosting

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.utils.discovery import all_estimators
from sklearn.datasets import load_iris, load_breast_cancer, load_wine
from sklearn.linear_model import Ridge, RidgeCV
from sklearn.tree import ExtraTreeRegressor
from sklearn.model_selection import train_test_split
from genbooster.genboosterclassifier import BoosterClassifier
from genbooster.randombagclassifier import RandomBagClassifier

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)
clf = BoosterClassifier(base_estimator=ExtraTreeRegressor())
clf.fit(X_train, y_train)
preds = clf.predict(X_test)
print(np.mean(preds == y_test))

2.2 - Bagging (RandomBagClassifier, similar to RandomForestClassifier)

clf = RandomBagClassifier(base_estimator=ExtraTreeRegressor())
clf.fit(X_train, y_train)
preds = clf.predict(X_test)
print(np.mean(preds == y_test))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

genbooster-0.6.4-cp311-cp311-win_amd64.whl (269.6 kB view details)

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.4-cp311-cp311-manylinux_2_34_x86_64.whl (424.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.6.4-cp311-cp311-macosx_10_12_x86_64.whl (383.8 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.6.4-cp310-cp310-win_amd64.whl (269.6 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.4-cp310-cp310-manylinux_2_34_x86_64.whl (424.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.6.4-cp310-cp310-macosx_10_12_x86_64.whl (383.7 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.6.4-cp39-cp39-win_amd64.whl (270.2 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.6.4-cp39-cp39-manylinux_2_34_x86_64.whl (425.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.6.4-cp39-cp39-macosx_10_12_x86_64.whl (384.2 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.6.4-cp38-cp38-win_amd64.whl (269.7 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.4-cp38-cp38-manylinux_2_34_x86_64.whl (425.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.6.4-cp38-cp38-macosx_10_12_x86_64.whl (384.2 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

Details for the file genbooster-0.6.4-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.4-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 269.6 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genbooster-0.6.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 07177a262603979e72dfc0c69d79a1abeeb5b9dc837470f91f0694a3b3789cc0
MD5 fd500438e8eb1cd5e10d50245c8ec838
BLAKE2b-256 94d6b567c5f4defa5f8e1002b68c144379c8f8854bdcf4b096adb500d2d6303d

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 9cb65836c26f754691861257663e794af687cfe39a082b63942af09015b2544c
MD5 515517e9226bfa80c93ebc12a0d47ab0
BLAKE2b-256 fd62ec38011a959f74fd91d0cfb56d25858d21e1622137f00dfc214c3b680b72

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f58126c1ae2cdf7a56ee61349688771fdf5069e482fc2ce05373e19422f3b8eb
MD5 af246be087f2182ebbe87107ebb4f30a
BLAKE2b-256 823717f35cca33a1ca10fff53f3aef9f878142ff710b3ece4fd3ba4bec17c9d9

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.4-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 269.6 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genbooster-0.6.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 fcb3007b3f8ae6e72a55aec1160e9bfedd2bac00c4582aea6750e39fa8758533
MD5 dce4dd218155e779b8adf7bf692502a2
BLAKE2b-256 3bad0e390b45934348b431e706f5f9cfb35a242a143562dd1ff4a10ed0c0648b

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b64655a0ffdbf68783186d257ceab4078a261f13c79ab3002f19238390c9b4e0
MD5 4301031c44759953ae550320d0cae2f9
BLAKE2b-256 21f5f3c984ca2474c64c3afd9e0d4481701f9f7088719f8e579b04d54ae820df

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 68114de3a76ee2942e96d4f550e1270027c5d879175abbc540fe904bf68e7b36
MD5 d06fcf21452479a989f0fa1254ef76dc
BLAKE2b-256 762dd77e6b9c0b33cef5f1192cd2990981737b9f52a2c6f6525cf0d0e6a30c9d

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.4-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 270.2 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genbooster-0.6.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 f78c5d53401d593f71bc691b6dac450602b9de345388cad17b9aa90cba9e24a0
MD5 9220a5bb0bd1b659834f599f7fd7b162
BLAKE2b-256 34bbba6666fb0f44522e18cabb3307f18d63d93221a561f5c22b6465824d96bf

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 818adfa93b6adfabafa0d853eb34a2c9bf1b4f340fb30e4e60be05f8207db6e8
MD5 5502de4311b875c1828424d7a93041a5
BLAKE2b-256 044e3bd8589f59c7c78c53215b74b2b4d0804f425d08dd5c50ad41b38d1ccfcd

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f6420587e8e0ec1b01d7d5d85d2374658d23e767624f26a4ea924cf35436589c
MD5 8de7c4f329f65ddf8621d148daa9016e
BLAKE2b-256 a17fd2d58a3265d3dff4b43bc354e4549411401604fe3386847bc27a65eb775b

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.4-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 269.7 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for genbooster-0.6.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 0f97fd5eb6ac35d6876434d861fca4869e7938fca7d4792c992711185cf0a6ee
MD5 28ef3cfe7c5c12fffbd6cc513c39f852
BLAKE2b-256 6134afc2f02e1a6a8abde599ff2b4134306696a16e4ef6bdfe4043cf2ca381f8

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5d5c6f5cfd54af9440638801722983dbadc7bfc4371aa3e464035a284d5b0239
MD5 a0f875af2353e50d3283c0646694fb30
BLAKE2b-256 c9da12c167eb81e5fe3e6104ad8482ecb8285f92177d9a9650bae21acf39c54b

See more details on using hashes here.

File details

Details for the file genbooster-0.6.4-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for genbooster-0.6.4-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3175be9c7e3c8703bc4d2fb6b2a2b9d4d53c4077101f5362e13c3195f4a5122d
MD5 cf7e93467e33160016f32ab9224dfc99
BLAKE2b-256 a59344031c349dfbea5db34ca644f255b3bd5e7a7f22e247f500eb64a3170812

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page