Skip to main content

No-brainer machine learning solution to achieve satisfactory performance

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rektgbm-0.1.6.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

rektgbm-0.1.6-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file rektgbm-0.1.6.tar.gz.

File metadata

  • Download URL: rektgbm-0.1.6.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

File hashes

Hashes for rektgbm-0.1.6.tar.gz
Algorithm Hash digest
SHA256 6d6976f14e9401b2d159b3c4dee4e7f5b12e8aec025868b5c5630f3e566f8850
MD5 e732aecf2c28abaf8e614b170c150931
BLAKE2b-256 3f9bcf68e1130e96c962220ffe13a75f8d631d751a37beaf609ed8ae52196b90

See more details on using hashes here.

File details

Details for the file rektgbm-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: rektgbm-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.1 Linux/6.8.0-1014-azure

File hashes

Hashes for rektgbm-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 163fe19eb28e1a6e32104685bc6f16decdc2507908a59cbbe5e779a4a4f104f5
MD5 d24412b024764e88cb7bdfa26479d559
BLAKE2b-256 d37ea49ab3ffeff2b567ecc41eebd9c15ddc19b44f758bbebd115679de31fac3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page