Playground interactivo de hiperparámetros para modelos sklearn en Streamlit
Project description
⚗ hypertunercer
Playground interactivo de hiperparámetros para cualquier clasificador scikit-learn.
HyperTuner lanza una interfaz Streamlit completa con fronteras de decisión, curvas ROC y métricas en tiempo real — todo generado automáticamente desde un diccionario de configuración.
Instalación
pip install hypertunercer
Con soporte para XGBoost o LightGBM:
pip install "hypertunercer[xgboost]"
pip install "hypertunercer[lightgbm]"
Uso rápido
Crea un archivo app.py con esto:
from hypertunercer import tuner_universal
from sklearn.ensemble import RandomForestClassifier
from sklearn.datasets import make_classification
X, y = make_classification(n_samples=500, n_features=10, random_state=42)
param_grid = {
"n_estimators": {"type": "slider", "min": 10, "max": 300, "default": 100, "step": 10},
"max_depth": {"type": "slider", "min": 1, "max": 20, "default": 5},
"criterion": {"type": "selectbox", "options": ["gini", "entropy", "log_loss"]},
}
tuner_universal(RandomForestClassifier, param_grid, X, y)
Luego ejecuta:
streamlit run app.py
Funcionalidades
| Feature | Descripción |
|---|---|
| UI dinámica | Los controles del sidebar se generan solos desde param_grid |
| Universalidad | Compatible con cualquier estimador de la API sklearn |
| Fronteras de decisión | DecisionBoundaryDisplay sobre espacio PCA 2D |
| Curva ROC | Binaria o multiclase OvR automática con AUC |
| Métricas en vivo | Accuracy, F1-Score y Recall actualizados en cada interacción |
| Exportación | Genera el bloque de código listo para producción |
| Caché | PCA + split cacheados con @st.cache_data para máxima velocidad |
Esquema de param_grid
param_grid = {
# Slider numérico
"nombre_param": {
"type": "slider",
"min": 1,
"max": 100,
"default": 10,
"step": 1, # opcional
"help": "Tooltip" # opcional
},
# Selectbox categórico
"otro_param": {
"type": "selectbox",
"options": ["opcion_a", "opcion_b"],
"help": "Tooltip" # opcional
},
}
Compatibilidad verificada
RandomForestClassifierGradientBoostingClassifierDecisionTreeClassifierExtraTreesClassifierXGBClassifier(conpip install hypertuner[xgboost])LGBMClassifier(conpip install hypertuner[lightgbm])
Licencia
MIT © Ceron
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 hypertunercer-0.1.2.tar.gz.
File metadata
- Download URL: hypertunercer-0.1.2.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2aab83f56e6b8fe5bed878fe4c5fbbbcd5feeb58d5dc63e57c59fd16d5626452
|
|
| MD5 |
2aa305a9dfc093fa65dae4b9f5ee91e9
|
|
| BLAKE2b-256 |
d4b229984120a30f6fb5bebd9cd24f4eab3ed581487182ababa7021085894e02
|
File details
Details for the file hypertunercer-0.1.2-py3-none-any.whl.
File metadata
- Download URL: hypertunercer-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18feee51c040ec37b6e1486d27fb444c5d21223e62ee2cf68bf7d359ad08dd30
|
|
| MD5 |
157f71002df1aa8ca10ae5abc6c11de9
|
|
| BLAKE2b-256 |
ace01d39a8d977266fa51cdbf5f736e21b76476dbe6e3ee88a5ba3993167c60e
|