Skip to main content

logo

Release Pythonv License Lint Test

Are you sick and tired of the endless cycle of model comparisons and hyperparameter tuning? Meet RektGBM, your ultimate no-brainer solution to building good enough performance machine learning models. RektGBM seamlessly combines LightGBM and XGBoost, two leading gradient boosting frameworks available today.

RektGBM simplifies the complexities of model building and optimization, delivering a robust, yet easy-to-use platform that empowers you to achieve superior results without the hassle. With the integration of Optuna, a cutting-edge hyperparameter optimization framework, RektGBM fine-tunes your models to perfection, ensuring optimal performance with minimal effort.

Installation

Getting started with RektGBM is a breeze. Install it using pip:

pip install rektgbm

Key Features

  • RektDataset: A wrapper for datasets used in RektGBM and RektOptimizer.
  • RektGBM: A versatile gradient boosting model that leverages the power of both LightGBM and XGBoost.
  • RektOptimizer: An Optuna-based optimizer that fine-tunes RektGBM hyperparameters for maximum efficiency.

Usage

Example workflow

Here’s a quick example to showcase how you can use RektGBM in your machine learning pipeline:

$ rektgbm --help
Usage: rektgbm [OPTIONS] DATA_PATH TEST_DATA_PATH TARGET [RESULT_PATH] [N_TRIALS]
╭─ Arguments ───────────────────────────────────────────────────────────────────────────────────╮
│ *    data_path        TEXT           Path to the training data file.  [required]
│ *    test_data_path   TEXT           Path to the test data file.  [required]
│ *    target           TEXT           Name of the target column.  [required]
│      result_path      [RESULT_PATH]  Path to the prediction results. [default: predict.csv]
│      n_trials         [N_TRIALS]     Number of optimization trials. [default: 100]
╰───────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Options ─────────────────────────────────────────────────────────────────────────────────────╮
│ --help          Show this message and exit.
╰───────────────────────────────────────────────────────────────────────────────────────────────╯

$ rektgbm train.csv test.csv target predict.csv 100

Alternatively, the same functionality is available through Python.

import pandas as pd
from rektgbm import RektDataset, RektGBM, RektOptimizer

# Prepare your datasets
train = pd.read_csv("train.csv")
test = pd.read_csv("test.csv")
y_train = train.pop("target")

dtrain = RektDataset(data=train, label=y_train)
dtest = RektDataset(data=test, reference=dtrain)

# Initialize RektOptimizer to automatically detect task type, objective, and metric
rekt_optimizer = RektOptimizer()

# Optimize hyperparameters over 100 trials
rekt_optimizer.optimize_params(dataset=dtrain, n_trials=100)

# Initialize RektGBM with the optimized hyperparameters
rekt_gbm = RektGBM(**rekt_optimizer.best_params)

# Train the model
rekt_gbm.fit(dataset=dtrain)

# Make predictions on the test set
preds = rekt_gbm.predict(dataset=dtest)
pd.DataFrame(preds).to_csv("predict.csv")

# DONE!

More Examples

For more detailed examples, check out the Examples section.

Contribution

Welcome all contributions! Please note that this project might have some bugs, so your contributions in identifying and fixing them are especially valuable! Whether you want to create an issue or submit a pull request, your input is appreciated. Feel free to get involved in any way that suits you.

Metadata

Release files for rektgbm 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rektgbm 0.1.6
File Size Uploaded Provenance
rektgbm-0.1.6.tar.gz 13.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for rektgbm 0.1.6
File Interpreter ABI Platform
rektgbm-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 30.0 kB

Release files / rektgbm-0.1.6.tar.gz

Download URL rektgbm-0.1.6.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6d6976f14e9401b2d159b3c4dee4e7f5b12e8aec025868b5c5630f3e566f8850
BLAKE2b-256 checksum
How to use checksums
3f9bcf68e1130e96c962220ffe13a75f8d631d751a37beaf609ed8ae52196b90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

Release files / rektgbm-0.1.6-py3-none-any.whl

Download URL rektgbm-0.1.6-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
163fe19eb28e1a6e32104685bc6f16decdc2507908a59cbbe5e779a4a4f104f5
BLAKE2b-256 checksum
How to use checksums
d37ea49ab3ffeff2b567ecc41eebd9c15ddc19b44f758bbebd115679de31fac3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

Security for rektgbm 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page