Predict flood extent caused by storms in southern Malawi
# Malawi Flood Extent Prediction
This competition is hosted on Zindi, a machine learning platform for data science challenges.
Here is the link to the competition: UNICEF Arm 2030 Vision #1: Flood Prediction in Malawi 🌾 - $10 000 USD
Ranked in the TOP 52%
---
Predicting the fraction of 1km² grid squares flooded in southern Malawi during Cyclone Idai (March 2019). Training data is the 2015 flood event. Evaluation: RMSE on flood fraction [0, 1]. Zindi competition sponsored by UNICEF and Arm.
## Key Engineering Decisions
**Train on one flood event, predict another.** The fundamental challenge is not generalization across rows — it's generalization across events. The model trained on 2015 data must predict 2019 (Cyclone Idai), a different storm with a different path, different rainfall distribution, and larger extent. Event-specific features from 2015 (individual week rainfall values) carry limited signal for 2019. The features that generalize are physical landscape invariants: terrain shape, soil properties, proximity to water. The pipeline prioritizes these.
**Terrain derivative features from elevation raster.** Elevation alone doesn't predict flooding — slope, flow direction, and terrain position do. A low-elevation flat plain pools water differently than a low-elevation hillside that drains rapidly. From the raw elevation grid, six terrain derivatives are computed:
```r
terrain_stack <- raster::terrain(
rast_elev,
opt = c("slope", "aspect", "tpi", "tri", "roughness", "flowdir"),
unit = "degrees", neighbors = 8
)
```
- **TPI** (Terrain Position Index): is this cell a depression or a ridge?
- **TRI** (Terrain Ruggedness Index): how rough is the local surface?
- **flowdir**: which of the 8 cardinal directions does water drain toward?
- **hillshade**: a proxy for local exposure and shadow patterns
**Zero-inflated target decomposition.** ~70% of grid squares have zero flood extent. A regression model minimizing RMSE on zero-inflated data will be pulled toward ne …