# nathprashant/credit_card_fraud_detection architecture

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

- Interactive diagram: https://gitdiagram.com/nathprashant/credit_card_fraud_detection
- Repository: https://github.com/nathprashant/credit_card_fraud_detection

## Overview

This repository documents a credit-card fraud detection workflow: obtain labeled transactions, explore and engineer features, train a Random Forest, evaluate it, and use a saved model to score new transactions. The tree contains the notebook and data/model directories, but not the documented `src` scripts or output directory. The workflow below reflects README-described behavior; detailed wiring and the prediction implementation cannot be verified from the sampled source.

Main entry points: [`notebooks/main.ipynb`](https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb) (Exploration), [`data/raw`](https://github.com/nathprashant/credit_card_fraud_detection/tree/main/data/raw) (Raw CSV data), [`models`](https://github.com/nathprashant/credit_card_fraud_detection/tree/main/models) (Trained model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Transaction data"]
  node_raw["Raw CSV data"]
  node_eda["Exploration<br/>[main.ipynb]"]
  node_features["Feature engineering<br/>[main.ipynb]"]
end

subgraph group_model["Model workflow"]
  node_training["Random Forest training<br/>[main.ipynb]"]
  node_model_artifact["Trained model"]
  node_evaluation["Model evaluation<br/>[main.ipynb]"]
  node_plots["Evaluation figures"]
end

subgraph group_serving["Fraud scoring"]
  node_new_transactions["New transactions"]
  node_prediction["Transaction scoring"]
  node_scores["Fraud predictions"]
end

node_user(("Analyst"))
node_kaggle[("Kaggle dataset")]

node_user -->|"downloads dataset"| node_kaggle
node_user -->|"places CSVs"| node_raw
node_kaggle -->|"provides transactions"| node_raw
node_user -->|"runs notebook"| node_eda
node_eda -->|"reads data"| node_raw
node_eda -->|"prepares features"| node_features
node_features -->|"provides features"| node_training
node_training -->|"saves model"| node_model_artifact
node_training -->|"evaluates classifier"| node_evaluation
node_evaluation -->|"saves figures"| node_plots
node_user -->|"provides transactions"| node_new_transactions
node_user -->|"runs scoring"| node_prediction
node_prediction -->|"loads model"| node_model_artifact
node_prediction -->|"scores rows"| node_new_transactions
node_prediction -->|"returns predictions"| node_scores

click node_raw "https://github.com/nathprashant/credit_card_fraud_detection/tree/main/data/raw"
click node_eda "https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb"
click node_features "https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb"
click node_training "https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb"
click node_model_artifact "https://github.com/nathprashant/credit_card_fraud_detection/tree/main/models"
click node_evaluation "https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb"

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_raw,node_eda,node_features toneBlue
class node_training,node_model_artifact,node_evaluation,node_plots,node_kaggle toneAmber
class node_new_transactions,node_prediction,node_scores toneMint
class node_user toneIndigo
```

## Components

### Transaction data

- [Raw CSV data](https://github.com/nathprashant/credit_card_fraud_detection/tree/main/data/raw): `data/raw`
- [Exploration](https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb): `notebooks/main.ipynb`
- [Feature engineering](https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb): `notebooks/main.ipynb`

### Model workflow

- [Random Forest training](https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb): `notebooks/main.ipynb`
- [Trained model](https://github.com/nathprashant/credit_card_fraud_detection/tree/main/models): `models`
- [Model evaluation](https://github.com/nathprashant/credit_card_fraud_detection/blob/main/notebooks/main.ipynb): `notebooks/main.ipynb`
- **Evaluation figures**

### Fraud scoring

- **New transactions**
- **Transaction scoring**
- **Fraud predictions**

### Other components

- **Analyst**
- **Kaggle dataset**

## Connections

- Analyst → Kaggle dataset: downloads dataset
- Analyst → Raw CSV data: places CSVs
- Kaggle dataset → Raw CSV data: provides transactions
- Analyst → Exploration: runs notebook
- Exploration → Raw CSV data: reads data
- Exploration → Feature engineering: prepares features
- Feature engineering → Random Forest training: provides features
- Random Forest training → Trained model: saves model
- Random Forest training → Model evaluation: evaluates classifier
- Model evaluation → Evaluation figures: saves figures
- Analyst → New transactions: provides transactions
- Analyst → Transaction scoring: runs scoring
- Transaction scoring → Trained model: loads model
- Transaction scoring → New transactions: scores rows
- Transaction scoring → Fraud predictions: returns predictions
