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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hypertunercer-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 657c796d38961c9f656d12e61300d92626c147da264966274a24af195686682f
MD5 78851759cbcfc38dc1d93e860fd59ac0
BLAKE2b-256 59a21808ae576698edf9bde36ea759e75ab98efd0a98a445487760e1d8715e25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hypertunercer-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 72c2842deddf2cc8279709ecee5f60064d94d40ac63396b2208c3916621fba60
MD5 cf074b8a67de794b533537aaf6fa30ec
BLAKE2b-256 32190425fa0f1a788f611431893bfd29f6d72fad4bc88a198218df3f4919f94f

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