Advanced hyperparameter tuning using grid search for ML models
Project description
📊 GridSearchHelper: Advanced Hyperparameter Tuning Library
Welcome to GridSearchHelper, a powerful and flexible hyperparameter tuning library designed to make model optimization effortless! 🚀
✨ Features
- 🔄 Automated Hyperparameter Grid Generation for supported models
- 📈 Seamless Integration with Scikit-Learn's GridSearchCV
- ⚡ Supports Classification & Regression Models
- 🛠️ Customizable Parameter Grids
- 🎯 Easy-to-Use API
📌 Installation
pip install GridSearchHelper
🚀 Quick Start
Import and Initialize
from GridSearchHelper import perform_grid_search
from sklearn.linear_model import Ridge
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import load_diabetes
# Load dataset
data = load_diabetes()
X, y = data.data, data.target
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=42)
# Scale features
scaler = StandardScaler()
X_train_scaled = scaler.fit_transform(X_train)
X_test_scaled = scaler.transform(X_test)
# Run Hyperparameter Tuning
best_params, best_score, grid_search = perform_grid_search(
model_name='Ridge',
X_train=X_train_scaled,
y_train=y_train,
cv_folds=5,
scoring='neg_mean_squared_error'
)
print(f'Best Parameters: {best_params}')
⚙️ Supported Models
- RandomForestClassifier 🌲
- GradientBoostingClassifier 🔥
- SVC 🛡️
- LogisticRegression 📊
- Ridge 📏
- Many more...
🔧 Configuration
To add custom hyperparameters, simply pass them as a dictionary:
custom_params = {
'alpha': [0.01, 0.1, 1, 10],
'solver': ['auto', 'svd', 'cholesky']
}
perform_grid_search('Ridge', X_train_scaled, y_train, additional_params=custom_params)
📜 License
MIT License © 2025 Abdulla Alimov
🤝 Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
🌟 Star this repo if you find it useful!
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file GridSearchHelper-0.8.0.tar.gz.
File metadata
- Download URL: GridSearchHelper-0.8.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
486cfb6578f958a8b4fd25c6f23c0dc7ff6d760874c15483cd5ed52b81964c41
|
|
| MD5 |
97d402b0c6c3d99ad321e6a6eb7bfc65
|
|
| BLAKE2b-256 |
71fbf091cacd8db7a88781daff23aff1197a32421ba31c9574c20f6b5c78d2c6
|
File details
Details for the file GridSearchHelper-0.8.0-py3-none-any.whl.
File metadata
- Download URL: GridSearchHelper-0.8.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61fa93ed7f8595835f32c11727f6b5e88939e9fec3c66a9aceef0e55fdbe4317
|
|
| MD5 |
11d1b8f6d45cf92d2752a8381ddefce5
|
|
| BLAKE2b-256 |
d6fb15e9755d55fd27c86f48a86574b6e43fb004ba30d3b66a7b82e2ad00b82d
|