# 🌍 Climate Prediction — Morocco (2025–2050)
Machine learning pipeline to predict future climate variables across **Morocco**, trained on historical TerraClimate data (1981–2024) and visualized through Köppen-Geiger classification maps.
---
## 📁 Project Structure
```
climate-prediction-morocco/
│
├── ML/ # XGBoost-based approach
│ ├── projectionML.py # Main training & prediction script
│ ├── koppenviwer.py # Tkinter GUI — Köppen-Geiger map viewer (basic)
│ ├── koppen_viewer_extended.py# Tkinter GUI — extended viewer with trends & animation
│ └── data/ # ⚠️ Local only — not tracked by Git
│ └── {year}/
│ └── {variable}/
│ └── morocco_{variable}_{year}_{month:02d}.tif
│
├── DL/ # Deep Learning approach
│ ├── projectionDL.py # LSTM model — same pipeline, DL counterpart
│ └── data/ # ⚠️ Local only — not tracked by Git
│ └── {year}/
│ └── {variable}/
│ └── morocco_{variable}_{year}_{month:02d}.tif
│
├── .gitignore
└── README.md
```
---
## 🔬 What It Does
| Step | Script | Description |
|---|---|---|
| Train & Predict (ML) | `ML/projectionML.py` | Trains one XGBoost model per climate variable, generates annual + monthly GeoTIFF predictions for 2025–2050 |
| Train & Predict (DL) | `DL/projectionDL.py` | Trains a single multi-output LSTM model for all 6 variables jointly |
| Visualize | `ML/koppen_viewer_extended.py` | Tkinter GUI — load historical or predicted data, explore variables, compare periods, animate over time |
---
## 🌡️ Climate Variables
| Variable | Description | Unit | Aggregation |
|---|---|---|---|
| `tmax` | Maximum temperature | °C | Monthly mean |
| `tmin` | Minimum temperature | °C | Monthly mean |
| `prec` | Precipitation | mm | Monthly sum |
| `vap` | Vapor pressure | kPa | Monthly mean |
| `ws` | Wind speed | m/s | Monthly mean |
| `def` | Climate water defici …