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

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.2-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.2-cp311-cp311-macosx_10_12_x86_64.whl (383.8 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.2-cp310-cp310-manylinux_2_34_x86_64.whl (424.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.10macOS 10.12+ x86-64

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

Uploaded CPython 3.9Windows x86-64

genbooster-0.6.2-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.2-cp39-cp39-macosx_10_12_x86_64.whl (384.2 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

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

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.2-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.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.2-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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c3ccea6b42ea26b67fd31b34bd8f974057efe5ac210fee6da59b2c67b685a0b9
MD5 79910252da4ac4a80b6d6918404e0c57
BLAKE2b-256 14275306ac6623dd4a9dc8191f84b7aace5b83bb743268a3830e38c6da39e43f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ef20429b7ede1042f58b20545f97a9d48de95fe89184408d7511cf3a7fecb588
MD5 aa267879ff3b072f81577de356e74eb9
BLAKE2b-256 04be35b8487107dc7fa4f19a8abca857a26e7321d06359482923937a68219953

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 331ee4d935167e12c2c8233fa57955a20ebae80742b89fa1b59fc302294d1a53
MD5 bff8f319242e2ff0dde0825cf48bf245
BLAKE2b-256 5d09ec53ce8673878bc3aa2cf69801914f8a7e3fed195de5cbcb8a6f6787703b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.2-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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3e67ce1647c5d153481ddfb94f3d73d8df67bdf72fe975ffc4a693f2cfbfda10
MD5 3e9138f3f0c948a1ab329d6674c63242
BLAKE2b-256 aba150af20f7af41acf4e2ad127591adf5f1fc4ff1efff877db043e39ce5e43a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bc880e910aa88a4a091f3f0c83e80df04dfc869cc4a2debd3cf98c5356fd7020
MD5 e1e185cfefed150cbad2d29c587b7697
BLAKE2b-256 a7deab59cf113a20ece8c210b87b8bf5aae3993abf578058d93895bcbd557162

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4bad2d522a146aac7a68b19f086cfadb652a26e2c1edfb9abb9cd2f93a7666be
MD5 2a0e596bb73428f119d80523e5ac5d9a
BLAKE2b-256 9998423b1c349fcf5162bd50a7626b85e2d66b7937ee368b68747c5dbf04f6d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.2-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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 ae1efab1486e372e5629c1e47ac12b31d6c96a57bb07868e608941eeb0fb668e
MD5 564e5518437d9f862a640579144abcd9
BLAKE2b-256 080f886ac370add1d29726f90cac2aa5c5f8c34ceec77bfd93acba4cc7bac11c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c2ae8930ce94a18bd9742a012cae16d633a8cd516b9e07dce9a53d2bc97b4a9c
MD5 8fabc7d17a0077d0be947ee3faeac03a
BLAKE2b-256 b3fd926b5c094079bc2d9389089a1e15f9fe84fe666a8672756cc2684fa0106f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 74c436362398ce041f1ec9d687d4c4aa3656e640c5af5377f2c6b5738fdc466c
MD5 dd6b24e33b3f1ccb35165153d5bbb59f
BLAKE2b-256 b222008868e85b23d87c4264d3fa3cd9ada4bd55985aedced6472efd2ead6b54

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.2-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.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8236986faa5c82066c16fcee02989ab07ba7473d557626b0295f0f6f3881e34f
MD5 784294290c27fab93386a487beb51f53
BLAKE2b-256 81b56f6cc4ad2ad147b7fcd9d445e7815c98f3a5939f118b9d8792e476e0c3e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ba701673dc9c9ba72c84deff2c5ed6bf7a393d95331e1de96d254fb5470c3ddc
MD5 b6aef6c96b1613c8bd74cdc6f72d7bd2
BLAKE2b-256 da5728e86afea256c19fbbc5f4d997f4d738874c0cec16c99f838a23da40e49c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.2-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bd5e427b546e67eee35511e45526004c92d2a458a6e4ee0551b3cdc890e6bd18
MD5 cdd4fccb21f1338356c194b83131a5de
BLAKE2b-256 f018ec88395a7094f7c3ccf959881b7923f257bb2722580adeb43bba6195696e

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