# ML for soil prediction

> ML for soil prediction is an open-source agent skill for health and science. Guides an agent in choosing, tuning and interpreting ML models for soil property. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ccarbajal16/soil-dsm-skills/tree/main/plugins/dsm-soil/skills/ml-for-soil-prediction
- **Repository:** https://github.com/ccarbajal16/soil-dsm-skills
- **GitHub stars:** 13
- **License:** MIT
- **Skill name:** ml-for-soil-prediction
- **Collection:** https://github.com/ccarbajal16/soil-dsm-skills
- **Categories:** [health and science](https://ai-powered.com/categories/health-and-science)
- **Listing updated:** 2026-12-03

## About

This skill gives an agent a working knowledge base for machine-learning models that predict soil properties such as organic carbon, texture and pH. It compares Random Forest, Quantile Regression Forests, gradient boosting and deep learning, and explains when each tends to fit the data, with a clear warning that a tuned forest often beats a neural network on tabular soil and covariate data.

The guidance covers the modelling steps: preparing covariates and limiting data leakage, engineering features such as spectral ratios and spatial terms, benchmarking several algorithms under the same cross-validation, and modest hyperparameter tuning. It also explains how to obtain per-pixel prediction intervals and check their calibration, how to read metrics like R², bias and concordance, and how to spot overfitting from a gap between training and holdout fit.

Interpretation is handled through permutation importance and SHAP or partial dependence, with cautions that importance rankings are model-specific and reflect association rather than cause. The skill refers to companion skills for the full mapping workflow and for map validation, and it has no scripts. It is plain instructions, so the agent works from the data and tools it already has.

## When your agent uses it

> Choose, tune, and reason about machine-learning models for predicting soil properties (SOC, texture, pH, …) — Random Forest, Quantile Regression Forests, gradient boosting, and deep learning — including per-pixel uncertainty and interpretability. Use when the task is the ML modelling craft itself: which algorithm, how to tune it, how to get honest uncertainty, whether deep learning is worth it, why an ML model underperforms. Triggers: "random forest for soil", "QRF", "which ML model", "deep learning soil", "CNN / ANN soil carbon", "hyperparameters", "feature importance / SHAP", "prediction interval", "ML model gives bad R²".

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ccarbajal16/soil-dsm-skills/tree/HEAD/plugins/dsm-soil/skills/ml-for-soil-prediction)
- [License: MIT](https://github.com/ccarbajal16/soil-dsm-skills/tree/HEAD/plugins/dsm-soil/skills/ml-for-soil-prediction)

## Features

- **Model selection guidance:** Explains when Random Forest, QRF, gradient boosting, KNN or deep learning suit a given sample size and landscape.
- **Uncertainty estimation:** Describes obtaining per-pixel prediction intervals with QRF or bootstrapped neural networks and checking calibration.
- **Feature preparation:** Covers reducing redundant covariates, avoiding leakage in interpolated layers and engineering ratio, spatial and interaction terms.
- **Hyperparameter tuning:** Gives starting ranges for tree count and split features and advises cross-validated search without over-tuning.
- **Overfitting diagnosis:** Shows how to compare training fit with holdout or cross-validated fit and what to change when the gap is wide.
- **Model interpretation:** Outlines permutation importance, SHAP and partial dependence, with notes on their limits for causal claims.

## Good for

- Pick a suitable model for predicting soil organic carbon from a small field dataset
- Tune a random forest for soil pH mapping with cross-validation
- Produce prediction intervals for a soil texture map
- Work out why a soil model returns a negative R² on held-out samples
- Decide whether a deep learning approach is worth trying on spectral soil data
- Explain which covariates drive a soil property prediction

## Install

### Claude Code

This skill ships in the `dsm-soil` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add ccarbajal16/soil-dsm-skills
/plugin install dsm-soil@soil-dsm-skills
```

Or copy only this skill to `~/.claude/skills/ml-for-soil-prediction`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/ml-for-soil-prediction &&
cp -R "$tmp/plugins/dsm-soil/skills/ml-for-soil-prediction" ~/.claude/skills/ml-for-soil-prediction &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/ml-for-soil-prediction` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/ml-for-soil-prediction` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/ml-for-soil-prediction &&
cp -R "$tmp/plugins/dsm-soil/skills/ml-for-soil-prediction" ~/.agents/skills/ml-for-soil-prediction &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/ml-for-soil-prediction` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/ml-for-soil-prediction` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/ml-for-soil-prediction &&
cp -R "$tmp/plugins/dsm-soil/skills/ml-for-soil-prediction" ~/.cursor/skills/ml-for-soil-prediction &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/ml-for-soil-prediction` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/ccarbajal16/soil-dsm-skills.git --path plugins/dsm-soil/skills/ml-for-soil-prediction
```

Or copy the folder to `~/.gemini/skills/ml-for-soil-prediction` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/ml-for-soil-prediction`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/ml-for-soil-prediction &&
cp -R "$tmp/plugins/dsm-soil/skills/ml-for-soil-prediction" ~/.copilot/skills/ml-for-soil-prediction &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/ml-for-soil-prediction` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/ccarbajal16/soil-dsm-skills.git
```

Then copy `soil-dsm-skills/plugins/dsm-soil/skills/ml-for-soil-prediction` into your agent's skills folder as `ml-for-soil-prediction`. Agents that support SKILL.md read one folder per skill.

## FAQ

### Does ML for soil prediction run code or scripts?

No. It contains a single SKILL.md with guidance and no scripts.

### When should the agent use deep learning according to ML for soil prediction?

Deep learning is presented as worthwhile mainly with large, information-rich datasets such as dense covariate stacks or spectra. On small tabular samples a tuned Random Forest is usually the better choice.

### How does the skill suggest getting prediction uncertainty?

It recommends Quantile Regression Forests for per-pixel prediction intervals and checking them with coverage measures such as PICP.

### Which soil properties does ML for soil prediction cover?

The guidance names soil organic carbon, texture and pH as examples of soil properties to predict.

### How do I install ML for soil prediction in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/ml-for-soil-prediction to use it in all your projects, or to .claude/skills/ml-for-soil-prediction in one project. Or install the dsm-soil plugin, which includes it: /plugin marketplace add ccarbajal16/soil-dsm-skills, then /plugin install dsm-soil@soil-dsm-skills.

### Does ML for soil prediction run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use ML for soil prediction?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

### What are the best alternatives to ML for soil prediction?

The closest alternatives to ML for soil prediction are Soil map validation, Soil fertility mapping, Digital soil mapping workflow, Ensemble ML for soil and Hybrid process ML soc.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Soil map validation](https://ai-powered.com/skills/soil-map-validation): Soil map validation is an open-source agent skill for health and science.
- [Soil fertility mapping](https://ai-powered.com/skills/soil-fertility-mapping): Soil fertility mapping is an open-source agent skill for health and science.
- [Digital soil mapping workflow](https://ai-powered.com/skills/digital-soil-mapping-workflow): Digital soil mapping workflow is an open-source agent skill for health and science.
- [Ensemble ML for soil](https://ai-powered.com/skills/ensemble-ml-for-soil): Ensemble ML for soil is an open-source agent skill for health and science.
- [Hybrid process ML soc](https://ai-powered.com/skills/hybrid-process-ml-soc): Hybrid process ML soc is an open-source agent skill for health and science.
- [Soil quality index](https://ai-powered.com/skills/soil-quality-index): Soil quality index is an open-source agent skill for health and science.
- [Soc stock mrv](https://ai-powered.com/skills/soc-stock-mrv): Soc stock mrv is an open-source agent skill for health and science.
- [Rothc temporal modelling](https://ai-powered.com/skills/rothc-temporal-modelling): Rothc temporal modelling is an open-source agent skill for health and science.

---
Source: https://ai-powered.com/skills/ml-for-soil-prediction
