# saisubhiksh9854/da-xad-drift-aware-anomaly-detection architecture

> Architecture diagram of the GitHub repository saisubhiksh9854/da-xad-drift-aware-anomaly-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection
- Repository: https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection

## Overview

This repository is a single-file research framework and experiment for drift-aware anomaly detection in non-stationary data streams. Its principal workflow generates a stream, compares static, periodic, and adaptive detectors, evaluates results, and writes a summary and figures. The adaptive path combines anomaly scoring with drift monitoring and retraining. The source excerpt is partial and the README is empty, so the graph omits unshown internals and figure-generation wiring; output links are included only where the excerpt shows them.

Main entry points: [`da_xad_framework.py`](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py) (Experiment entry), [`results/summary.json`](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/results/summary.json) (Run summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiment["Experiment workflow"]
  node_entry["Experiment entry"]
  node_stream["Stream generation"]
end

subgraph group_detection["Detection and adaptation"]
  node_baselines["Baseline detectors"]
  node_adaptive["Adaptive detector"]
  node_scoring["Anomaly scoring"]
  node_drift["Drift monitoring"]
  node_onset["Onset estimation"]
  node_retraining["Adaptive retraining"]
end

subgraph group_analysis["Evaluation and outputs"]
  node_evaluation["Metric evaluation"]
  node_rolling["Rolling performance"]
  node_explanations["Alert explanations"]
  node_summary["Run summary<br/>[summary.json]"]
  node_figures["Result figures"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_entry
node_entry -->|"generates"| node_stream
node_entry -->|"runs comparisons"| node_baselines
node_entry -->|"runs proposed"| node_adaptive
node_adaptive -->|"scores batches"| node_scoring
node_adaptive -->|"tests drift"| node_drift
node_drift -->|"estimates onset"| node_onset
node_adaptive -->|"refits detector"| node_retraining
node_adaptive -->|"explains alerts"| node_explanations
node_entry -->|"computes metrics"| node_evaluation
node_entry -->|"writes summary"| node_summary

click node_entry "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_stream "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_baselines "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_adaptive "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_scoring "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_drift "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_onset "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_retraining "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_evaluation "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_rolling "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_explanations "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py"
click node_summary "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/results/summary.json"
click node_figures "https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/tree/main/results/figures"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_stream,node_user toneBlue
class node_baselines,node_adaptive,node_scoring,node_drift,node_onset,node_retraining toneAmber
class node_evaluation,node_rolling,node_explanations,node_summary,node_figures toneMint
```

## Components

### Experiment workflow

- [Experiment entry](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Stream generation](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`

### Detection and adaptation

- [Baseline detectors](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Adaptive detector](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Anomaly scoring](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Drift monitoring](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Onset estimation](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Adaptive retraining](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`

### Evaluation and outputs

- [Metric evaluation](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Rolling performance](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Alert explanations](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/da_xad_framework.py): `da_xad_framework.py`
- [Run summary](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/blob/main/results/summary.json): `results/summary.json`
- [Result figures](https://github.com/saisubhiksh9854/da-xad-drift-aware-anomaly-detection/tree/main/results/figures): `results/figures`

### Other components

- **CLI user**

## Connections

- CLI user → Experiment entry: runs (evidence: `da_xad_framework.py`)
- Experiment entry → Stream generation: generates (evidence: `da_xad_framework.py`)
- Experiment entry → Baseline detectors: runs comparisons (evidence: `da_xad_framework.py`)
- Experiment entry → Adaptive detector: runs proposed (evidence: `da_xad_framework.py`)
- Adaptive detector → Anomaly scoring: scores batches (evidence: `da_xad_framework.py`)
- Adaptive detector → Drift monitoring: tests drift (evidence: `da_xad_framework.py`)
- Drift monitoring → Onset estimation: estimates onset (evidence: `da_xad_framework.py`)
- Adaptive detector → Adaptive retraining: refits detector (evidence: `da_xad_framework.py`)
- Adaptive detector → Alert explanations: explains alerts (evidence: `da_xad_framework.py`)
- Experiment entry → Metric evaluation: computes metrics (evidence: `da_xad_framework.py`)
- Experiment entry → Run summary: writes summary (evidence: `da_xad_framework.py`)
