Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Fraud Detection — XGBoost + Streamlit Live Demo

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


Overview

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

What’s Included

Streamlit App (Live Demo)

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

Model Artifacts

Saved to the artifacts/ folder:

  • scaler.joblib — preprocessing scaler used at inference
  • feature_columns.json — expected feature schema/order
  • xgboost.json — trained XGBoost model (Booster)

Repo Structure

.
├── app.py
├── requirements.txt
├── sample_input.csv
├── artifacts/
│   ├── scaler.joblib
│   ├── feature_columns.json
│   └── xgboost.json
├── Fraud Detection 2.ipynb
└── README.md

About

Model that detects fraud from credit card transaction data.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages