Hyper-parameter search that rises from the ashes of interrupted experiments
Project description
HyperPhoenixCV 🐦🔥
"Rise from the ashes of interrupted experiments"
HyperPhoenixCV is a smart hyperparameter tuning tool that, like the mythical phoenix, resumes after interruptions and continues searching for optimal solutions. Never lose hours of computation due to unexpected stops again!
Other languages: Русский
Installation
pip install hyperphoenixcv
Or install from source:
git clone https://github.com/valeksan/hyperphoenixcv.git
cd hyperphoenixcv
pip install -e .
Why HyperPhoenixCV?
The name HyperPhoenixCV refers to the mythical phoenix – a bird that rises from its ashes. In the same way, your hyperparameter search can "rise again" after an interruption, continuing from the last saved checkpoint instead of starting over from scratch. The "CV" in the name indicates the connection with cross‑validation, emphasizing the library's specialization in machine learning.
Differences from plain GridSearchCV:
Resumability
Ran out of time or resources? Just run it again – it will continue from the last checkpoint!
hp = HyperPhoenixCV(
estimator=model,
param_grid=param_grid,
checkpoint_path="my_experiment.pkl" # Key parameter!
)
hp.fit(X, y) # Interrupted? Run again with the same path
Smart optimization
Bayesian optimization helps find better parameters faster.
hp = HyperPhoenixCV(
estimator=model,
param_grid=param_grid,
use_bayesian_optimization=True,
verbose=True
)
Flexibility
Exhaustive search, random search, or predictive optimization – choose your approach. Multiple metrics supported.
hp = HyperPhoenixCV(
estimator=model,
param_grid=param_grid,
random_search=True,
n_iter=50 # Number of random combinations
)
hp = HyperPhoenixCV(
estimator=model,
param_grid=param_grid,
scoring=['f1', 'accuracy', 'precision']
)
Automatic saving
All results are saved to checkpoints and CSV.
hp = HyperPhoenixCV(
estimator=model,
param_grid=param_grid,
results_csv="experiment_results.csv" # Results saved to CSV
)
Compatibility
Fully compatible with the scikit‑learn API (if not, we'll fix it).
🚀 Quick Start
from hyperphoenixcv import HyperPhoenixCV
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import LogisticRegression
# Create a pipeline
pipeline = Pipeline([
('tfidf', TfidfVectorizer()),
('clf', LogisticRegression(max_iter=1000))
])
# Define the parameter grid
param_grid = {
'tfidf__max_features': [1000, 5000, 10000],
'tfidf__ngram_range': [(1, 1), (1, 2)],
'clf__C': [0.001, 0.01, 0.1, 1.0]
}
# Create and run HyperPhoenixCV
hp = HyperPhoenixCV(
estimator=pipeline,
param_grid=param_grid,
scoring='f1',
cv=5,
checkpoint_path="nlp_experiment.pkl",
verbose=True
)
# First run (may take a long time)
hp.fit(X_train, y_train)
# If the process was interrupted, just run again:
hp.fit(X_train, y_train) # Continues from the last saved checkpoint!
# Get results
print("Best parameters:", hp.best_params_)
print("Best F1 score:", hp.best_score_)
# Get top‑5 results
top_results = hp.get_top_results(5)
print(top_results)
🙏 Acknowledgments
Thanks to the scikit‑learn community for the foundation on which this library is built.
Project details
Release history Release notifications | RSS feed
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 hyperphoenixcv-0.2.1.tar.gz.
File metadata
- Download URL: hyperphoenixcv-0.2.1.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
624bbb89e21a0d2d746afbd13d2de62ca576e394432a1d67522e08e9a692d8e0
|
|
| MD5 |
b5c846bf70b7f61ff93cc24c73d4f641
|
|
| BLAKE2b-256 |
b95161fe4df18aa5c8156e13cdfcbaf0ee7e2254eedf4ab62dfdf21c3b9feb58
|
File details
Details for the file hyperphoenixcv-0.2.1-py3-none-any.whl.
File metadata
- Download URL: hyperphoenixcv-0.2.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
637b7bb5a02fea8cd139c17cb6a2c7473fed7bc867a6f3f59d64dbe26b0942f3
|
|
| MD5 |
3d34b7a6b766f6f2ce5ded02107bb5a8
|
|
| BLAKE2b-256 |
11519503df4a0f4f06914df9083b2e9f5b79ffaae87337a1c72c017774f0ca4b
|