Open rugleb opened 1 week ago
I think correct way like this:
if len(neighborPts) < minPoints {
continue
}
// expand cluster
//...
Then after main cycle:
for for i := 0; i < len(points); i++ {
// build clusters
}
for i, member := range members {
if !member {
noise = append(noise, i)
}
}
The algorithm is described in the comments above, if you feel the implementation is wrong, or the algorithm is wrong, please feel free to open a PR with some tests showing corrected behavior.
Is it correct to add the point to the noise at this step?
As far as I understand, there may be a situation where a point from the noise will be added to the cluster later. Thus, the total number of points in clusters + noise will be greater than the total number of points.