Climate Machine LearningXGBoostPyTorchSPEIpandas

Meteorological Drought Prediction (ANN & XGBoost)

Predicting the Standardized Precipitation Evapotranspiration Index (SPEI) using CMIP6 variables in Khyber Pakhtunkhwa.

Institution / OrgUET Peshawar Research
Year2025
R² Score0.91
RMSE0.42
Data Points450K+

Research Artifacts & Code

Computational Architecture

Computational Workflow

PHASE 01

Data Ingestion

Fetch CMIP6 netCDF data via xarray.

PHASE 02

Feature Engineering

Calculate SPEI and temporal lag features.

PHASE 03

Model Training

Hyperparameter tuning using XGBoost and validation sets.

PHASE 04

Spatial Inference

Project predictions onto the spatial grid for visualization.

Loading Chart Engine...
train_xgboost.py
python
"text-pink-500">import xgboost "text-pink-500">as xgb
"text-pink-500">from sklearn.metrics import mean_squared_error

"text-gray-500 italic"># Configure XGBoost for SPEI regression
params = {
    'objective': 'reg:squarederror',
    'max_depth': 6,
    'learning_rate': 0.05,
    'subsample': 0.8
}

model = xgb.XGBRegressor(**params)
model.fit(X_train, y_train, eval_set=[(X_val, y_val)], early_stopping_rounds=10)

"text-gray-500 italic"># Evaluate
preds = model.predict(X_test)
rmse = mean_squared_error(y_test, preds, squared=False)
"text-blue-400">print(f"Test RMSE: {rmse:.4f}")