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

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.6-cp311-cp311-manylinux_2_34_x86_64.whl (424.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.6.6-cp311-cp311-macosx_10_12_x86_64.whl (384.0 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.6.6-cp310-cp310-win_amd64.whl (269.8 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.6-cp310-cp310-manylinux_2_34_x86_64.whl (424.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.6.6-cp310-cp310-macosx_10_12_x86_64.whl (383.8 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.6.6-cp39-cp39-win_amd64.whl (270.3 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.6.6-cp39-cp39-manylinux_2_34_x86_64.whl (425.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.6.6-cp39-cp39-macosx_10_12_x86_64.whl (384.3 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.6.6-cp38-cp38-win_amd64.whl (269.8 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.6-cp38-cp38-manylinux_2_34_x86_64.whl (425.3 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.6.6-cp38-cp38-macosx_10_12_x86_64.whl (384.3 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: genbooster-0.6.6-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 269.8 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.6-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7cef6916331130afb21c79d16e304e7d55e3b0d02eb32b9838223b2130b652b3
MD5 34b8376a6c6f7b1c835ea5609c09ec02
BLAKE2b-256 e2d31a333657ad848b28dc39f7c1f933997915f2c25f5f795b43a3ad6bc123ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d0286bc9e1f2c75b97fc40b3b4f3fc06ed72d48cd893214abf61cc33028e2207
MD5 61983c8d0c5f62b06e8baefb4b228b23
BLAKE2b-256 31f3db28ed66c950fe46413f2f8cf8d54e4cf5b11ca658d0b7b5ff9b76bb401a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4aca5f36eaf3fe976010ff04c5011cc34acd3f14331d0a987f458bce8cc124cd
MD5 800726f8a97f59e779f65694e0766c5f
BLAKE2b-256 48c20bfa986071b2d9bf6bc5d57325834df8b34ff8068e4cbf2f4134f3141988

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.6-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 269.8 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.6-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4763991165a04f310722fc02f09c3eb66ae85ab8febf910fe604e8623de73001
MD5 e2fcaecf4a01162f593d34cbc8148aef
BLAKE2b-256 d53bd4eedde7032c9f56ba2053c11b8a3a7ca08b1192d62f1afe071f6752b0dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e14220f627c87a70a5fd63487ace4b558f2cb4c039b8d4695aed50bf19fbdca3
MD5 06c96a92482788eeefddff9ad2472854
BLAKE2b-256 c4cf95525f23447456a44e1115d1f5e62c52fe3077293fb6b0c577c37e520f06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2cd2fb7f32a6002e5ca95ae3997dc4cb14492be31ad2d1740c05f019407374ad
MD5 f6de9fc86c407e01fd03f4c6d990e921
BLAKE2b-256 28078322e1f38ef5be2606866cebcc863292d2770fad142db9702f30a04d3f0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.6-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 270.3 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.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ff0a8438561cb91f8cd936244c19e91c5c2950752333461484d91f2e181e188e
MD5 e4ba7f458a2fc9c5797675535a9a9fc0
BLAKE2b-256 0f56bc9a9189443c36de976bcc253684ad190391f2be0a93c2aede53504cc45d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a8eb6536ded4fc0692f5b8ef324e4273c56e389191fc8ef7ee5356cfc1a9591f
MD5 a0f8daa0f31a2ad0d40ef066781c0e4f
BLAKE2b-256 ff5fb1932b1dd858ec35032948fe7636df3afcaca6356855a62c17eae34a81ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2610b7ca50a1f8066da3869b9394b8c62aaf622804f0254b23fda6ed6bef2683
MD5 7f89340e279d3c4f44ecfe097f656ddb
BLAKE2b-256 86d0865bdfc1775b21ad2d78a147df60b96f3ab74f1f0011be5faf590943acf1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.6-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 269.8 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.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 70769f860e7fc12d3573770a50500abd4cfab21419e4017a1ea6eaa81801f5fe
MD5 c2c4aed005246d321669d60b0e098422
BLAKE2b-256 dee3c72a834f317b9b62b9d48a06ced51fe363a2513ecdb3374a10d6b7b106d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b541e2b7e2c976753e146e17ddfa26e74a1bb4b41124ccd163f87c4ae2432a32
MD5 084e825be51b72e08cc92164116cfdf9
BLAKE2b-256 a5b3822e34bde5272778e3d3c89f09d7d55dc375c8dae6d9c496d14b9fe04961

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.6-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 39845af2aaf4c704321d40f06d7209274282042c9110e73464d25080eef08d5c
MD5 cf04bdbecbd2b2c551c09d9455452077
BLAKE2b-256 eb132b023b3e4198ad76c8d1d5a77b258711b63bb1494969ba3bdbda5e6783fe

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