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

Uploaded CPython 3.11Windows x86-64

genbooster-0.5.1-cp311-cp311-manylinux_2_34_x86_64.whl (408.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

genbooster-0.5.1-cp311-cp311-macosx_10_12_x86_64.whl (368.6 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.5.1-cp310-cp310-win_amd64.whl (255.1 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.5.1-cp310-cp310-manylinux_2_34_x86_64.whl (407.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

genbooster-0.5.1-cp310-cp310-macosx_10_12_x86_64.whl (368.5 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.5.1-cp39-cp39-win_amd64.whl (255.6 kB view details)

Uploaded CPython 3.9Windows x86-64

genbooster-0.5.1-cp39-cp39-manylinux_2_34_x86_64.whl (408.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

genbooster-0.5.1-cp39-cp39-macosx_10_12_x86_64.whl (369.1 kB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

genbooster-0.5.1-cp38-cp38-win_amd64.whl (255.1 kB view details)

Uploaded CPython 3.8Windows x86-64

genbooster-0.5.1-cp38-cp38-manylinux_2_34_x86_64.whl (408.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

genbooster-0.5.1-cp38-cp38-macosx_10_12_x86_64.whl (368.9 kB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: genbooster-0.5.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 255.1 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.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b5912fee79c52be11a489d8562af11e1a3691a8384959dc41e17cfef3a84e9f1
MD5 5da607b2b407af7e84dec62303bb25d7
BLAKE2b-256 9209904c9b432449cfdbb34c67448fa1e402f0407cc9d1b1c0871e1fd482802e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7c9698f3807ba76f4e6ed0115a2ffc2db0962a2937895885c3de27c8887a1a27
MD5 774cd3bd0390e2007085ff84a20594ed
BLAKE2b-256 58fc11fa13921d4974c894053031e62961a29e6a3bcd7fa854ea8cebc1cc5855

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6e99dc4d7aebd60f75e8c1dab1e1b92c0e49897675538f5f0740427e46f4a6b4
MD5 375e48be857a99983e1bd7f31e8f723f
BLAKE2b-256 a7fbf7af0fabad0781f8fc72296c18d5944c18a1dded61f0042ea06f81f30806

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 255.1 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.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 06eb02b449fdf809cb835d1461e91bdc6dbdf312faf55808151b7e02d765b4b6
MD5 9a7baf4ceae320f3c16004199ac163e1
BLAKE2b-256 26bca8435abafd72aed19c96a306e99e88035d86e9b9be6126f9f54b25512989

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bb42d0b166c40175027aaf07c220c84c1e68454faccf9fe276bc36d23eefd6d6
MD5 fb2af5d0ff5024ab12c26db0d5c90f80
BLAKE2b-256 25892868744032d198e7593c47a2c4cc6a9e8c33c5922f72b3ad6382ead0abcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d8aecb5593888022064b8bc65e73ac5395b0b536042d5957ff82680c30ddfee4
MD5 9a2d6c11a0ed9c2afe4d70ec27cdbae4
BLAKE2b-256 31d809e90ff6f5867e5e933c404faeb0fddcbd5232ec4820c96b6626fe46880c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 255.6 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.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8c63c2fd823b3f01abdbcc744cdd122ad0c003dc244016644fc78eb205ba13b7
MD5 b0ed8ea9669914c8794cb91363633b85
BLAKE2b-256 dedbf670eba8b2603922f617c683c977cca6fc561a6e779213efa5e62292fda2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 539ef64954a91348a845cee800502a481efe66f25d8928d9972e4254a30d11ef
MD5 fc973ffac628d7d7c1d68842df6340ea
BLAKE2b-256 824e058935b74f077d8f33cceb3e66cff87faf0973478bd7bc1f7524708c42d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d7cfc284bfdba90621b0c5ccc1a37d1245852fe70a0cf966663063c4b8b12e04
MD5 7708f0b2ceb7c54017c530b2d5ad01cd
BLAKE2b-256 6c89610de760d92318b320f057bddc97798f48c714c8a7022e50fab4576ce2bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.5.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 255.1 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.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7fbbc5167546d34c7216ea23d15f91465a14f049d2b196affc63d8e7b0a4bdb9
MD5 ab06a0243e7774582d4602efce8423a5
BLAKE2b-256 a0314a85f651c4f6e8e273d1bb6487967b6bea7c19aba6afff5298a542f699d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 838558fc8d97bd9e16d72e5bc27be40ec9c451b58c973ef035c3be693218f9ba
MD5 ed8d3a47a6775fca6abbdbf315cbfec3
BLAKE2b-256 b42063041e24ef96c123352d49dce8560cb74dee160cd0c4457d29a5004b1f16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.5.1-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1323fe636aaced72b707f6e924b8b46914d80697a5b39e93e2a499abf52b0de7
MD5 c176305f1aaf60eeff7b6df4229949e9
BLAKE2b-256 dcc949c0d81c19527172d93897230b44d712757a2f5d2cb979b79d8dfce9a229

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