# π African Foodstore Anomaly Detection App π¬π§π
This project builds a real-time anomaly detection system for a typical African Food Store's e-commerce data in the UK.
It covers everything from data generation, model training, to a live Streamlit web app where users can upload their transactions and detect anomalies.
---
## π Project Overview
**Features:**
- Generate synthetic African food e-commerce transactions
- Train and compare three anomaly detection models:
- Isolation Forest
- AutoEncoder (Deep Learning)
- One-Class SVM
- Select and save the best performing model
- Deploy a Streamlit app for real-time anomaly detection
- Allow users to upload CSV files and download detected results
---
## π Live Demo
You can try the deployed app here:
π African Foodstore Anomaly Detection App
---
## π Project Structure
```bash
african-foodstore-anomaly/
βββ app.py # Streamlit frontend
βββ data/ # Synthetic dataset and test data
β βββ ecommerce_data.csv
β βββ test_data.csv
β βββ generate_data.py
βββ models/ # Model training and saved models
β βββ train_models.py
β βββ best_model.pkl or best_model.h5
β βββ scaler.pkl
βββ notebooks/ # EDA and preprocessing notebooks
β βββ eda_preprocessing.ipynb
β βββ model_training.ipynb
βββ requirements.txt # Project dependencies
βββ README.md # Project documentation
βββ .gitignore
```
---
## π¦ Tech Stack
- **Python 3.12**
- **Streamlit**
- **Scikit-learn**
- **Tensorflow / Keras**
- **Pandas / Numpy**
- **Matplotlib / Seaborn**
- **Joblib**
---
## π How to Run the Project Locally
1. **Clone the repository:**
```bash
git clone
github.com
cd african-foodstore-anomaly
```
2. **Create a virtual environment (optional but recommended):**
```bash
python -m venv venv
source venv/bin/activate # On Mac/Linux
venv\Scripts\activate # On Windows
```
3. **Install dependencies β¦