import streamlit as st st.markdown( """ # KPI Anomaly Detection Documentation ## 1. Objective Detect KPI trend breaks (change points) per cell and export anomaly-focused datasets for investigation. ## 2. When to use this tool Use this page when you need to: - detect abrupt KPI behavior changes - isolate affected cells per KPI - visualize change points over time - export anomaly evidence to Excel ## 3. Input files and accepted formats - Required: KPI file in `.csv` - Expected delimiter in current implementation: `;` ## 4. Required columns The first 5 columns are interpreted as: 1. date/time 2. controller 3. BTS 4. cell 5. DN All remaining columns are treated as KPI series. ## 5. Step-by-step usage 1. Open `KPI Analysis > KPIs Anomaly Detection`. 2. Upload the KPI CSV file. 3. Set `Penalty` (lower = more sensitive, higher = less sensitive). 4. Review detected KPI list and affected cells. 5. Inspect plot with detected change points. 6. Generate and download Excel anomalies report. ## 6. Outputs generated - interactive anomaly plot for selected KPI/cell - per-KPI anomaly datasets - downloadable Excel file (one sheet per KPI) ## 7. Frequent errors and fixes - No anomalies detected. - Fix: reduce `Penalty` or verify KPI variability. - Parsing/date issues. - Fix: check first column date format and CSV delimiter (`;`). - Too many false positives. - Fix: increase `Penalty` and inspect noisy KPIs. ## 8. Minimal reproducible example - Input: CSV with at least 30 points per cell and one KPI showing a level shift. - Action: upload file, set penalty to `2.5`, inspect one KPI/cell. - Expected result: chart with change-point markers and exportable Excel output. ## 9. Known limitations - Cells with fewer than 30 points are ignored. - Detection quality is sensitive to noise and seasonality. - Current uploader is configured for CSV input only. ## 10. Version and update date - Documentation version: 1.0 - Last update: 2026-02-23 """ )