# myradvd/finfrauddetml-research architecture

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

- Interactive diagram: https://gitdiagram.com/myradvd/finfrauddetml-research
- Repository: https://github.com/myradvd/finfrauddetml-research

## Overview

Fraudlab is a reproducible financial-fraud ranking pipeline. Raw training and test CSVs enter through the CLI: data audit and shift analysis inform feature construction and model selection; training then fits the selected model, scores test rows, and writes a submission. The README also documents a standalone prediction notebook and exploratory model/shift experiments. Source excerpts support the main pipeline calls; notebook and experiment connections are documented in the README, not verified from their implementation here.

Main entry points: [`fraudlab/select.py`](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/select.py) (Model selection), [`fraudlab/train.py`](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/train.py) (Model training), [`fraudlab/__main__.py`](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/__main__.py) (Pipeline CLI), [`fraudlab/data.py`](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/data.py) (Data loading and cleaning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Pipeline workflow"]
  node_cli["Pipeline CLI<br/>[__main__.py]"]
  node_config["Schema and settings<br/>[config.py]"]
  node_loader["Data loading and cleaning<br/>[data.py]"]
  node_training["Model training<br/>[train.py]"]
end

subgraph group_modeling["Features and modeling"]
  node_features["Feature engineering<br/>[features.py]"]
  node_selection["Model selection<br/>[select.py]"]
  node_models["Model zoo<br/>[models.py]"]
end

subgraph group_analysis["Analysis and evaluation"]
  node_eda["Audit and shift analysis<br/>[eda.py]"]
  node_plots["Analysis plots<br/>[plots.py]"]
  node_evaluation["CV and metrics<br/>[evaluate.py]"]
  node_selectionresults["Selection artifacts"]
  node_experiments["Model and shift experiments"]
  node_leaderboard["Upload scores<br/>[leaderboard.csv]"]
end

subgraph group_delivery["Prediction delivery"]
  node_bundle["Fitted model bundle<br/>[model.pkl]"]
  node_predict["Test scoring and submission<br/>[train.py]"]
  node_submission["Prediction submission"]
  node_notebook["Standalone prediction notebook"]
end

node_operator(("Pipeline operator"))
node_rawdata[("Train and test CSVs")]

node_operator -->|"runs stages"| node_cli
node_rawdata -->|"loads CSVs"| node_loader
node_cli -->|"dispatches"| node_eda
node_cli -->|"dispatches"| node_selection
node_cli -->|"dispatches"| node_training
node_cli -->|"dispatches"| node_predict
node_eda -->|"loads and sanitises"| node_loader
node_eda -->|"engineers features"| node_features
node_eda -->|"generates figures"| node_plots
node_selection -->|"loads training data"| node_loader
node_selection -->|"builds features"| node_features
node_selection -->|"cross-validates"| node_evaluation
node_selection -->|"scores candidates"| node_models
node_selection -->|"plots comparison"| node_plots
node_selection -->|"reads public scores"| node_leaderboard
node_selection -->|"writes selection"| node_selectionresults
node_training -->|"reads chosen model"| node_selectionresults
node_training -->|"loads training data"| node_loader
node_training -->|"builds features"| node_features
node_training -->|"fits selected learners"| node_models
node_training -->|"saves model"| node_bundle
node_predict -->|"loads model"| node_bundle
node_predict -->|"loads test data"| node_loader
node_predict -->|"builds features"| node_features
node_predict -->|"writes predictions"| node_submission
node_notebook -->|"loads model"| node_bundle
node_notebook -->|"produces submission"| node_submission
node_experiments -->|"records uploads"| node_leaderboard

click node_cli "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/__main__.py"
click node_config "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/config.py"
click node_loader "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/data.py"
click node_eda "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/eda.py"
click node_plots "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/plots.py"
click node_features "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/features.py"
click node_selection "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/select.py"
click node_models "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/models.py"
click node_evaluation "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/evaluate.py"
click node_selectionresults "https://github.com/myradvd/finfrauddetml-research/tree/main/results/model_selection"
click node_training "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/train.py"
click node_bundle "https://github.com/myradvd/finfrauddetml-research/blob/main/final_notebook/model.pkl"
click node_predict "https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/train.py"
click node_submission "https://github.com/myradvd/finfrauddetml-research/tree/main/results/final"
click node_notebook "https://github.com/myradvd/finfrauddetml-research/blob/main/final_notebook/predict_catboost.ipynb"
click node_experiments "https://github.com/myradvd/finfrauddetml-research/tree/main/notebooks"
click node_leaderboard "https://github.com/myradvd/finfrauddetml-research/blob/main/results/leaderboard.csv"

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_cli,node_config,node_loader,node_training toneBlue
class node_features,node_selection,node_models,node_rawdata toneAmber
class node_eda,node_plots,node_evaluation,node_selectionresults,node_experiments,node_leaderboard toneMint
class node_bundle,node_predict,node_submission,node_notebook toneRose
class node_operator toneIndigo
```

## Components

### Pipeline workflow

- [Pipeline CLI](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/__main__.py): `fraudlab/__main__.py`
- [Schema and settings](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/config.py): `fraudlab/config.py`
- [Data loading and cleaning](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/data.py): `fraudlab/data.py`
- [Model training](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/train.py): `fraudlab/train.py`

### Features and modeling

- [Feature engineering](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/features.py): `fraudlab/features.py`
- [Model selection](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/select.py): `fraudlab/select.py`
- [Model zoo](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/models.py): `fraudlab/models.py`

### Analysis and evaluation

- [Audit and shift analysis](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/eda.py): `fraudlab/eda.py`
- [Analysis plots](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/plots.py): `fraudlab/plots.py`
- [CV and metrics](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/evaluate.py): `fraudlab/evaluate.py`
- [Selection artifacts](https://github.com/myradvd/finfrauddetml-research/tree/main/results/model_selection): `results/model_selection`
- [Model and shift experiments](https://github.com/myradvd/finfrauddetml-research/tree/main/notebooks): `notebooks`
- [Upload scores](https://github.com/myradvd/finfrauddetml-research/blob/main/results/leaderboard.csv): `results/leaderboard.csv`

### Prediction delivery

- [Fitted model bundle](https://github.com/myradvd/finfrauddetml-research/blob/main/final_notebook/model.pkl): `final_notebook/model.pkl`
- [Test scoring and submission](https://github.com/myradvd/finfrauddetml-research/blob/main/fraudlab/train.py): `fraudlab/train.py`
- [Prediction submission](https://github.com/myradvd/finfrauddetml-research/tree/main/results/final): `results/final`
- [Standalone prediction notebook](https://github.com/myradvd/finfrauddetml-research/blob/main/final_notebook/predict_catboost.ipynb): `final_notebook/predict_catboost.ipynb`

### Other components

- **Pipeline operator**
- **Train and test CSVs**

## Connections

- Pipeline operator → Pipeline CLI: runs stages (evidence: `README.md`)
- Train and test CSVs → Data loading and cleaning: loads CSVs (evidence: `fraudlab/data.py`)
- Pipeline CLI → Audit and shift analysis: dispatches (evidence: `fraudlab/__main__.py`)
- Pipeline CLI → Model selection: dispatches (evidence: `fraudlab/__main__.py`)
- Pipeline CLI → Model training: dispatches (evidence: `fraudlab/__main__.py`)
- Pipeline CLI → Test scoring and submission: dispatches (evidence: `fraudlab/__main__.py`)
- Audit and shift analysis → Data loading and cleaning: loads and sanitises (evidence: `fraudlab/eda.py`)
- Audit and shift analysis → Feature engineering: engineers features (evidence: `fraudlab/eda.py`)
- Audit and shift analysis → Analysis plots: generates figures (evidence: `fraudlab/eda.py`)
- Model selection → Data loading and cleaning: loads training data (evidence: `fraudlab/select.py`)
- Model selection → Feature engineering: builds features (evidence: `fraudlab/select.py`)
- Model selection → CV and metrics: cross-validates (evidence: `fraudlab/select.py`)
- Model selection → Model zoo: scores candidates (evidence: `fraudlab/select.py`)
- Model selection → Analysis plots: plots comparison (evidence: `fraudlab/select.py`)
- Model selection → Upload scores: reads public scores (evidence: `fraudlab/select.py`)
- Model selection → Selection artifacts: writes selection (evidence: `fraudlab/select.py`)
- Model training → Selection artifacts: reads chosen model (evidence: `fraudlab/train.py`)
- Model training → Data loading and cleaning: loads training data (evidence: `fraudlab/train.py`)
- Model training → Feature engineering: builds features (evidence: `fraudlab/train.py`)
- Model training → Model zoo: fits selected learners (evidence: `fraudlab/train.py`)
- Model training → Fitted model bundle: saves model (evidence: `fraudlab/train.py`)
- Test scoring and submission → Fitted model bundle: loads model (evidence: `fraudlab/train.py`)
- Test scoring and submission → Data loading and cleaning: loads test data (evidence: `fraudlab/train.py`)
- Test scoring and submission → Feature engineering: builds features (evidence: `fraudlab/train.py`)
- Test scoring and submission → Prediction submission: writes predictions (evidence: `fraudlab/train.py`)
- Standalone prediction notebook → Fitted model bundle: loads model (evidence: `README.md`)
- Standalone prediction notebook → Prediction submission: produces submission (evidence: `README.md`)
- Model and shift experiments → Upload scores: records uploads (evidence: `README.md`)
