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