One-month-ahead forecasts of rainfall, temperature and humidity for Bangladesh (BMD stations)

Trained models from the paper "Leakage controlled machine learning forecasting of monthly rainfall temperature and humidity across Bangladesh" (J. R. Das, M. A. R. Khan, I. Ahammad, A. Hosen; Noakhali Science and Technology University).

The models forecast the next month's mean temperature, mean relative humidity and total rainfall at 24 Bangladesh Meteorological Department (BMD) stations, using only information observed up to the end of the current month.

Models

Target Algorithm Unit
Temperature (monthly mean) XGBoost Β°C
Rainfall (monthly total) Support vector regression (RBF kernel) mm
Relative humidity (monthly mean) XGBoost %

Hyperparameters were selected by rolling-origin (expanding-window) cross-validation on data up to 2017 only; see metadata.json in each model folder.

Two versions are provided:

Folder Trained on target months Use
models/test_origin_2018/ 1982–2017 out-of-sample forecasts for 2018–2022 (as evaluated in the paper; used by the demo)
models/full_2022/ 1982–2022 forecasting from newer observations

Each folder contains one model per target (*.joblib, a scikit-learn Pipeline with a standard scaler), the station Γ— calendar-month climatology used as a predictor (climatology.csv) and metadata.json (features, hyperparameters, conformal quantiles, paper metrics).

Inputs

For a forecast of month t at a station, the 12 previous months (tβˆ’12 … tβˆ’1) of these eight variables must be available for that station, and the previous month for its neighbouring stations: mean temperature, relative humidity, rainfall, station pressure, wind speed, sine and cosine of wind direction, and dew point. The predictors are:

  • the target's lags 1, 2, 3 and 12 and its 3-month mean;
  • the previous-month values of the other variables and the dew-point depression;
  • the month (sine and cosine) and the station coordinates;
  • the inverse-distance-weighted previous-month value at the 4 nearest stations;
  • the station climatology of the target month.

bdweather.py builds all of them from a monthly panel.

Usage

pip install scikit-learn==1.9.1 xgboost==3.4.1 pandas numpy joblib huggingface_hub

from huggingface_hub import snapshot_download
import sys, pandas as pd
path = snapshot_download("abir71/bd-weather-forecast-models")
sys.path.insert(0, path)
from bdweather import Forecaster

fc = Forecaster(f"{path}/models/test_origin_2018")
panel = pd.read_csv("panel_monthly_24st.csv")          # from the Kaggle dataset
print(fc.forecast(panel, "Dhaka", 2020, 7, "Rainfall"))
# {'forecast': ..., 'lower90': ..., 'upper90': ..., 'climatology': ..., 'observed': ...}

The panel needs the columns Station, Year, Month, Temperature, Humidity, Rainfall, Pressure, Wind_speed, Wind_dir_sin, Wind_dir_cos, Dew_Point.

Evaluation (paper, 2018–2022, 24 stations Γ— 60 months)

Rolling-origin test with annual re-fitting. MSESS is the mean-squared-error skill score relative to the station climatology (> 0 means better than climatology).

Target Model MAE RMSE RΒ² MSESS Climatology RMSE
Temperature XGBoost 0.61 Β°C 0.74 Β°C 0.963 +0.32 0.90 Β°C
Rainfall SVR 79.7 mm 132.1 mm 0.664 +0.21 148.4 mm
Humidity XGBoost 3.05 % 4.35 % 0.842 +0.56 6.58 %

A per-station SARIMA model was more accurate than every ML model for rainfall (RMSE 126.5 mm) and humidity (3.79 %). Prediction intervals are 90 % season-stratified split-conformal intervals; their empirical coverage in 2018–2022 was 0.90–0.94 for these models.

Intended use and limitations

  • Intended use: research, teaching, and benchmarking of station-scale monthly forecasts for Bangladesh; a statistical complement to numerical weather prediction, not a replacement.
  • Not for warnings. Extreme rainfall months are strongly under-predicted (relative bias about βˆ’40 % above the station 95th percentile). Do not use these forecasts for flood or disaster warnings.
  • Skill is modest and variable.
    • The gain over climatology is modest.
    • Rainfall skill comes almost entirely from the Chittagong division and the monsoon season.
  • Humidity data shift. Humidity shows a level shift after 2014 that may reflect instrument changes.
  • Data coverage.
    • Only the 24 stations of the training panel are supported.
    • The data end in December 2022.
    • Forecasts for later months need new observations in the same format.

Citation

Das JR, Khan MAR, Ahammad I, Hosen A. Leakage controlled machine learning forecasting of monthly rainfall temperature and humidity across Bangladesh. Discover Environment (under review).

Data and licence

The original station observations belong to the Bangladesh Meteorological Department (BMD). The models and code are released under the MIT licence.

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using abir71/bd-weather-forecast-models 1