P-03Data · Artificial intelligence
Gemelo Socioeconómico LL
La Libertad as a network of 83 districts.
Graph of La Libertad’s 83 districts with GraphSAGE, community detection and a live scenario simulator.
- Year
- 2026
- Type
- Personal project
- Languages
- Python, TypeScript
- Demo
- Public
The problem
District socioeconomic indicators are usually analyzed in isolation, even though districts are related. Modeling them as a network makes those relationships explorable.
The approach
- The 83 districts are modeled as a graph, and GraphSAGE (PyTorch Geometric) learns an embedding for each district.
- Communities found with Louvain are compared with GraphSAGE + KMeans, including the Adjusted Rand Index computed in the browser.
- Leaflet map, t-SNE embedding explorer and a “What if…?” simulator that queries the model through FastAPI.
What it looks like

System flow
Drawn with the process flow diagram notation used in chemical engineering.
- Input
- Process
- Storage
- Output