predict the number of sea turtles Local Ocean Conservation will rescue each week in Kenya
# Sea Turtle Rescue Forecast Challenge
This competition is hosted on Zindi, a machine learning platform for data science challenges.
Here is the link to the competition: Sea Turtle Rescue: Forecast Challenge 🌾 - Knowledge
Ranked in the TOP 66%
---
**Competition:** Zindi — Predict weekly sea turtle rescues per capture site for 2019
**Target:** `Capture_Number` (count per site per week)
**Metric:** RMSE
**Data:** 29 capture sites, weekly rescue counts from 1998–2018
## The Problem
Local Ocean Conservation rescues sea turtles caught in fishing nets across 29 sites in Kenya. The goal: forecast how many turtles each site will rescue each week in 2019, so staff and budget can be allocated in advance.
This is a multi-site time series forecasting problem with strong seasonality, sparse counts (many site-weeks with zero rescues), and a structural data gap in 2016.
## Architecture
```
00_config.R → Constants, libraries, parameters
01_data_loading.R → Load train.csv, build site×week grids for train/test
02_feature_engineering.R → Site aggregates, week aggregates, frequency, elasticity, clustering
03_time_series.R → Per-site STL+ETS forecasts with expanding-window backtesting
04_model_supervised.R → CatBoost + XGBoost using TS forecasts as features
05_ensemble.R → Weighted blend (70% TS + 30% CatBoost) → submission
MAIN.R → Run all steps sequentially
```
## Key Engineering Decisions
### 1. Hybrid TS + Supervised (Time Series as a Feature)
A pure time series model (STL+ETS per site) captures seasonality well but cannot learn cross-site patterns. A pure supervised model can use site features but struggles with temporal structure in sparse count data.
The solution: **use the time series forecast as a feature** in the supervised model. The supervised model learns when and how to deviate from the TS baseline.
But there's a training problem: if you only generate a TS forecast for 2019, the supervised model has n …