The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

xaiHydro

Explainable Artificial Intelligence Tools for Hydro-Climate Modelling

CRAN status License: GPL-3


Authors

Name Role Institution
Sadikul Islam Author, Maintainer (aut, cre) ICAR-Indian Institute of Soil and Water Conservation, Dehradun, India
Shakir Ali Author (aut) ICAR-Indian Institute of Soil and Water Conservation, Dehradun, India
Rajesh Kaushal Author (aut) ICAR-Indian Institute of Soil and Water Conservation, Dehradun, India

Maintainer: sadikul.islamiasri@gmail.com


Overview

xaiHydro provides a unified, hydrology-aware workflow for applying post-hoc Explainable Artificial Intelligence (XAI) to any trained hydro-climate predictive model. Three complementary attribution frameworks are implemented:

Method Reference xaiHydro function
SHAP Lundberg & Lee (2017) hydro_shap()
LIME Ribeiro et al. (2016) hydro_lime()
PDP / ALE Friedman (2001); Apley & Zhu (2020) hydro_pdp()
Permutation importance Breiman (2001) hydro_importance()
Breakdown profiles Biecek & Burzykowski (2021) hydro_breakdown()

An internal model registry auto-detects 13 machine-learning frameworks without user-written prediction wrappers. Hydrology-standard metrics NSE, KGE, and PBIAS are computed alongside RMSE and MAE.

Two fully synthetic datasets calibrated to Indian river-basin conditions enable complete reproducibility without proprietary gauge records: - sim_streamflow_data() – daily hydro-meteorological predictors and streamflow response (m3/s) - sim_drought_data() – monthly predictors and SPEI drought index


Installation

# CRAN (recommended)
install.packages("xaiHydro")

Quick start

library(xaiHydro)

# 1. Generate data
df <- sim_streamflow_data(n = 365, seed = 2026)
y  <- df$streamflow
X  <- df[, setdiff(names(df), "streamflow")]

# 2. Train any supported model
library(randomForest)
rf <- randomForest(x = X, y = y, ntree = 300)

# 3. Build the explainer (model class auto-detected)
exp <- hydro_explainer(rf, X, y, variable = "streamflow", units = "m3/s")

# 4. SHAP global summary
shv <- hydro_shap(exp, nsim = 50)
plot_shap_summary(shv, top_n = 8)

# 5. LIME local explanation
lr <- hydro_lime(exp, new_obs = X[1, , drop = FALSE])
plot_lime_hydro(lr)

# 6. PDP / ALE profiles
pdp <- hydro_pdp(exp, variable = c("precipitation", "soil_moisture"))
plot_pdp_hydro(pdp)

# 7. Permutation importance
imp <- hydro_importance(exp, B = 20)
plot_importance_hydro(imp)

# 8. Full report panel
hydro_xai_report(exp, nsim = 50, save_path = "xaiHydro_report.png")

Citation

citation("xaiHydro")

Package:

Islam, S., Ali, S., & Kaushal, R. (2026). xaiHydro: Explainable AI Tools for Hydro-Climate Modelling. R package version 0.1.0. https://CRAN.R-project.org/package=xaiHydro

Accompanying book chapter:

Islam, S., Dheeraj, A., Ali, S., Kaushal, R., & Venkatesh, G. (2026). Explainable Artificial Intelligence for Hydro-Climatic Modelling: Methods, Applications, and Implementation Using the xaiHydro R Package. In S. K. Chandniha, A. Mondal, S. Kundu, A. Pandey, & D. Naidu (Eds.), Hydro-Climate Analytics: Remote Sensing, AI and Geospatial Modelling. Springer.

Key review to cite alongside:

Zounemat-Kermani, M., & Kheimi, M. (2026). Explainable artificial intelligence in hydrology: A review. Water Resources Management, 40(3), 106. https://doi.org/10.1007/s11269-025-04435-9


Key references


License

GPL-3 (C) 2026 Sadikul Islam, Shakir Ali & Rajesh Kaushal

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.