
Costa Rica: Classifying Household Poverty
The Inter-American Development Bank's dataset describes 9,557 people in 2,988 Costa Rican households. The model assigns each household one of four poverty levels so that aid reaches the families who qualify.
9,557
people
2,988
households
231
engineered features
0.444
macro F1 after tuning
Problem
Understanding the challenge and user needs
Poverty is a household condition, but the data arrives one person per row, and the four classes are far from balanced. Macro F1 scores every class equally, so a model that ignores the rarest and poorest group fails.
Approach
Strategy and methods used to address the problem
Individual records rolled up into 231 household features. Five models trained under ten-fold stratified validation on heads of household: LightGBM, XGBoost, CatBoost, a random forest, and logistic regression. An ensemble combined them, and per-class thresholds tuned the final decision.
Final Solution
The final design and outcome
Single models scored between 0.407 and 0.424 macro F1. The ensemble reached 0.432, and threshold tuning lifted it to 0.444.
(opens in a new tab)Out-of-fold macro F1
| Model | Macro F1 |
|---|---|
| Logistic regression | 0.407 |
| XGBoost | 0.413 |
| LightGBM | 0.415 |
| Random forest | 0.416 |
| CatBoost | 0.424 |
| Ensemble of the five | 0.432 |
| Ensemble with per-class thresholds | 0.444 |
Ten-fold stratified validation on heads of household.
Impact & Validation
Results, learnings, and outcomes
Modeling at the level where the decision happens, the household, mattered more than any single algorithm choice.