# swampybedeveloping/datathon_2026 architecture

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

- Interactive diagram: https://gitdiagram.com/swampybedeveloping/datathon_2026
- Repository: https://github.com/swampybedeveloping/datathon_2026

## Overview

This repository is an imbalanced-transaction fraud-detection project: its analysis develops and evaluates an explainable logistic-regression model, and its scoring command applies that saved model to raw CSV transactions. The principal scoring path is CSV input → feature cleaning and engineering → model scoring and threshold flags → prediction CSV. The README also documents analysis stages not present in the sampled source excerpts; those are represented at notebook level, with relationships based on README statements rather than inspected notebook code.

Main entry points: [`notebooks/fraud_detection.ipynb`](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb) (Fraud analysis), [`src/fraud_detection/predict.py`](https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/predict.py) (CSV scoring CLI), [`models/model.pkl`](https://github.com/swampybedeveloping/datathon_2026/blob/main/models/model.pkl) (Model and threshold), [`src/fraud_detection/features.py`](https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/features.py) (Feature engineering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Model analysis"]
  node_analysis_notebook["Fraud analysis"]
  node_eda["Exploratory analysis"]
  node_preprocessing["Leak-free preprocessing"]
  node_feature_design["Feature engineering<br/>[features.py]"]
  node_model_comparison["Model comparison"]
  node_threshold["Threshold selection"]
  node_trust_checks["Trust checks"]
end

subgraph group_scoring["Scoring runtime"]
  node_scorer["CSV scoring CLI<br/>[predict.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_train_data[("Training transactions<br/>[train.csv]")]
  node_saved_model["Model and threshold<br/>[model.pkl]"]
  node_test_data[("Test transactions<br/>[test.csv]")]
  node_prediction_output["Prediction CSV"]
end

node_analyst(("Model analyst"))

node_analyst -->|"runs analysis"| node_analysis_notebook
node_train_data -->|"analyzes"| node_analysis_notebook
node_analysis_notebook -->|"includes"| node_eda
node_analysis_notebook -->|"includes"| node_preprocessing
node_analysis_notebook -->|"uses features"| node_feature_design
node_analysis_notebook -->|"compares models"| node_model_comparison
node_analysis_notebook -->|"selects threshold"| node_threshold
node_analysis_notebook -->|"evaluates trust"| node_trust_checks
node_analysis_notebook -->|"saves model"| node_saved_model
node_analyst -->|"scores CSV"| node_scorer
node_test_data -->|"provides input"| node_scorer
node_scorer -->|"calls make_features"| node_feature_design
node_saved_model -->|"loads model"| node_scorer
node_scorer -->|"writes predictions"| node_prediction_output

click node_train_data "https://github.com/swampybedeveloping/datathon_2026/blob/main/data/train.csv"
click node_analysis_notebook "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_eda "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_preprocessing "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_feature_design "https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/features.py"
click node_model_comparison "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_threshold "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_trust_checks "https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb"
click node_saved_model "https://github.com/swampybedeveloping/datathon_2026/blob/main/models/model.pkl"
click node_scorer "https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/predict.py"
click node_test_data "https://github.com/swampybedeveloping/datathon_2026/blob/main/data/test.csv"
click node_prediction_output "https://github.com/swampybedeveloping/datathon_2026/blob/main/outputs/test_predictions.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_analysis_notebook,node_eda,node_preprocessing,node_feature_design,node_model_comparison,node_threshold,node_trust_checks toneBlue
class node_scorer toneAmber
class node_train_data,node_saved_model,node_test_data,node_prediction_output toneMint
class node_analyst toneIndigo
```

## Components

### Model analysis

- [Fraud analysis](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`
- [Exploratory analysis](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`
- [Leak-free preprocessing](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`
- [Feature engineering](https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/features.py): `src/fraud_detection/features.py`
- [Model comparison](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`
- [Threshold selection](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`
- [Trust checks](https://github.com/swampybedeveloping/datathon_2026/blob/main/notebooks/fraud_detection.ipynb): `notebooks/fraud_detection.ipynb`

### Scoring runtime

- [CSV scoring CLI](https://github.com/swampybedeveloping/datathon_2026/blob/main/src/fraud_detection/predict.py): `src/fraud_detection/predict.py`

### Data and artifacts

- [Training transactions](https://github.com/swampybedeveloping/datathon_2026/blob/main/data/train.csv): `data/train.csv`
- [Model and threshold](https://github.com/swampybedeveloping/datathon_2026/blob/main/models/model.pkl): `models/model.pkl`
- [Test transactions](https://github.com/swampybedeveloping/datathon_2026/blob/main/data/test.csv): `data/test.csv`
- [Prediction CSV](https://github.com/swampybedeveloping/datathon_2026/blob/main/outputs/test_predictions.csv): `outputs/test_predictions.csv`

### Other components

- **Model analyst**

## Connections

- Model analyst → Fraud analysis: runs analysis (evidence: `README.md`)
- Training transactions → Fraud analysis: analyzes (evidence: `README.md`)
- Fraud analysis → Exploratory analysis: includes (evidence: `README.md`)
- Fraud analysis → Leak-free preprocessing: includes (evidence: `README.md`)
- Fraud analysis → Feature engineering: uses features (evidence: `README.md`)
- Fraud analysis → Model comparison: compares models (evidence: `README.md`)
- Fraud analysis → Threshold selection: selects threshold (evidence: `README.md`)
- Fraud analysis → Trust checks: evaluates trust (evidence: `README.md`)
- Fraud analysis → Model and threshold: saves model (evidence: `README.md`)
- Model analyst → CSV scoring CLI: scores CSV (evidence: `README.md`)
- Test transactions → CSV scoring CLI: provides input (evidence: `README.md`)
- CSV scoring CLI → Feature engineering: calls make_features (evidence: `src/fraud_detection/predict.py`)
- Model and threshold → CSV scoring CLI: loads model (evidence: `src/fraud_detection/predict.py`)
- CSV scoring CLI → Prediction CSV: writes predictions (evidence: `src/fraud_detection/predict.py`)
