An end-to-end fraud detection project that trains an XGBoost model for tabular transaction data and deploys a live Streamlit demo for scoring new transactions from a CSV upload.
Live Demo: https://credit-card-fraud-detection-model-nadine-shill.streamlit.app/
Notebook: Fraud Detection 2.ipynb
Credit card fraud is a classic highly imbalanced classification problem: fraudulent transactions are rare, but the impact is high. This project focuses on building a practical pipeline for:
- Data preprocessing + feature engineering
- Training an XGBoost classifier for fraud prediction
- Persisting model artifacts for reproducible inference
- Deploying an interactive Streamlit app:
- Load a sample CSV
- Upload your own CSV (up to 200MB)
- Adjust fraud threshold
- Download predictions as a results CSV
The demo app (app.py) allows you to:
- Load
sample_input.csv(included in the repo) - Upload a CSV with the expected features
- Generate:
fraud_probability(0–1)fraud_prediction(0/1 based on the threshold slider)
- Download the scored results as a CSV
Saved to the artifacts/ folder:
scaler.joblib— preprocessing scaler used at inferencefeature_columns.json— expected feature schema/orderxgboost.json— trained XGBoost model (Booster)
.
├── app.py
├── requirements.txt
├── sample_input.csv
├── artifacts/
│ ├── scaler.joblib
│ ├── feature_columns.json
│ └── xgboost.json
├── Fraud Detection 2.ipynb
└── README.md