Reproducibility repository for Value of Information in Soil Measurement Acquisition for Site-Specific Fertilizer Recommendation, prepared for the Second Workshop on ML×OR at NeurIPS 2026.
Soil measurements are commonly treated as fixed inputs to fertilizer recommendation models. Operationally, however, soil information must first be acquired through sampling and laboratory analysis, and different measurements carry different costs and uncertain downstream value.
This repository studies soil testing as an information-allocation problem. Rather than asking only which fertilizer action should be predicted, the analysis asks which soil measurement or measurement bundle should be acquired before the downstream fertilizer decision is made.
The framework combines machine learning with empirical value of information and budgeted subset optimization. Candidate measurements are evaluated according to their reduction in cross-validated downstream NPK reference-action loss rather than generic feature importance.
Soil testing creates a sequential decision problem: a recommendation system may receive management context before laboratory measurements, while each additional soil test has a monetary cost and uncertain decision value. A value-of-information formulation is developed for fertilizer decision support. For a measurement subset, cross-validated downstream action loss defines empirical risk; marginal value of information is the reduction in that loss, and a budgeted subset problem selects measurements with minimum risk subject to laboratory cost. A multi-environment benchmark uses 18 tomato environments from Latin America with soil pH, organic matter, phosphorus, potassium, and recorded extra amounts of N-P-K fertilizer. The recorded fertilizer vector is treated strictly as a historical reference action, not as a causal agronomic optimum. Under leave-one-environment-out validation with a standardized multi-output ridge model, organic matter is the best singleton and reduces normalized action loss by 3.48% relative to a no-soil baseline. Its paired 95% bootstrap interval spans zero (
The analysis asks:
Which soil measurement, or measurement bundle, should be acquired when soil information is costly and downstream fertilizer-decision fidelity is the objective?
For an acquired measurement set
The empirical marginal value of information of an unobserved measurement
Positive values indicate improved held-out reference-action fidelity; negative values indicate that the additional measurement degrades performance under the validation distribution.
Under measurement budget
Because only four candidate soil measurements are considered, all 16 subsets can be enumerated exactly.
The empirical benchmark uses the public agridat::ortiz.tomato.covs dataset derived from Ortiz, Crossa, Vargas, and Izquierdo (2007), Studying the Effect of Environmental Variables on the Genotype × Environment Interaction of Tomato, Euphytica 153:119–134.
The dataset contains 18 tomato environments in Latin America with soil, site, management, climate, and fertilizer-management variables.
- soil pH
- organic matter (OM)
- soil phosphorus (P)
- soil potassium (K)
- irrigation (
Irr) - trimming (
Trim) - driving (
Driv)
Latitude and longitude are preserved in the bundled public file but excluded from the primary predictive baseline. The public table reports a longitude for environment E05 that is geographically inconsistent with its documented environment label. No inferred coordinate correction is introduced.
- extra nitrogen,
ExN - extra phosphorus,
ExP - extra potassium,
ExK
The recorded extra N-P-K amounts are treated strictly as historical reference actions. They are not interpreted as experimentally verified fertilizer optima.
The central model is a standardized multi-output ridge regression with
Each of the 18 environments is held out once using leave-one-environment-out validation. Prediction error is evaluated with normalized NPK action loss:
The notebook evaluates all
possible soil-measurement subsets on identical held-out environments. Uncertainty in the singleton value of information is estimated using 10,000 paired bootstrap resamples.
The single notebook implements the full computational workflow:
- Loads the bundled public tomato dataset, with a public URL fallback.
- Audits the environment coordinates and defines the coordinate-free primary context.
- Fits standardized multi-output ridge regression under leave-one-environment-out validation.
- Evaluates all 16 soil-measurement subsets.
- Computes normalized downstream NPK reference-action loss.
- Computes singleton empirical value of information.
- Performs 10,000 paired bootstrap resamples over held-out environments.
- Identifies the exact best subset at each measurement count.
- Enumerates all 256 heterogeneous relative-cost vectors and 2,612 attainable cost-budget cases.
- Compares the exact budget oracle with a positive-VOI-per-cost sequential policy.
- Evaluates a public laboratory-menu cost illustration.
- Runs ridge-penalty sensitivity analysis.
- Regenerates all paper and supplementary figures and machine-readable results.
- Executes scientific assertions matching the manuscript claims.
Under the primary coordinate-free context, the exact subset frontier is:
| Measurements | Best subset | LOEO normalized action loss | Change vs. no-soil |
|---|---|---|---|
| 0 | none | 1.4429 | 0.00% |
| 1 | OM | 1.3927 | +3.48% |
| 2 | OM + K | 1.4168 | +1.81% |
| 3 | OM + P + K | 1.4461 | -0.22% |
| 4 | pH + OM + P + K | 1.4944 | -3.57% |
Organic matter is the best singleton. Adding measurements does not monotonically improve held-out decision fidelity: the complete four-measurement panel is 7.30% worse than OM alone and 3.57% worse than the no-soil baseline.
For organic matter, the empirical singleton value of information is
normalized-loss units, with paired 95% bootstrap interval
The interval crosses zero. The observed singleton ranking therefore should not be interpreted as a universal agronomic hierarchy.
Each of the four candidate measurements receives a relative cost from
producing 256 cost vectors and 2,612 attainable cost-budget cases.
The sequential policy maximizes positive marginal VOI per unit cost and stops when no feasible measurement has positive marginal VOI.
- exact-oracle agreement: 97.05%;
- mean regret: 0.0000176 normalized-loss units;
- maximum regret: 0.0005968;
- exact oracle leaves available budget unspent in 78.71% of cases.
The 77 mismatch cases (2.95%) are informative: the exact oracle selects P+K even though neither P nor K has positive singleton VOI from the no-soil baseline. This exposes measurement complementarity that a myopic singleton policy cannot discover.
Across all 2,612 exact budget problems, the selected oracle subsets are:
| Oracle subset | Cases | Fraction |
|---|---|---|
| OM | 2,023 | 77.45% |
| none | 512 | 19.60% |
| P + K | 77 | 2.95% |
Ridge penalties
are evaluated. OM remains the highest-value singleton at all four penalties, although the magnitude of its empirical VOI changes substantially. This supports the qualitative ranking under the tested regularization grid while preserving substantial sample uncertainty.
Primary dataset:
agridat::ortiz.tomato.covs
Public documentation:
https://kwstat.github.io/agridat/reference/ortiz.tomato.html
Public CSV mirror:
https://raw.githubusercontent.com/vincentarelbundock/Rdatasets/refs/heads/master/csv/agridat/ortiz.tomato.covs.csv
The repository preserves the public CSV unchanged. Additional provenance and the coordinate-quality decision are documented in data/PROVENANCE.md.
Use the Open in Colab badge at the top of this README after the notebook has been committed as:
soil-measurement-acquisition.ipynb
Clone the repository:
git clone https://github.com/abdelghanibelgaid/soil-measurement-acquisition.git
cd soil-measurement-acquisitionInstall dependencies:
python -m pip install -r requirements.txtStart Jupyter:
jupyter notebook soil-measurement-acquisition.ipynbThe bundled public dataset makes the primary analysis network-independent after dependencies are installed. If the bundled CSV is absent, the notebook falls back to the public Rdatasets mirror.
soil-measurement-acquisition/
├── soil-measurement-acquisition.ipynb
├── README.md
├── requirements.txt
├── LICENSE
├── data/
│ ├── ortiz_tomato_covs.csv
│ └── PROVENANCE.md
├── results/
│ ├── subset_results.csv
│ ├── oracle_by_k.csv
│ ├── singleton_voi_bootstrap.csv
│ ├── greedy_equal_cost.csv
│ ├── random_order.csv
│ ├── cost_grid_results.csv
│ ├── cost_oracle_distribution.csv
│ ├── ridge_sensitivity.csv
│ ├── lab_menu_results.csv
│ └── paper_quantities.json
└── figures/
├── figure1_frontier.png
├── figure2_singleton_voi.png
└── figureS1_lab_cost_menu.png
The notebook is the computational source of truth. The committed results/ and figures/ directories provide immediately inspectable outputs and are overwritten when the notebook is rerun.
This repository reproduces a public-data methodological benchmark for soil measurement acquisition.
Important interpretation boundaries include:
- only 18 environments are available;
- fertilizer variables are historical management observations rather than randomized fertilizer-response optima;
- empirical value of information is defined through held-out reference-action loss;
- latitude and longitude are excluded from the primary predictive context because of a public coordinate-quality anomaly;
- the analysis does not estimate causal fertilizer effects;
- the analysis does not claim improvements in crop yield, farmer profit, nutrient-use efficiency, or environmental outcomes;
- measurement rankings remain sample- and model-dependent;
- prospective agronomic validation would require trials containing pre-treatment soil measurements, randomized nutrient rates, crop response, and measurement costs.
The benchmark should therefore be interpreted as evidence for the information-acquisition formulation, not as a prescriptive soil-testing hierarchy.
The paper is prepared for workshop submission. A final BibTeX citation can be added after the review process.
For now, please cite the repository title:
Value of Information in Soil Measurement Acquisition for Site-Specific Fertilizer Recommendation. Submission to the Second Workshop on ML×OR at NeurIPS 2026.
Workshop: Second Workshop on ML×OR: Mathematical Foundations and Operational Integration of Machine Learning for Uncertainty-Aware Decision-Making
Conference: 40th Conference on Neural Information Processing Systems, NeurIPS 2026
Location: Atlanta, Georgia, USA
Submission page: https://openreview.net/group?id=NeurIPS.cc/2026/Workshop/MLxOR
agridatdataset documentation: https://kwstat.github.io/agridat/reference/ortiz.tomato.html- Public Rdatasets mirror: https://vincentarelbundock.github.io/Rdatasets/
- Machine Learning-Based Optimization of Site-Specific NPK Fertilizer Recommendation: https://doi.org/10.1016/j.atech.2026.101823
Note: The repository accompanies a methodological study of the value of soil information for fertilizer decision support. The results motivate explicit evaluation of measurement value and acquisition cost before soil variables are assumed to be freely available to a recommendation system.