# paullo0106/prophet_anomaly_detection architecture

> Architecture diagram of the GitHub repository paullo0106/prophet_anomaly_detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/paullo0106/prophet_anomaly_detection
- Repository: https://github.com/paullo0106/prophet_anomaly_detection

## Overview

##### Project type and purpose
- This is an open-source Python utility library (with a demo notebook) for time-series anomaly detection built on Facebook’s Prophet. It provides three core helper functions (prophet_fit, get_outliers, prophet_plot) that wrap Prophet’s fitting, forecasting, outlier-flagging, and visualization steps.
- The README describes usage in a Jupyter notebook (example.ipynb), points at the utils.py file for the core logic, and stores sample output images under img/.

##### File structure
- README.md – overview, usage, links.
- example.ipynb – interactive demo that imports and calls utils.py.
- utils.py – implements the three key functions that invoke fbprophet, pandas, and matplotlib.
- img/ – sample anomaly-detection figures.
There are no frontend/backend splits or microservices here—just a single Python module and a notebook.

##### README for additional insights
- It shows the core workflow:
a) configure a Prophet model,
b) call prophet_fit to train and forecast,
c) call get_outliers to identify anomalies,
d) call prophet_plot to render the time series and highlight outliers.
- External dependencies: pandas (for DataFrame), fbprophet (the forecasting engine), matplotlib (or plotly) for plotting.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User Interface & Documentation"
        Notebook["Notebook UI\n(example.ipynb)"]:::ui
        Doc["README.md"]:::doc
    end

    subgraph "Data & Pipeline"
        Data[(Data Source\nraw time-series)]:::external
        PF["prophet_fit"]:::code
        FG[(Forecast DataFrame)]:::external
        GO["get_outliers"]:::code
        AN[(Anomaly List)]:::external
        PP["prophet_plot"]:::code
        CH[(Anomaly Chart)]:::external
    end

    subgraph "External Libraries"
        Pandas["pandas"]:::external
        FB["fbprophet"]:::external
        MPL["matplotlib/plotly"]:::external
    end

    subgraph "Output"
        Out["Output Images\n(img/)"]:::ui
    end

    Notebook -->|"loads data"| Data
    Notebook -->|"calls prophet_fit()"| PF
    PF -->|"uses pandas DataFrame"| Pandas
    PF -->|"calls Prophet.fit & predict"| FB
    PF -->|"returns forecast"| FG
    FG -->|"input to get_outliers()"| GO
    GO -->|"identifies anomalies"| AN
    AN -->|"input to prophet_plot()"| PP
    PP -->|"renders chart"| CH
    CH -->|"saved as image"| Out
    Notebook -->|"refers to usage guide"| Doc

    click Notebook "https://github.com/paullo0106/prophet_anomaly_detection/blob/master/example.ipynb"
    click PF "https://github.com/paullo0106/prophet_anomaly_detection/blob/master/utils.py"
    click GO "https://github.com/paullo0106/prophet_anomaly_detection/blob/master/utils.py"
    click PP "https://github.com/paullo0106/prophet_anomaly_detection/blob/master/utils.py"
    click Out "https://github.com/paullo0106/prophet_anomaly_detection/tree/master/img/"
    click Doc "https://github.com/paullo0106/prophet_anomaly_detection/blob/master/README.md"

    classDef code fill:#D6EAF8,stroke:#3498DB,color:#1B4F72;
    classDef external fill:#FCF3CF,stroke:#F1C40F,color:#7D6608;
    classDef ui fill:#D5F5E3,stroke:#2ECC71,color:#145A32;
    classDef doc fill:#EBEDEF,stroke:#ABB2B9,color:#424949;
```
