Skip to main content

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

  • RandomForestClassifier
  • GradientBoostingClassifier
  • DecisionTreeClassifier
  • ExtraTreesClassifier
  • XGBClassifier (con pip install hypertuner[xgboost])
  • LGBMClassifier (con pip install hypertuner[lightgbm])

Licencia

MIT © Ceron

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

hypertunercer-0.1.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hypertunercer-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypertunercer-0.1.1.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

Hashes for hypertunercer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 09865ff51040beca00c6f2bd9def5007dab1415c747a4320beefb414af0721a2
MD5 974c1f6ccbe600053bb5df009826bb42
BLAKE2b-256 4db1d05750ee338455ca6bb169d5cdf39ed4d50840dfeb66552b310eace4dc23

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypertunercer-0.1.1-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

Hashes for hypertunercer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9c978ae864ae32f57b396df82f9afa5730c4724aa85f6931c8173565a479d5fb
MD5 cef14513387d0504f94980919e290c81
BLAKE2b-256 d2b79865ac7e6c9978db9b331fb72155d6fe4bb5290de62479475e97727b28e5

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