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

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.7-cp311-cp311-manylinux_2_34_x86_64.whl (425.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.6.7-cp311-cp311-macosx_10_12_x86_64.whl (384.1 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.6.7-cp310-cp310-win_amd64.whl (269.9 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.7-cp310-cp310-manylinux_2_34_x86_64.whl (425.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.6.7-cp310-cp310-macosx_10_12_x86_64.whl (383.9 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.6.7-cp39-cp39-win_amd64.whl (270.5 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.6.7-cp39-cp39-manylinux_2_34_x86_64.whl (425.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.6.7-cp39-cp39-macosx_10_12_x86_64.whl (384.5 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.6.7-cp38-cp38-win_amd64.whl (269.9 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.7-cp38-cp38-manylinux_2_34_x86_64.whl (425.4 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.6.7-cp38-cp38-macosx_10_12_x86_64.whl (384.5 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: genbooster-0.6.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 269.9 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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3cd41bfe78a51d9b33d5588ddb0e1c32f413537eac90a5379933331226616046
MD5 7e1ad7345f275a1f04a09fa73ec5a440
BLAKE2b-256 7b45d6f9b7493d88c59b5d83a1b8daf0308f1ccae3dc7029889f8f3787deae19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cd7da11494d1de7802f95cdf4681e536c9302d8890f896adf153a3234573a7a6
MD5 9d3a6a325fd6ba014feb6fa7fa641912
BLAKE2b-256 525ab0919057db2db413d9d4244a6ecd3e55db0caf739b5c8c68a93d2d45e41e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7678eb28be13475641db9806f3aab0880be1754be879723894a9440d5c4b6ea2
MD5 19c3a203f1189a169aa4bb3b9bfc34b7
BLAKE2b-256 672c2485d98600406b59c68568f61401d6f7bd124b517ffacb5d196bc0b9b153

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.7-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 269.9 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.7-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 33efbf49598aabf1634c6946396410be3e59fa50c0a4a368aec5de76f0ecba68
MD5 f22f4b29deb8314ccf07bd6dcca1c3e2
BLAKE2b-256 b5207f90c4c61febbcffff283b1d11359e0870dc7e17d8b79be2a6cd3d5a86dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ee2f3986fb514d00d74d98bf07e4ff1b091c4448ec4e44fe5f8a0f2a9f0d738e
MD5 ab6ba77249e44d2abe4fe0fcf75a9d0a
BLAKE2b-256 4dc5af3415586fdd7c4d8e25a7a79af800ee811b0e013484163f96ed01a3c397

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8a3644c5cc5a7439dbd123807fbf18ce0f14c775f1dbb975bd4a93b76b26d5d2
MD5 85feae81c27e39168dda6b76e39d4372
BLAKE2b-256 0ea0a0228cf1c1621f26d9142be07dcbcc57d550cbf21441d6839429b622bb30

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 270.5 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.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 11c29ecbd8ab8f705f13fd8262e5b94c5c60d49699143b7e8ee3177c801281bc
MD5 4425ba880da7992f9653592b5e3130a8
BLAKE2b-256 4ed3205f0f33ed8058e565d780ffa62e69f2921c60c2a5335d543d86840b7917

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 994b4446c14a15535bdec63ee8be8aca14778181ff413f1d43434dfecd72a67c
MD5 7d1ac5c149ec398f614619ed0b3e7662
BLAKE2b-256 6c61f2d8e168a8df2c57ed7b2140b4fc0348df1ca13ebe66b0063a65fe0de553

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b2a7f4953a12edaa4ff10e188c92b3a5ba95a97035b64c34868d9ddb89b10879
MD5 7fd303935101d123cab9e010950ef09b
BLAKE2b-256 d934ef3cc7e0b2d10e2cb75ad77580a6ae8f24409069e1cba3b67f597ab2af45

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 269.9 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.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 ef0e9db04705f8d7d9c0e02403e942bb2c470f72447caa92124fe80b0f1895ea
MD5 c7c126e7fb1e05858604919c27632703
BLAKE2b-256 1ab0a3ede9dcfc760574bfd48000c4e618b314cdb31d054a5c94f3bbdabf3866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dbfea2856fad277cb2c392462d25e2865e2c99668595227ea3a616c7bbd300f9
MD5 8243a38c95318ba79a7e846b15c5a8c6
BLAKE2b-256 8316566328a86c471a358dc2b047116fce953f0d6ddf88349832876a38f19cd3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.7-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3f60786f957ff86a988e979be7f61bc312b70c4671307aa4f44061f373c61b08
MD5 1e32fe349fe441b0e1f07b30242e7b04
BLAKE2b-256 8d58a263603c902a480801a69e6faf02dcbfa5d313cbc34e3c069dcd2fea2c78

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