DB-Scan with ring like data

I've been using the DBScan implementation of python from sklearn.cluster. The problem is, that I'm working with 360° lidar data which means, that my data is a ring like structure.

To illustrate my problem take a look at this picture. The colours of the points are the groups assigned by DBScan (please ignore the crosses, they dont have anything to do with the task).

In the picture I have circled two groups which should be considered the same group, as there is no distance between them (after 2pi it repeats again obviously...)

Someone has an idea? Of course I could implement my own version of DB-Scan but my question is, if there is a way to use sklearn.cluster.dbscan with ring like structures.

Topic dbscan scikit-learn clustering

Category Data Science


This solved my problem:

https://stackoverflow.com/questions/48767965/dbscan-with-custom-metric

This is the formula I used for my distance, with n = 2*pi:

https://math.stackexchange.com/a/1149125

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.