Description
This repository and release accompanies the paper "Contrasting Climate - Yield Response Patterns of Rainfed Maize Across Sub-Saharan African Agroecological Zones" (under review). The preprint can be found here. This repository provides all scripts, configuration files, and supporting documentation required to reproduce the analysis of rainfed maize yield responses to seasonal climate variability across Sub-Saharan Africa using the Evidence for Resilient Agriculture (ERA) dataset.
The repository includes data preparation, model training, bootstrap resampling, and SHAP-based explainability workflows for understanding climate–yield relationships across diverse Agro-Ecological Zones (AEZs). The analysis focuses on rainfed maize trials (n = 11,166), integrating climate predictors from CHIRPS and NASA POWER datasets.
All workflows are implemented in R and rely on reproducible YAML configurations. While designed for maize, the workflow can be adapted to other crops with minimal modification.
Contents
workflow/ - Main analysis scripts (Random Forest, SHAP analysis, visualization)
data_preparation/ - Scripts for processing ERA climate and soil data
outputs/ - Example outputs (model performance, SHAP plots, bootstrap uncertainty)
requirements.txt - Required R libraries
workflow/config/ - YAML configuration files controlling data paths, model settings, and preprocessing options
Acknowledgements
This work was supported by the Alliance of Bioversity International and CIAT and through the the Africa Agriculture Adaptation Atlas and the CGIAR Science Programs.