Replication package: Predicting Agricultural Supply Chain Disruption (18-country version)
Abstract
Replication package for "Predicting Agricultural Supply Chain Disruption: A Machine Learning Approach Using Trade, Climate, and Production Data" (18-country revision, 2026) This package contains the complete raw data, analysis code, and derived outputs needed to reproduce every table, figure, and statistic reported in the paper. The study tests whether agricultural trade disruption can be predicted from country-level and commodity-level production, trade, and climate data across 18 countries and 5 commodities (wheat, rice, maize, soybeans, dairy), 2005–2024, and finds that neither level of prediction outperforms chance once cross-validation is corrected for year-level dependence in the panel — a negative result that also identifies and corrects a cross-validation leakage flaw present in an earlier 13-country version of this analysis. Contents raw_data/ — FAOSTAT production data (QCL domain, downloaded 18 September 2026), two UN Comtrade/ComtradePlus trade-flow exports (HS 0401, 1001, 1005, 1006, 1201; reporter-to-World; 2004–2025), and the World Bank Climate Change Knowledge Portal CRU-TS 4.10 annual temperature and precipitation timeseries (1901–2025). code/ — pipeline.py (panel construction, disruption-event labelling, feature engineering, model definitions, and statistical tests) and run_all.py (the driver script that produces every result in the paper, including a reproduction of the earlier 13-country version under its original rules) and make_figures.py. outputs/ — the assembled 18-country country-commodity-year panel, the commodity-year panel with out-of-fold predictions under both shuffled and leave-one-year-out cross-validation, the 13-country-versus-18-country HHI comparison, the 90-pair vulnerability index with all components, label-permutation null distributions, and a single results.json containing every statistic quoted in the manuscript text. figures/ — all figures as they appear in the paper. Running run_all.py on the raw data regenerates the full results file from scratch (~25 minutes on one CPU core). Software: Python 3.12.3, pandas 3.0.2, scikit-learn 1.8.0, xgboost 3.4.1, numpy 2.4.4, scipy 1.17.1; all random seeds fixed at 42. Keywords: agricultural supply chains, disruption prediction, machine learning, cross-validation leakage, reproducibility, food security, climate risk, trade vulnerability