CaptUReFraud is a Spark-based fraud detection project focused on financial transaction analysis, model-based fraud prediction, and simulation of analyst decisions.
data/raw/– raw downloaded dataset (not tracked)data/processed/– cleaned datasets and intermediate artifacts (not tracked)notebooks/– exploratory analysis and experimentssrc/– source code for data processing, modeling, simulation, and application logicscripts/– utility scripts for dataset handling, training, prediction, and development tasksmodels/– trained models (not tracked)docs/– additional project documentation
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.
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.
docker compose builddocker compose up -dThis 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
docker compose --profile jupyter up -d jupyterStop all containers:
docker compose downor 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.
- 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
featuresandlabel - 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