Case study · Research, Universidad Icesi · 2024 to 2025
Electoral behaviour beyond city limits: K-means on Cali's polling stations
With Juan Pablo Milanese at Universidad Icesi, I used clustering to ask whether the vote around Cali follows municipal borders or a wider metropolitan pattern. The method won first place in FLACSO Ecuador's TechPolítica contest in 2024, and the paper was published in GEOgraphia in 2025.
- Data
- 2022 Senate results · ~700 polling stations
- Area
- 21 municipalities, 2 departments
- Methods
- K-means · DBSCAN · OPTICS
Why clustering
Electoral studies usually treat each municipality as its own unit. Metropolitan areas do not respect those lines: people commute, move and vote across them. Clustering polling stations on their results, with no borders built in, shows which places vote alike, whatever municipality they belong to.
Data and method
We used Registraduría results for the 2022 Senate election from about 700 polling stations in 21 municipalities across two departments. The main model is K-means, with the number of clusters chosen by silhouette score (between 4 and 6). To check that the groups are not an artefact of one algorithm, I re-ran the analysis with DBSCAN, OPTICS, BIRCH and Gaussian mixture models.
Results
The algorithms broadly agree on the clusters, so the metropolitan pattern is stable across methods. The main exception is Palmira, which falls outside the Cali cluster under the density-based methods (DBSCAN and OPTICS).
Publication
Milanese, J. P. & Navarro, D. (2025). Más allá de los límites municipales: análisis de la metropolización del comportamiento electoral en Cali utilizando K-Means Clustering. GEOgraphia (Universidade Federal Fluminense).