How dhruva-0206/aersi-forecast-alerts works
AERSI builds station-day AQI and weather features, trains a next-day XGBoost forecaster, and dispatches city-specific alerts for dangerous forecasts. A separate subscription Lambda registers contacts. The main runtime flow is documented as a daily AWS schedule invoking the dispatcher, which reads forecasts and subscribers and publishes alerts. Training and weather ingestion are source-backed; the README documents the AWS schedule and delivery capabilities. Snapshot inputs and AWS wiring are not present in the supplied tree, so those relationships are shown only where documented.
Main entry points: train_forecast.py Train and validate · lambda_function.py Alert dispatcher · station_daily_panel.csv Station-day panel · fetch_weather.py Fetch weather
Components 18
Data preparation
- AQI snapshots
- Build AQI panel
src/build_station_panel.py - Station-day panel
data/processed/station_daily_panel.csv - Open-Meteo ERA5
- Fetch weather
src/fetch_weather.py - Weather features
data/processed/weather_features.csv
Forecast modeling
- Train and validate
src/train_forecast.py - XGBoost model
data/processed/aersi_forecast_model.pkl - Validation forecasts
data/processed/forecast_validation.csv - Model metadata
data/processed/model_metadata.json
Alert delivery
- Daily schedule
- Alert dispatcher
aws/lambda_function.py - Forecast registry
- Subscriber registry
- Amazon SNS
- SMS and email recipients
Subscriber registration
- Register subscriber
aws/subscribe_lambda.py
Other components
- Subscriber
Connections 18
- AQI snapshots → Build AQI panel: reads snapshots
README.md - Build AQI panel → Station-day panel: writes panel
src/build_station_panel.py - Station-day panel → Fetch weather: provides stations
src/fetch_weather.py - Fetch weather → Open-Meteo ERA5: fetches weather
src/fetch_weather.py - Fetch weather → Weather features: writes features
src/fetch_weather.py - Station-day panel → Train and validate: loads panel
src/train_forecast.py - Weather features → Train and validate: loads features
src/train_forecast.py - Train and validate → XGBoost model: saves model
src/train_forecast.py - Train and validate → Validation forecasts: writes predictions
src/train_forecast.py - Train and validate → Model metadata: writes metrics
src/train_forecast.py - Daily schedule → Alert dispatcher: triggers daily
README.md - Alert dispatcher → Forecast registry: queries forecasts
aws/lambda_function.py - Alert dispatcher → Subscriber registry: scans subscribers
aws/lambda_function.py - Alert dispatcher → Amazon SNS: publishes alerts
aws/lambda_function.py - Register subscriber → Amazon SNS: subscribes contact
aws/subscribe_lambda.py - Register subscriber → Subscriber registry: stores subscriber
aws/subscribe_lambda.py - Subscriber → Register subscriber: registers
- Amazon SNS → SMS and email recipients: delivers SMS email
README.md