# π Smart Price Tracker for Food Markets (Nigeria)
A production-ready machine learning application for predicting food prices in Nigerian markets using XGBoost and LSTM models.
## π Features
- **π― Price Prediction**: Accurate food price predictions using state-of-the-art ML models
- **πΊοΈ Market Finder**: Discover markets with the lowest prices for specific commodities
- **π Data Explorer**: Interactive visualization and analysis of market trends
- **π Model Comparison**: Compare XGBoost and LSTM performance metrics
- **π Geographic Visualization**: Interactive maps showing market locations
- **π Historical Analysis**: View price trends and patterns over time
## π Quick Start
### 1. Install Dependencies
```bash
pip install -r requirements.txt
```
### 2. Train Models
**Option A: Using Python Script (Recommended for production)**
```bash
python run_training.py
```
**Option B: Using Jupyter Notebook (Recommended for exploration)**
```bash
jupyter notebook model_training.ipynb
```
### 3. Test Models (Optional)
```bash
python test_prediction.py
```
### 4. Run Application
```bash
streamlit run app.py
```
The app will open at `
localhost`
## π Models
### XGBoost Pipeline
- Gradient Boosting with StandardScaler
- LabelEncoder for categorical features
- Optimized hyperparameters
- Fast inference time
### LSTM Neural Network
- 2-layer LSTM architecture
- Dropout regularization
- Early stopping
- Captures temporal patterns
## π Project Structure
```
βββ data/
β βββ nigeria_food_dataset.parquet # Dataset (54,883 records)
βββ models/ # Trained models (created after training)
βββ model_training.ipynb # Interactive training notebook
βββ run_training.py # Automated training script
βββ test_prediction.py # Model testing script
βββ app.py # Streamlit web application
βββ requirements.txt # Python dependencies
βββ P β¦