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

Gemelo Digital main view: “Socioeconomic communities of La Libertad”, the model explanation and metric cards such as the 83 districts.
Screenshot of the demo’s public screen.

System flow

Drawn with the process flow diagram notation used in chemical engineering.

Flow diagram: 83 districts → Graph → GraphSAGE → FastAPI → Map123483 districtsGraphGraphSAGEFastAPIMap
  • Input
  • Process
  • Storage
  • Output

More projects