Logo Lanfrica

Becky-Chala/fraud-detection

Domain:

socioeconomic

Record type:

project
Creator:
Bec
Host:
# Fraud Detection with Machine Learning (Week 8 & 9 Challenge) ## πŸ“Œ Overview This project is part of the **10 Academy AI Mastery Program** (Weeks 8 & 9). The objective is to **detect fraudulent transactions** in e-commerce and banking datasets using machine learning. We: * Preprocessed and engineered features * Built and evaluated machine learning models * Applied **model explainability (SHAP)** to interpret the predictions Fraud detection is highly imbalanced (fraud cases are very rare), so we emphasize evaluation metrics like **AUC-PR** and **F1-score**, not just accuracy. --- ## πŸ—‚οΈ Project Structure ```text β”œβ”€β”€ data/ # (ignored in git) raw and processed data files β”œβ”€β”€ notebooks/ β”‚ β”œβ”€β”€ task1and2.ipynb # Data preprocessing, model training β”‚ └── task3_shap.ipynb # Model explainability β”œβ”€β”€ models/ # Saved models (ignored in git) β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ .gitignore # Ignore large data and temp files └── README.md # Project documentation ``` --- ## πŸ—‚οΈ Datasets 1. **Fraud\_Data.csv** – e-commerce transactions with features like device, browser, signup time, purchase time, IP, etc. 2. **creditcard.csv** – anonymized credit card transactions with PCA-transformed features (V1–V28). 3. **IpAddress\_to\_Country.csv** – IP-to-country mapping for geolocation features. > ⚠️ These data files are excluded from Git (see `.gitignore`) due to size/sensitivity. --- ## βš™οΈ Installation Clone the repo and install dependencies: ```bash git clone github.com cd fraud-detection pip install -r requirements.txt ``` Dependencies (see `requirements.txt`): * `pandas`, `numpy` * `scikit-learn` * `matplotlib` * `shap` * *(optional)* `imbalanced-learn`, `seaborn` --- ## πŸš€ Usage ### 1. Data Preprocessing & Model Training Open the notebook: ```bash jupyter notebook notebooks/task1and2.ipynb ``` * Cleans and preprocesses the datasets * Hand …