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

Uploaded CPython 3.11Windows x86-64

genbooster-0.6.3-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.3-cp311-cp311-macosx_10_12_x86_64.whl (383.9 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.3-cp310-cp310-manylinux_2_34_x86_64.whl (424.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

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

Uploaded CPython 3.10macOS 10.12+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 10.12+ x86-64

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

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.3-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.3-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.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4697453091080f6feaa78aeb4409f84e900ec0359dd25b3a86506c80a045709c
MD5 70bc377737e29037aa8a5a797368f2f6
BLAKE2b-256 9a8ba3c5d5f179fdd68161d8b6b9ccbd4d13d169672ee38eac8ebfd542494ca3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 79967d588568ddf4c862756e4632f4def90fd7283abebb7c7b2b77f733d89191
MD5 3bafdff24200125046db045c98a90616
BLAKE2b-256 1052111d07667d135af1a04c0eebf06bfb7c8cc3ace351044c83baf2b004138c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c358871d5e6b05c4652cae77fef0103ee3855afee644f63b9fb704dd44953125
MD5 86f39fc7b5191582d67618eb499b183a
BLAKE2b-256 e494ef7be5dba14109750ee5447f2150fc3e1f8b78081f604af25c310a99d74e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 93c8b27d9001b11813d85cec94579ae3eff18defd9435ff08209b086bc89673c
MD5 2b78ac8c5ce7797b160ec6e7ee48ea84
BLAKE2b-256 c816824188518d99f02e6306ada68347d178aeffcb87782de8c60dd017ff6f6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8db58a4d474ffc9d14f5aeefc3a9c5022c489b6a49828bdfbd3bf7aeab4c466d
MD5 be58c33c4bdb045c8d760e2b40500aeb
BLAKE2b-256 b544ae8aad8fbe31feaac0ea15977d9c7312826a0bff84e5c726ebe68c25171c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 512822986d8880d6d6296dc4defe5e3cd06e3d3a4d6efd4d43c60778ae7b8b35
MD5 46ea253a9015068d77026525de618fad
BLAKE2b-256 f6b79f8156b55e2cebfa866b12527235ad8a9f2eef2beb2feb92eff8351f9253

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 2dfdfd4801b63e0a092c9b7a69ee34d6c08b37fae7a2854549c230b386cf0caa
MD5 a30bec7231a376ad277ef8ab857b1c97
BLAKE2b-256 51c1891c0583bf5990b54d170a0518d031bc430a2356250483961ff11cb7f759

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 577a2950d01bb624801e41013af72aa008084b03126ab7569e338a407f6fe96a
MD5 289c223ec81b8fc05f58f0a02cfc9a1b
BLAKE2b-256 186443d764a47f534db98215237b717c3099b2d8a3a406c0103e1679d8a12fcb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7c5eb704f71a99dad45e6ad0797ec35294ec3ab722a7c705dce0e1542f4316ce
MD5 0de322ec17523fc18974ae2431b3cee7
BLAKE2b-256 852646d8528942a40ced0453898ff3fa970c075a7a43fe7f34ae4d6d6c168e35

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.3-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.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c350a6d82cda50aecc78deec147ce93b605491b76ba5711d70306c4802d61308
MD5 4702d58899da1e04bb252c8edf87c3fd
BLAKE2b-256 5cac8bd71e045ca1e83babf3fa854e4c5ecb55dddfd43a68e19cf76906f631fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f4b0020d35fad00a29362bcf766ce61fd82e9e3c27cf61a1e075d2cc69c336a8
MD5 0090f23fa16f8a1d28446549f7ef6834
BLAKE2b-256 dd6a0f76f054e6ce6bdd62b8e4fc329b0af29e7f06603d3ed00bc1a653abc9a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.3-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 142c4050ad7d120aaa3af85a87d4537481bba48bb8a2d209b3e01b2608b5f621
MD5 da0a4b565e522f28252c15b4073c54dc
BLAKE2b-256 dc722625232ffb464dc0505d4590b711918f115e6b543ae9a65a8bce6c2c0a97

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