Skip to content

Repository files navigation

Public Alert Prediction PoC

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.

Live Demo

Try the public Streamlit demo here:

Open the demo

Installation

python -m venv .venv
.venv/bin/pip install -e .

Streamlit Demo

Run the public demo:

.venv/bin/streamlit run apps/streamlit/app.py

For 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.

Reproducible Demo

Generate synthetic raw events for three demo clients:

.venv/bin/python scripts/generate_demo_data.py

Preprocess 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_C

Train a model with the canonical CLI:

.venv/bin/python scripts/train.py --config configs/historical_host_service.yml

Build the synthetic co-occurrence artifact:

.venv/bin/python scripts/build_cooccurrence_demo_artifact.py --client Cliente_A

Most 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.

Project Structure

  • 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.

Models

The project includes a historical baseline, logistic regression, Random Forest, HistGradientBoosting, LightGBM, CatBoost, and XGBoost. Splits, searches, and metrics preserve temporal ordering.

Public Release Check

scripts/check.sh

The 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.

About

Public PoC for synthetic monitoring alert prediction, scoring, and co-occurrence analysis.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages