label a set of data points

20 Views Asked by At

I have a set of data points in a 3-dimensional space. Points are approximately in two rows, like this (with 3 in secondary row and 7 in primary row):

enter image description here

I need to label both rows separately. For example, the row with more data points could be labelled as primary row and the one with fewer points could be labelled as a secondary row.

I need to be able to label the rows first and then ultimately, I need to be able to label primary row points as 1-7 and secondary row points 8-10.

I have tried distance measures but some times a point could be in a primary formation but with a similar distance away as the points in secondary formation. There could be nois occasionally which also throws off the algorithms.

I am looking for a way that takes into account their relative alignment as well. Or, if just the alignment could help label them successfully that would be acceptable as well.