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

Introduce minPoints option #156

Merged
merged 2 commits into from
Jun 2, 2020
Merged

Introduce minPoints option #156

merged 2 commits into from
Jun 2, 2020

Conversation

mourner
Copy link
Member

@mourner mourner commented Jun 1, 2020

Adds an option to set the minimum points required to form a cluster (2 by default).

  • Cover with tests.
  • Find out why unaffected clusters change slightly in the demo.

} else { // left points as unclustered
clusters.push(p);

if (numPoints > 1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why we compare numPoints with 1 instead of numPointsOrigin?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When numPointsOrigin is bigger than 1, it means that the origin is itself a cluster, which could only be formed from minPoints points or more. So in case of origin cluster, we never reach this else case (numPoints will always be >= minPoints).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! Thank you!

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

Successfully merging this pull request may close these issues.

2 participants