Skip to content
Costa Rica: Classifying Household Poverty

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.

LightGBMXGBoostCatBoostEnsemblingKaggle

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.

Bar chart of macro F1 for five models, the ensemble, and the tuned ensemble (opens in a new tab)
Five single models land within two points of each other. Combining them, then tuning one threshold per class, adds more than any single model does.

Out-of-fold macro F1

ModelMacro F1
Logistic regression0.407
XGBoost0.413
LightGBM0.415
Random forest0.416
CatBoost0.424
Ensemble of the five0.432
Ensemble with per-class thresholds0.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.