/dsm-soil:ml-for-soil-predictionfrom dsm-soil
Guides ML model selection, tuning, and uncertainty quantification for predicting soil properties (SOC, texture, pH). Covers Random Forest, QRF, gradient boosting, and deep learning, emphasizing soil-science-informed ML.
Ships in dsm-soil. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Forged from the DSM knowledge wiki (21 sources). The wiki is the source of truth. Key pages: random-forest, quantile-regression-forests, deep-learning, feature-selection, accuracy-metrics, model-interpretability, spatial-cross-validation, scale-dependence. For the full project flow use digital-soil-mapping-workflow; for validation depth use soil-map-validation.
| Model | Use it for | Notes |
|---|---|---|
| Random Forest | default workhorse | robust to noise/skew, no distribution assumptions, handles non-linearity; tune ntree (~200–1000), mtry (≈√p) |
| spatialRF | absorbing spatial autocorrelation | internally generates spatial predictors; strong performer |
| Quantile Regression Forests (QRF) | per-pixel uncertainty | full conditional distribution → prediction intervals; the go-to for uncertainty |
| Gradient Boosting | sequential error-correcting ensemble | can be accurate but tuning-sensitive |
| Deep learning (CNN/ANN) | spatial context, multi-task, large scale | CNN uses covariate windows / multi-property; often only matches a tuned RF on tabular data |
The corpus is blunt about this. A tuned Random Forest frequently beats deep learning on tabular soil+covariate data (Sarkar: RF 0.87 vs ANN 0.78), and in small-sample, non-stationary regimes ML can lose outright to classical spatial regression — even scoring negative R² (Carbajal). Meanwhile RF wins elsewhere (Parvizi). Model choice is regime-dependent: match the model to sample size, heterogeneity, and available spatial covariates — don't reach for the fanciest tool by default. DL has a data-size threshold: Padarian's multi-task CNN crushed Cubist on ~19k spectra but lost to it on 390 samples — deep learning pays off only with a large, information-rich dataset (dense covariate stacks, spectra), where multi-task (predicting correlated properties jointly) adds real synergy. Below that, a tuned RF/QRF (or GWR) wins.
The through-line of everything below is soil-science-informed ML (SoilML): ML finds non-linear patterns, but pedological knowledge must guide covariate choice, model design, and interpretation so predictions stay physically plausible — not resting on spurious, snapshot correlations. Three levers (Yang & Li 2026; Minasny 2024): (1) expert covariate selection (choose drivers known to shape soil — e.g. parent material for nutrients — over a blind hundreds-of-layers dump); (2) knowledge in structure/loss (PINN-style; feasible for neural nets, not fixed-structure RF → for RF, encode knowledge via covariates and the hybrid route); (3) soil-meaningful pretext tasks for self/semi-supervised learning under label scarcity. The process+ML hybrid and the "association ≠ causation" caution are instances of SoilML, not separate ideas. Posture: you direct, the model executes — don't just feed it rasters.
RF's "overfit-proof" reputation is conditional. Always compare training fit to an independent holdout / CV. A large gap — Ngubo saw RF train R²≈0.93–0.94 → test ≈0.53–0.55 — signals memorised noise from high-dimensional inputs, heterogeneous terrain, or a non-representative sample. In the same study regression kriging under-fit training (R²≈0.29–0.37) yet generalised as well or better: strong calibration is not evidence of a good map. If the gap is wide, prune covariates, add spatial handling, or switch model family — don't ship on OOB/training numbers.
v1 (ML-understanding upgrade). Distilled from Jafari, Shi, Wadoux (2019 & 2026), Hengl, Tian, Sarkar,
Rohmer, Carbajal, Parvizi, Mousavi, Ngubo, Yang & Li 2026 (SoilML + DL paradigms), and the ML-understanding
batch: Padarian 2020 (meta-review: no universal winner, parsimony + interpretability), Radočaj 2024
(15-algorithm audit; popularity≠accuracy; NRMSE), Padarian 2018 (CNN/multi-task; DL data-size threshold),
Campbell 2019 (feature engineering: geophysical/spatial covariates), Nwamekwe 2025 (feature engineering;
small-n overfitting caution), Córdoba 2025 (QRF best in Argentina; variable importance is model-relative).
Full citations in the wiki sources/.
Portable build from the DSM knowledge wiki (the source of truth). Obsidian cross-references were flattened for standalone use; regenerate with build.ps1.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ccarbajal16/soil-dsm-skills --plugin dsm-soil12 skills in this plugin
/digital-soil-mapping-workflowRun a digital soil mapping (DSM) project end to end — from framing the target and assembling scorpan covariates, through sampling design, model selection, handling spatial autocorrelation, training, and producing a map with calibrated uncertainty. Use when planning or reviewing any project that predicts a soil property (SOC, texture, pH, …) across space (and optionally time) from environmental covariates. Triggers: "digital soil mapping", "DSM", "predict soil property from covariates", "soil map", "scorpan", "which model for soil mapping", "covariates for soil", "map SOC / soil carbon"./ensemble-ml-for-soilDecide whether to combine machine-learning models at all, and if so how — by measuring the gain available before building any combiner. Covers the ambiguity/diversity ceiling, the weighting spectrum (simple average, R²-weighted, Bates–Granger, AIC/BIC, NNLS/SuperLearner, Granger–Ramanathan, learned meta-models, attention, per-pixel selection), out-of-fold stacking under spatial CV, cross-fitting the combiner, voting for classification, and significance testing of the margin. Use when someone proposes an ensemble, reports an ensemble gain, or asks whether their averaging scheme is "too simple". Triggers: "ensemble machine learning", "model stacking", "stacked generalisation", "SuperLearner", "meta-learner", "meta-model", "weighted average ensemble", "R2-weighted ensemble", "simple average ensemble", "Bates-Granger", "Granger-Ramanathan", "NNLS weights", "non-negative least squares", "caretStack", "mlr3pipelines stacking", "voting ensemble", "hard voting", "soft voting", "blending", "bagging vs boosting vs stacking", "ensemble gain", "does stacking help", "combine RF and XGBoost", "which model to combine", "base learner diversity", "error correlation", "out-of-fold predictions", "level-one dataset", "landmap", "MACHISPLIN", "spatial ensemble", "per-pixel model selection", "combine my model with SoilGrids"./hybrid-process-ml-socDesign and build hybrid soil-organic-carbon models that fuse a process-oriented model (RothC / CENTURY / Millennial) with machine learning (Random Forest / QRF) to predict SOC stock in space AND time — getting ML's spatial accuracy together with the process model's physically-plausible temporal dynamics. Use when a task needs SOC *change* over time (not just a static map), when pure ML gives implausible temporal trends, or when integrating mechanistic knowledge into data-driven soil mapping. Triggers: "hybrid soil carbon model", "process + machine learning", "POML", "space-time SOC", "RothC + random forest", "physically plausible SOC prediction", "knowledge-guided ML for soil"./rothc-temporal-modellingSet up, initialize, calibrate, validate, and interpret the RothC (Rothamsted Carbon) model — and CENTURY-family process models — for simulating soil organic carbon stock and its change over time. Use when modelling SOC dynamics under management or climate scenarios, initializing RothC pools (spin-up), calibrating decay constants, choosing carbon inputs, adapting RothC to a region/practice, or judging whether a RothC result is trustworthy. Triggers: "RothC", "CENTURY / CenW", "soil carbon model", "carbon pools DPM/RPM/BIO/HUM/IOM", "spin-up / initialize SOC pools", "calibrate RothC", "SOC under climate change", "carbon input estimation", "first-order decay"./soc-stock-mrvQuantify, report, and verify soil-organic-carbon stock and its change over time for carbon markets / MRV (Monitoring, Reporting, Verification) — computing SOC stock, estimating change and its uncertainty at the field/project support, and applying the uncertainty deduction that determines creditable tons. Use when a task involves soil carbon crediting, an MRV framework (VM0042, VT0014), SOC stock-change detectability, or reporting SOC with defensible uncertainty. Triggers: "SOC MRV", "soil carbon credits", "carbon farming verification", "SOC stock change", "uncertainty deduction", "how much SOC can we credit", "monitoring reporting verification soil carbon"./soil-fertility-mappingProduce national/regional maps of multiple soil fertility properties and nutrients from harmonized legacy data with machine learning, and integrate them into a composite Soil Fertility Index (SFI) with honest, propagated uncertainty. Use when the goal is a multi-property fertility product (texture, pH, CEC, OC, N, P, K, Ca, BD) at broad scale — a GSNmap-style national soil-nutrient assessment, a fertility/soil-quality index, or region-specific management diagnosis. Triggers: "soil fertility map", "soil fertility index", "SFI", "nutrient mapping", "GSNmap", "map N P K", "soil quality index", "national soil property maps", "map CEC / pH / texture".Other plugins' skills for the same job