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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

genbooster-0.6.5-cp310-cp310-win_amd64.whl (269.7 kB view details)

Uploaded CPython 3.10Windows x86-64

genbooster-0.6.5-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.5-cp310-cp310-macosx_10_12_x86_64.whl (383.7 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

genbooster-0.6.5-cp39-cp39-win_amd64.whl (270.3 kB view details)

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9macOS 10.12+ x86-64

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

Uploaded CPython 3.8Windows x86-64

genbooster-0.6.5-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.5-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.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: genbooster-0.6.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 269.7 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.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 88acb22625c0908ab447df0a3981aa93e4749f14c83cc120dbf31e5a1f4c37f9
MD5 95d4c3502221502bb5dc1af6191b212e
BLAKE2b-256 bb6ae0b406f1613cfe83176675406eb9cbb42a4453054b5c08d2413b4cc21792

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26531a2ab47e241be7da58d470f211cfe501f108f141400b3fe8e89ea6dcc9eb
MD5 6805a728b3301a2349d9e3552d939418
BLAKE2b-256 3f6ea9d7327ebe11990543a4b0d06d90cfa2dda9f95c6fbf7adf799ec96a844c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 07e0271e4ffc1333b88833d9f09a0ba263997e41a520533cb6fc107882353f9a
MD5 0a965b3f64ebb72f00aa210a9c6d1367
BLAKE2b-256 3fa901f60430e7069fd7cb86d8bd4afa58ec9d5a33bd54f711c83e3e458c6e05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.5-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 269.7 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.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 9174cd99e961d3094379c6e77b01f160dd39f51bb3aa3a6b6b39663bfd8594d2
MD5 d0da828b2c2b6ce49dc81f8d91772d3b
BLAKE2b-256 f13ef1fb2034e9157fc9d2d22868bd986a86aab29b094a4193c3fb642805255f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 353902cdeaf5074ab981797c4c7145905fe38cc608b8d35d3ee80639ec76fd66
MD5 2af20ab77501c8759196f7cf661a1564
BLAKE2b-256 6f107e678c459a2f80f19989f96e4c450d4f72980d7b501b6f25031ddc742f73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d0610d33db2aacbb8ab9f7d893fdb9edb585c87233ce867d9b05469cbee38bd7
MD5 4466eeeb7ace5b7af3dcee74d62e4be3
BLAKE2b-256 52667eda643d0c491e3618dabfbd6e826b02506e73e999cc816ef2f8b283d372

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.5-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 270.3 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.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 72f4b2cf1f7351f2807b7bfa0baf2f048ac127a7890db7a8b023b90ae9d32ab0
MD5 5fae2bea6a26db9b2f9bb7cc05729bf6
BLAKE2b-256 79b173878c94ff4db27a82eea48b9059f58deb125e24387f8d5c5bbede584448

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 148f5c932cb5632581ee06f8336977003bd44264ad755e464e3c2d658e70c3c5
MD5 2a43b4125b50210c0c0552e16c6275e5
BLAKE2b-256 cf959716e9a46949830c081a49e122cd5f6870f4c76f706220354e963d4708ee

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a83783455341b1d7550c99d600246bee917ce584a7e0e3cc8159a7ea0e6f5a5b
MD5 1efae064a401ec9a5d4e2924f86ba5c7
BLAKE2b-256 8bc860cc4d5c92dafc6e34076048feee14af76d341f2deddfcd93bedaf9ac9f4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: genbooster-0.6.5-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.5-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 d55be7120239f52d02734c64c66e8e90f7e6e286f0de2265e32d677b539ab335
MD5 8b100875ac112077087f62f339451495
BLAKE2b-256 50b2a4d0a38f380eaad16cd0f3454dc45982c5520ea62f73f463ea2161fbc857

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c38d52e9ec8e6b8390ba9343f6b49334b92ce964f479aeb790c21ab495ea4cf7
MD5 65e985879685942e3744d6f196c5b0d2
BLAKE2b-256 af869f45aa7f00ba92cb39f91cf8118f784469b78b875c643e88fda3cde88d98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for genbooster-0.6.5-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a986181f12f5553750346e0719b2f324fce99c9dcf7fd101048edb79238d8dc2
MD5 63fa13a74b1792b26651f96d82f69c50
BLAKE2b-256 e61fdfc0fafed0fd5de89796b1b7ea89658361987f6793558f98faaf1d97670d

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