[Python] DBSCAN clustering points one cluster having points very distant from each other)

Discussão em 'Python' iniciado por Stack, Junho 24, 2025.

  1. Stack

    Stack Membro Participativo

    I need to cluster a dataset of PFAS pollution, with coordinates (lat, lon). I tried to use DBSCAN as it seemed the go-to solution for spatial data clustering. I do get a result but it seems to be wrong.

    My code is available as a google colab notebook here: https://colab.research.google.com/d...scrollTo=d03ce965-ae61-464f-bab1-448c9bb9cce1 The map should even load without being logged in.

    The clustering seems to work, but when I look at the result on the map I see that some of it make no sense: There seem to be a cluster that has points super distant from each other, and much closer to other clusters. [​IMG]

    To be honest, it exactly looks like this previous question: DBSCAN clustering distant points together But I do pass my epsilon value in radians, and I also convert my lat/lon values to radians, so I don't see why it is happening.

    thanks in advance for your help!

    Another question: what clustering method would you recommend to have a max distance between the points of a cluster?

    Continue reading...

Compartilhe esta Página