Reproducible soil nutrient prediction pipeline for Africa using tabular soil chemistry, remote sensing, and environmental covariates.
# Rhea Soil Nutrient Prediction Challenge
A reproducible machine learning pipeline for predicting 13 soil nutrient concentrations across Africa using tabular soil chemistry, remote sensing, and environmental covariates.
## Project Summary
- **Goal:** Predict 13 soil nutrient concentrations for test locations using tabular soil data, remote sensing features, and environmental covariates.
- **Targets:** `Al`, `B`, `Ca`, `Cu`, `Fe`, `K`, `Mg`, `Mn`, `N`, `Na`, `P`, `S`, `Zn`
- **Metric:** RMSE averaged across all nutrients.
- **Masking rule:** `TargetPred_To_Keep.csv` identifies which nutrient values may be submitted; masked entries must be forced to zero before submission.
## What’s Included
- `data/raw/`: original competition CSVs
- `data/external/`: downloaded Earth observation and soil grid data
- `outputs/eda_plots/`: EDA visualizations
- `src/`: project scripts for data download, feature engineering, model training, and prediction
- `notebooks/`: exploratory analysis notebooks
- `submissions/`: generated submission files
## Repository Structure
| Path | Purpose |
|---|---|
| `data/raw/` | Competition data inputs (train, test, sample dates, masks) |
| `data/external/` | EO and SoilGrids data caches |
| `src/download_eo_data.py` | Download SoilGrids / WorldClim / Sentinel2-derived features |
| `src/feature_engineering.py` | Create engineered model features from raw + external data |
| `src/train.py` | Train models, generate predictions, and apply submission mask |
| `notebooks/` | Exploratory notebooks and analysis scripts |
| `submissions/` | Final submission files |
## Setup
```bash
pip install -r requirements.txt
```
If you have a Python environment manager available, create and activate a virtual environment first.
## Workflow
### 1. Exploratory Data Analysis
```bash
python notebooks/01_EDA.py
```
Purpose: understand nutrient distributions, missing values, depth patterns, and spatial coverage.
### 2. Download External Data
```bash
python src/d …