Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate point in noise & cluster #9

Open
rugleb opened this issue Nov 12, 2024 · 2 comments
Open

Duplicate point in noise & cluster #9

rugleb opened this issue Nov 12, 2024 · 2 comments

Comments

@rugleb
Copy link

rugleb commented Nov 12, 2024

Is it correct to add the point to the noise at this step?

		if len(neighborPts) < minPoints {
			noise = append(noise, i)
		}

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.

@rugleb
Copy link
Author

rugleb commented Nov 12, 2024

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)
		}
	}

@smira
Copy link
Owner

smira commented Nov 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants