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.5.0-cp311-cp311-win_amd64.whl (255.0 kB view details)

Uploaded CPython 3.11Windows x86-64

genbooster-0.5.0-cp311-cp311-manylinux_2_34_x86_64.whl (407.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl (368.4 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.5.0-cp310-cp310-win_amd64.whl (255.0 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl (407.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.5.0-cp310-cp310-macosx_10_12_x86_64.whl (368.4 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.5.0-cp39-cp39-win_amd64.whl (255.4 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.5.0-cp39-cp39-manylinux_2_34_x86_64.whl (408.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.5.0-cp39-cp39-macosx_10_12_x86_64.whl (368.9 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.5.0-cp38-cp38-win_amd64.whl (255.0 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.5.0-cp38-cp38-manylinux_2_34_x86_64.whl (408.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.5.0-cp38-cp38-macosx_10_12_x86_64.whl (368.8 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: genbooster-0.5.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 255.0 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.5.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ad3a7e46dc9e0ba7b4320da6c299d252c82c6bc4040f18655d3a93719ee1c9f4
MD5 2a013f17ef99a2e01d2b2030e4ea5fca
BLAKE2b-256 bd06d3b8d53d465754e0642076480d17d3474058b6ad62d9aebb345e4a3fb06d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 784614b88dcc93dd8d5650c16d6b279702c972b08040b94c4747fd41fc48cfcf
MD5 21011d24f2d6d05ebd5585b7a364b9c7
BLAKE2b-256 7818f4c10ec393403586c7da74cf5180383725bb0c25a327a5261791a06b48a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 79140f22b6dd54b18cea0ea7b84bdd22c8a0c733a418ba47989e4d9a3825e283
MD5 de6c0bae41514ad37aa8541b933e1a14
BLAKE2b-256 ae8ab3967204b5eb592de16b1098f28954891df57d3d2c1745c87b2d82e240aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 255.0 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.5.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 e367cc488abbd1f6edee93c0bc41283a62272b3542582a59205c0d2c55805170
MD5 d71454dae6e00bfe8546a026f6a75055
BLAKE2b-256 45ed05e2b65259d7ee8e951c54233c8860135646cf2d243a329409904f3415f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 07b7a30b97ef89978edf6b11bb08bc81995d127f478b125ffa0e9f44dc30ba1a
MD5 41d26fc0acbf996d07988930f6da9ee8
BLAKE2b-256 63b1fe34696df5ac9e417255d12c80b5edc6121e2f6e8c0ee2c7f85d15e760e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c8b18b0d5f93996ab2912ff2e6919cddc54e6532e89472e560f01efc7f0f4269
MD5 f6630efdbdab2ac28975c340f516f67b
BLAKE2b-256 ec81f9f05ff3711b5fe447de0ba9aca8ef5c383a359f8c4ed00f3d9a2cb28036

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 255.4 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.5.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e4bb1e27cc2577925f2856ba25f0ceed9ee9ce168bff089170cfd9caaec9fb61
MD5 3ab3772ae546020aeb553cf89ecd0c20
BLAKE2b-256 14f42c2bc36f4cc2a8fd532341fc42efc6afb3945e1131fc8a14e240658aa032

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7e4877b6a56c434def656317868005d80725621d321af85c64ea5d7e03872453
MD5 3fd6b13d3fb5a81440dcfdfdb39eb5be
BLAKE2b-256 6aa5f4d84864d9077d8c2d694674fd714627965a8a566015202f2afd221760b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fca1e792fbc5ea22b3262c9bb53e576e09bce4756d6a4be15b0b29f8833f89e8
MD5 2597513c5a02394b0d74b67739cdc95b
BLAKE2b-256 417967554e1b4d45dddd0eb5f7686feef936007a801f848bab857134b716130c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 255.0 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.5.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b1bffdab452ec6251fd73c4fa33168fd65cdd1153e677b52e8307816de781b9f
MD5 af782dc66e330085aba9a8a2032224ae
BLAKE2b-256 499b0de15ad1f347b25a05449e8a0b823c614753310afc14dc4777005d18ee0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a64a2eff9b5cd426df8cd398e12d0f31f6011810eba4a8afc0af48e7cfaead23
MD5 e4f61344908d6e59065b95a68cf55cbc
BLAKE2b-256 af7e35b971293915ab796ff555bb007de65535ff0ee6c2a127be1c61ff51cf2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.0-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b2a3b9094b53e2f081d8cc8f77dffd7cdd6f6f0b7e46c129f12a075872e75d58
MD5 ab473da13754aecd2eab74d900d7b424
BLAKE2b-256 297e5785768d43fc5b83c74f3ed412dd08649cd1dd4cef61a2c854b153a12bc7

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