Skip to main content

Nature-inspired hyperparameter tuning with Cheetah optimizer

Project description

SuperCheetahTuner - Nature-Inspired Hyperparameter Tuning with Cheetah Optimizer

Python Version License: MIT PyPI Version Downloads

Table of Contents

Features

Nature-inspired Algorithm
Emulates cheetah hunting strategies (search → chase → attack) for efficient optimization

Universal Compatibility
Works with any scikit-learn compatible estimator and supports:

  • Traditional ML (RandomForest, SVM, etc.)
  • Neural Networks (via sklearn wrappers)
  • Custom models

Multi-Problem Support

mode='classification'  # or 'regression'


## Smart Optimization
n_agents=20    # Number of candidate solutions
patience=5     # Early stopping rounds
cv=3           # Cross-validation folds

## Installation

# Stable version
pip install supercheetah-tuner

# Development version
pip install git+https://github.com/UjwalWtg/supercheetah-tuner.git

Requirements: Python 3.7+, numpy, scikit-learn

## Basic Example

from supercheetah_tuner import SuperCheetahTuner
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import load_iris

# 1. Load data
X, y = load_iris(return_X_y=True)

# 2. Define search space
param_bounds = {
    'n_estimators': (10, 200),      # Int values
    'max_depth': (2, 20),           # Int
    'max_features': (0.1, 1.0)      # Float
}

# 3. Initialize tuner
tuner = SuperCheetahTuner(
    model_class=RandomForestClassifier,
    param_bounds=param_bounds,
    X=X, y=y,
    mode='classification'
)

# 4. Run optimization
best_params = tuner.optimize()
print(f"Best parameters: {best_params}")

# 5. Get trained model
best_model = tuner.get_best_model()


# Expected Output

Iter 1/30 - Best Score: 0.8933
Iter 2/30 - Best Score: 0.9133
...
Early stopping at iteration 22
Best parameters: {
    'n_estimators': 137, 
    'max_depth': 12, 
    'max_features': 0.872
}


## API Reference
# SuperCheetahTuner Parameters

model_class =>	Class => sklearn estimator class (Required)
param_bounds =>	dict => {param: (min, max)} pairs (Required)
X, y	=> array => Training data (Required)
mode =>	str => 	'classification'/'regression' (default value 'classification')
n_agents => int => Population size (default value 20)
max_iter => int => Maximum generations (default value 30)
patience => int => Early stopping rounds (default value 5)
cv => int => Cross-validation folds (default value 3)
random_state => int => Random seed (default value None)
verbose	bool => int => progress	(default value True)

# Key Methods
.optimize() → dict: Returns best parameters

.get_best_model() → estimator: Returns fitted model

.get_best_score() → float: Returns best CV score


## How It Works 

# Search Phase (Exploration)

if np.random.rand() < 0.3:
    new_params = random_sample(bounds)

# Chase Phase (Exploitation)

else:
    new_params = best_params + noise * direction

# Attack Phase (Intensification)

if score < best_score:
    update_best()

## Citation
If you use SuperCheetahTuner in research:

bibtex
@software{SuperCheetahTuner,
  author = {Ujwal Watgule},
  title = {SuperCheetahTuner: Bio-Inspired Hyperparameter Tuning with Cheetah Optimizer},
  year = {2025},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/UjwalWtg/supercheetah-tuner}}
}

## License 
MIT License

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

supercheetah_tuner-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

supercheetah_tuner-0.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file supercheetah_tuner-0.1.0.tar.gz.

File metadata

  • Download URL: supercheetah_tuner-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for supercheetah_tuner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2ff7f9423b76a9bc543f16a26282208ddb16bd4e838007b0eacbb5866f6ab86
MD5 24338ed0469a0dcb136087e3417370cc
BLAKE2b-256 1f13523fc7d655ecad34f5f5a4c97f9490bc82881a2530663965f0df264b4aaa

See more details on using hashes here.

File details

Details for the file supercheetah_tuner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for supercheetah_tuner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd8bdf1f37a1fee4c8f7c6c812191ebf1135e2fb6024b140b89f0659b761f32
MD5 1cdb48786ff8179abdfc9cfabc2a8f12
BLAKE2b-256 e2d9f5a25d4b90f3d4b49704e8dba4fac0b2f1b7e2c6baaf09063bb5594a543f

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