Skip to content

Repository files navigation

CaptUReFraud

CaptUReFraud is a Spark-based fraud detection project focused on financial transaction analysis, model-based fraud prediction, and simulation of analyst decisions.

Project structure

  • data/raw/ – raw downloaded dataset (not tracked)
  • data/processed/ – cleaned datasets and intermediate artifacts (not tracked)
  • notebooks/ – exploratory analysis and experiments
  • src/ – source code for data processing, modeling, simulation, and application logic
  • scripts/ – utility scripts for dataset handling, training, prediction, and development tasks
  • models/ – trained models (not tracked)
  • docs/ – additional project documentation

Dataset

This project uses a dataset from Kaggle: Online Payments Fraud Detection Dataset

Raw data is not tracked by Git.

For dataset setup instructions, see: docs/data_setup.md.

Running the project

The project is intended to run inside Docker.

If you don't want to follow these steps, you can run start.bat or start.sh to start the project automatically.

Build containers

docker compose build

Start the default application stack

docker compose up -d

This starts the the default application stack

  • FastAPI backend
  • React/Vite frontend
  • Jupyter is not started by default

Open the application in your browser:
Frontend: http://localhost:5173
Backend API: http://localhost:8000
API docs: http://localhost:8000/docs

Start optional Jupyter service

docker compose --profile jupyter up -d jupyter

Stop all containers:

docker compose down

or run stop.bat for Windows or stop.sh for Linux.

For more information about Docker setup and runtime commands, see: docs/docker.md.

For simulation scripts, see: docs/simulation.md.

Documentation

  • Dataset setup – Kaggle dataset download and raw data setup
  • Docker setup – Docker runtime, app container, Jupyter profile, and basic commands
  • EDA notes – exploratory data analysis observations and fraud distribution notes
  • Data pipeline – preprocessing, feature engineering, and train/test dataset preparation
  • ML dataset – structure of the final Spark ML dataset with features and label
  • Model overview – Random Forest model, class weighting, training, prediction output, and persistence
  • Simulation engine – prediction interface, decision logic, feedback tracking, metrics, and batch simulation
  • Backend API – FastAPI backend endpoints for prediction, simulation, and metrics
  • Frontend UI – React dashboard for fraud monitoring, threshold experimentation, and analyst decision simulation
  • Evaluation – model performance metrics, confusion matrix, business impact, and analyst decision quality
  • Development workflow – Git workflow, commit convention, tests, and local artifacts

About

Fraud detection system using PySpark, ML model training, transaction simulation, and FastAPI backend endpoints.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages