I am trying to identify rows in groups of points using clustering algorithms. The bigger picture problem I'm trying to solve is to identify shelves given x and y coordinates of products. I can cluster based on just the y-coordinates and I get decent clustering using algorithms such as HDBSCAN.
I am wondering if it is possible to also incorporate the x-coordinates somehow into the clustering as it feels like a waste of helpful information to simply discard the x-coordinated.
However, if I put the x-coordinates into my clustering algorithm (i.e. each point is now represented by a 2D vector), the clustering is poor because two points at opposite ends on the x-axis are considered not related as compared to two points directly below each other albeit on different shelves.