Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Credit Card Fraud Detection with Machine Learning

This repository contains a full machine learning pipeline to detect fraudulent credit card transactions. It combines geospatial, temporal, and behavioral features with ensemble learning methods to improve detection performance.

πŸ“Œ Project Highlights

  • Feature Engineering: Age, transaction time, day of week, and distance traveled.
  • Geospatial Analysis: Calculates distances between customer and merchant locations using latitude and longitude.
  • Suspicious Travel Detection: Flags implausible high-speed travel between transactions.
  • Imbalanced Data Handling: Uses SMOTE to address severe class imbalance.
  • Modeling: Random Forest and XGBoost for robust fraud classification.

πŸ› οΈ Tech Stack

  • Python
  • Libraries: pandas, numpy, scikit-learn, matplotlib, seaborn, geopy, xgboost, imbalanced-learn

πŸ“ Dataset

The data used for this project is stored locally and includes columns such as:

πŸ“Š Visualizations

  • Gender-based transaction distributions
  • Day-of-week transaction trends
  • Correlation matrix of engineered features

πŸš€ Getting Started

  1. Clone the repo:
git clone https://github.com/your-username/credit-card-fraud-detection.git
cd credit-card-fraud-detection
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the notebook or script to train and evaluate the model.

πŸ“ˆ Performance Metrics

  • Precision
  • Recall
  • F1 Score
  • ROC-AUC

πŸ“Œ Output

The final model is evaluated using an optimized threshold derived from the precision-recall curve. A classification report is printed to assess its performance.

πŸ“¬ Contact

Created by Ruwaida Al Harrasi – feel free to reach out!


Feel free to fork the repository or suggest improvements via pull requests!

About

A machine learning pipeline for detecting credit card fraud using feature engineering, geospatial analysis, and Random Forest.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages