# 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 β¦