Self-contained project for experimenting with alert prediction and alert co-occurrence analysis. The public version uses only reproducible synthetic data and does not include real customer data, real customer names, or results derived from real customer systems.
Try the public Streamlit demo here:
python -m venv .venv
.venv/bin/pip install -e .Run the public demo:
.venv/bin/streamlit run apps/streamlit/app.pyFor hosted deployments such as Streamlit Community Cloud, the app uses
runtime.txt and requirements.txt to install only the lightweight runtime
dependencies needed by the demo.
The Streamlit app includes two views:
Scoring de alertas: explores the saved model predictions and lets you adjust the decision threshold.Co-ocurrencia: explores synthetic service co-occurrence relationships.
The demo expects a small set of synthetic artifacts to be present in the repository:
- synthetic raw events under
data/clients/*/raw/ - a demo scoring run under
outputs/runs/Cliente_A-lightgbm-20260612T101344Z/ - a synthetic co-occurrence artifact at
data/clients/Cliente_A/causal/demo_artifact.joblib
These files are intentionally synthetic and safe to publish.
Generate synthetic raw events for three demo clients:
.venv/bin/python scripts/generate_demo_data.pyPreprocess each client and build the unified dataset:
.venv/bin/python scripts/preprocess.py --client Cliente_A
.venv/bin/python scripts/preprocess.py --client Cliente_B
.venv/bin/python scripts/preprocess.py --client Cliente_C
.venv/bin/python scripts/preprocess_unified.py --clients Cliente_A Cliente_B Cliente_CTrain a model with the canonical CLI:
.venv/bin/python scripts/train.py --config configs/historical_host_service.ymlBuild the synthetic co-occurrence artifact:
.venv/bin/python scripts/build_cooccurrence_demo_artifact.py --client Cliente_AMost generated CSV files, processed datasets, MLflow runs, local databases, and ad hoc outputs remain ignored by Git. Only the minimal synthetic files needed to run the public Streamlit demo are allowlisted.
alertas_tfg/: reusable preprocessing, training, evaluation, and analysis code.scripts/: reproducible CLI entry points.configs/: YAML experiment configurations.apps/streamlit/: scoring and co-occurrence demo app.notebooks/: lightweight exploration notebooks without persisted outputs.tests/: pytest suite with synthetic fixtures.data/clients/: synthetic demo inputs and local generated data.outputs/runs/: allowlisted synthetic demo run plus ignored local runs.
The project includes a historical baseline, logistic regression, Random Forest, HistGradientBoosting, LightGBM, CatBoost, and XGBoost. Splits, searches, and metrics preserve temporal ordering.
scripts/check.shThe check runs the test suite and fails if it detects generated artifacts that should not be versioned, executed notebooks, absolute local paths, or possible secrets.