# Ghana Rain Nowcasting (30-Minute Prediction)
**An AI-powered machine learning system for real-time rainfall forecasting in Accra, Ghana**
This project collects real-time weather data, engineers predictive features, trains a machine learning model, and provides 30-minute rain forecasts through an interactive web dashboard.
## π Features
- β
**Real-time Data Collection** - Automatic weather data fetching every 10 minutes
- β
**Advanced Feature Engineering** - Rolling windows, lag features, derived meteorological indicators
- β
**Robust ML Model** - Random Forest with cross-validation and performance metrics
- β
**Prediction Confidence** - Probability scores and confidence levels for each forecast
- β
**Interactive Dashboard** - Beautiful Streamlit interface with charts and metrics
- β
**Production-Ready** - Error handling, logging, validation, and monitoring
- β
**Secure** - Environment variable management for API keys
## ποΈ System Architecture
```
OpenWeather API (10-min interval)
β
Data Collection & Validation
β
Feature Engineering (rolling, lag, derived features)
β
Data Cleaning & Preprocessing
β
Train/Test Split with Stratification
β
Random Forest Classifier (300 trees)
β
Cross-Validation & Metrics
β
Live Prediction Module
β
Streamlit Dashboard (Real-time visualization)
```
## π Project Structure
```
Ghana Rain Forecast/
βββ app/
β βββ dashboard.py # Streamlit web dashboard
βββ src/
β βββ __init__.py
β βββ config.py # Centralized configuration
β βββ logger.py # Logging setup
β βββ collect_data.py # API data collection with validation
β βββ preprocess.py # Feature engineering & preprocessing
β βββ train_model.py # Model training with validation
β βββ predict.py # Prediction module with confidence scores
β βββ rain_model.pkl # Trained model (generated)
β βββ model_metrics.json # Model evaluation metrics (generated)
β βββ feat β¦