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

It might be required to install Rust and Cargo first (normally, it isn't, and you can skip this step):

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

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.8-cp311-cp311-manylinux_2_34_x86_64.whl (427.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.6.8-cp311-cp311-macosx_10_12_x86_64.whl (386.0 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.6.8-cp310-cp310-win_amd64.whl (270.5 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.8-cp310-cp310-manylinux_2_34_x86_64.whl (427.1 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.6.8-cp310-cp310-macosx_10_12_x86_64.whl (386.0 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.6.8-cp39-cp39-win_amd64.whl (271.3 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.6.8-cp39-cp39-manylinux_2_34_x86_64.whl (426.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.6.8-cp39-cp39-macosx_10_12_x86_64.whl (385.4 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.6.8-cp38-cp38-win_amd64.whl (270.4 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.8-cp38-cp38-manylinux_2_34_x86_64.whl (427.6 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.6.8-cp38-cp38-macosx_10_12_x86_64.whl (386.1 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for genbooster-0.6.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fecac5ad11013bd056f7b793aed120fb637ca4e5d883999e54236398b2794f2c
MD5 7266cce36ef1e0e6d461b342cd3ec3ef
BLAKE2b-256 80747563441bfe460aa8fed340afe6d3f864b49f235aff4de8457f59a4adbce2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 be1fc7cc407d3badbcfae046b5e6c77267b584c6abe5b7ccf3d30f10a056f680
MD5 ffa18c5306353a8f79e768f69317c3db
BLAKE2b-256 8ea5adc68507600bd042df90d56317167d8a75cd03159f779b00ebb5fe3351d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 be8651ccfe3873dc1ec25048b38c7b381b52b03bf26d366abdb18155a693b43a
MD5 9a2d42835bd3e1acb7b51a6ef9e3dae5
BLAKE2b-256 8953c15ad72cf1ab66106ee4009b3ec8495bb15d1bc6f99539088741244c1725

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for genbooster-0.6.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 470e12cad5bc8b591f3e7b14329d53c3306fbd0153f21792e8efe6a6dcb59512
MD5 42676e80533cfc83d36f958fca7a3d57
BLAKE2b-256 fe73a401d23bd7fdd62f0e90cc323eaf5f5ee409ffa5cbb7fa4ca4da8ac1d0ff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fbd0805146f502513db0dcc6c7ef9e49cb171857a254074ab624c1400b4f7d7e
MD5 c6adebfc649920c21aec1b9508f5a195
BLAKE2b-256 255621d282bbdc729b3a1213617b9fe92881cecc6dbc1bd4d9cf2e66907a4eae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 af59440d4e2f22ced5d5e4a679aafd63a0b364134c9170cff8c68a2aad1a6698
MD5 cbfe812d371095c90ca985fe8816600c
BLAKE2b-256 79c0faf874d6de53311a611a8318d1f5c7701e5adae12a7167a7b222d11cd58d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for genbooster-0.6.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e88fbd26db34f31d81f2eb564fe3d552a09c2493bee882245aa9c46961486018
MD5 20ee4c66e4ed64f9b72a3c200b0ea5de
BLAKE2b-256 8aab71fd5809dc4b3dfe8b6f7267bf9b9f0fffa141120caabc4a6b9b0b820224

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d6fc94e18d708961f3a763b5015ccc112d26a128ce4d7224b7bda1bdc3caf9bf
MD5 b9cbead363299457208488325984a63b
BLAKE2b-256 a21b1b4a37f83a7240753b7b73ce8d47fa7cfc7e1b96842ff7fc75ff3f07ff61

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9b9cde8703f95920416bc198406287656f6923ac23267d5309ec7852aba624e0
MD5 1422b99c67932448522162c5289ab011
BLAKE2b-256 23b8f23dff21ce28e802233f9f4acfafcca3551939a41ddb0dda170ca4ec24a2

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for genbooster-0.6.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d58c9989407b97b00ec101a24135e49da37eaaac79395b1ba90631547ce018ab
MD5 548ce7c3f4077bd9da822463b157ed94
BLAKE2b-256 f5b7b8ec03b0049d141781adbcbdc483230d68ff40e28e08d61fbfe193a58467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6b714ae936355a33600fa051cd63119b86b9b9af394dd781439dfe6fb3de73ac
MD5 aa49df4b9986cb5213277d2f623c7896
BLAKE2b-256 4123d7040e778f27997e914e4fdfc55428dfdd455e87f857bdd91d1ea5a6faf5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.8-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f58623b61cd662503e903d40e77478b84fea7d52d22bd20a5498305beec31f53
MD5 16ad6ff4063f8b2856fbd80990bbbadf
BLAKE2b-256 2bae31317cc1c429b320e6926be0872fa5f4e789b29340a2df19df18c5171302

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