# manohar4464/financial-anomaly-detection-qml architecture

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

- Interactive diagram: https://gitdiagram.com/manohar4464/financial-anomaly-detection-qml
- Repository: https://github.com/manohar4464/financial-anomaly-detection-qml

## Overview

This repository implements a transaction-anomaly detection experiment and interactive prediction dashboard in one Python module. The principal workflow loads and engineers transaction features, splits labeled data, trains a quantum-kernel classifier, tunes an anomaly threshold, evaluates it against a Random Forest baseline, and launches a Dash interface for predictions. The graph separates those domain stages while keeping the main-script orchestration explicit. The available source shows these runtime relationships; the README is empty, and the other listed documentation files were not sampled.

Main entry points: [`qml/code.py`](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py) (Experiment runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_preprocess["Feature preprocessing<br/>[code.py]"]
  node_split["Train validation test split<br/>[code.py]"]
end

subgraph group_models["Modeling"]
  node_qsvc["Quantum QSVC<br/>[code.py]"]
  node_forest["Random Forest baseline<br/>[code.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_runner["Experiment runner<br/>[code.py]"]
  node_threshold["Threshold tuning<br/>[code.py]"]
  node_metrics["Model evaluation<br/>[code.py]"]
  node_plots["Evaluation plots<br/>[code.py]"]
end

subgraph group_serving["Prediction dashboard"]
  node_dashboard["Dash prediction app<br/>[code.py]"]
end

node_dataset["Transaction data"]
node_user(("Dashboard user"))

node_dataset -->|"loads and engineers"| node_preprocess
node_runner -->|"calls"| node_preprocess
node_runner -->|"splits features"| node_split
node_runner -->|"trains"| node_qsvc
node_runner -->|"tunes on validation"| node_threshold
node_runner -->|"evaluates"| node_metrics
node_runner -->|"plots results"| node_plots
node_runner -->|"trains baseline"| node_forest
node_runner -->|"launches"| node_dashboard
node_user -->|"enters features"| node_dashboard
node_dashboard -->|"transforms input"| node_preprocess
node_dashboard -->|"scores input"| node_qsvc
node_dashboard -->|"classifies score"| node_threshold

click node_runner "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_preprocess "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_split "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_qsvc "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_threshold "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_metrics "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_plots "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_forest "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"
click node_dashboard "https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py"

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_preprocess,node_split,node_user toneBlue
class node_qsvc,node_forest toneAmber
class node_runner,node_threshold,node_metrics,node_plots toneMint
class node_dashboard toneRose
class node_dataset toneIndigo
```

## Components

### Data preparation

- [Feature preprocessing](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`
- [Train validation test split](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`

### Modeling

- [Quantum QSVC](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`
- [Random Forest baseline](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`

### Evaluation

- [Experiment runner](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`
- [Threshold tuning](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`
- [Model evaluation](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`
- [Evaluation plots](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`

### Prediction dashboard

- [Dash prediction app](https://github.com/manohar4464/financial-anomaly-detection-qml/blob/main/qml/code.py): `qml/code.py`

### Other components

- **Transaction data**
- **Dashboard user**

## Connections

- Transaction data → Feature preprocessing: loads and engineers (evidence: `qml/code.py`)
- Experiment runner → Feature preprocessing: calls (evidence: `qml/code.py`)
- Experiment runner → Train validation test split: splits features (evidence: `qml/code.py`)
- Experiment runner → Quantum QSVC: trains (evidence: `qml/code.py`)
- Experiment runner → Threshold tuning: tunes on validation (evidence: `qml/code.py`)
- Experiment runner → Model evaluation: evaluates (evidence: `qml/code.py`)
- Experiment runner → Evaluation plots: plots results (evidence: `qml/code.py`)
- Experiment runner → Random Forest baseline: trains baseline (evidence: `qml/code.py`)
- Experiment runner → Dash prediction app: launches (evidence: `qml/code.py`)
- Dashboard user → Dash prediction app: enters features (evidence: `qml/code.py`)
- Dash prediction app → Feature preprocessing: transforms input (evidence: `qml/code.py`)
- Dash prediction app → Quantum QSVC: scores input (evidence: `qml/code.py`)
- Dash prediction app → Threshold tuning: classifies score (evidence: `qml/code.py`)
