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.1.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.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: supercheetah_tuner-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 bde47fcd76a1a253611c36c3b7ccfa841668cc36345f010be45e1c7f6adc1460
MD5 e80df7441ae1ff31cb4fd61b4ff6bd54
BLAKE2b-256 44056b6814479af0007a257ca05f5981c3fa281d7423c7f5ebd9f68db8c2dd3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for supercheetah_tuner-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e5777d96a433afb262e4ef5460fe04485083676497dd901cc21d6a7877f260e
MD5 b358ca8fe6d20efe49e0d10c7404e469
BLAKE2b-256 5e57421d66208e844c60a359c4291020b87a08d1d8bb286fb7029abe424a8b53

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