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.2.tar.gz (4.6 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.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: supercheetah_tuner-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 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.2.tar.gz
Algorithm Hash digest
SHA256 e9b065a6591157d55e885bd9e370dcdb9731d11c62af95b6cd6ffecda6add20b
MD5 2344e02edac26cb635e5d43c049a7848
BLAKE2b-256 d73a986be5a82cf64a028158b52c2ba54b998e3fc11afb488d1a88f29ed2d5b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for supercheetah_tuner-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5255ab1fdb5e5086fce2f33bdba49e98a5f1666568f86613b478a5a6f4bec4cc
MD5 afa99c79ac403eb1722fc867408d57e6
BLAKE2b-256 657ce8751e27cd5b6b8645169fe43c5421acb1dc64a2510018bc33f0f733dfd3

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