Spatio-Temporal Analysis of Weather Patterns in Nigeria on 2/21/2024
# Spatio-Temporal Analysis of Weather Patterns in Nigeria on 2/21/2024
## Project Overview
This project analyzes weather patterns across Nigeria and builds machine learning models to predict temperature based on various meteorological and geographical features. The analysis covers 6 regions, 144 cities, and 22,541 data points, providing comprehensive insights into Nigeria's climate patterns.
## Dataset Characteristics
- **Total Records**: 22,541 weather observations
- **Geographical Coverage**: 6 regions (Anambra, Borno, Kaduna, Kogi, Lagos, Rivers)
- **Features Analyzed**: Temperature, humidity, pressure, wind speed, cloud cover, population, and geographical coordinates
- **Temperature Range**: 17.9°C to 41.0°C (Mean: 30.2°C)
## Key Insights
### Regional Weather Patterns
- **Hottest Region**: Anambra (mean temp: 31.58°C)
- **Coolest Region**: Kaduna (mean temp: 27.33°C)
- **Most Humid**: Lagos (67.0% humidity)
- **Driest**: Borno (21.89% humidity)
- **Highest Pressure**: Kaduna (1011.91 hPa)
- **Windiest**: Borno (3.94 m/s average wind speed)
### Feature Correlations with Temperature
- **Strong Negative Correlation**: Pressure (-0.640)
- **Moderate Negative Correlation**: Humidity (-0.296)
- **Positive Correlation**: Wind Speed (0.221)
### Feature Importance (Random Forest)
1. **Pressure** (48.28%) - Most significant predictor
2. **Humidity** (25.21%)
3. **Latitude** (6.67%)
4. **Wind Speed** (6.50%)
5. **Cloud Cover** (5.75%)
## Machine Learning Models Performance
### Model Comparison
| Model | MSE | RMSE | MAE | R² | Cross-Validated R² |
|-------|-----|------|-----|----|-----------------------|
| Random Forest | 0.202 | 0.449 | 0.223 | 0.987 | 0.986 |
| Gradient Boosting | 1.681 | 1.297 | 0.957 | 0.893 | 0.891 |
| Support Vector Regression | 1.839 | 1.356 | 0.903 | 0.883 | 0.884 |
| Linear Regression | 6.018 | 2.453 | 2.005 | 0.617 | 0.634 |
| Ridge Regression | 6.018 | 2.453 | 2.005 | 0.617 | 0.634 |
| Lasso Regression | 6.154 | 2.48 …