Skip to content

Match scikit-learn DBSCAN results - #6

Open
John-194 wants to merge 1 commit into
reliability-improvementsfrom
neighbour-radius-fix
Open

John-194 wants to merge 1 commit into
reliability-improvementsfrom
neighbour-radius-fix

Conversation

@John-194

Copy link
Copy Markdown
Owner

The grid looks up neighbour cells within a hop radius of sqrt(dim + 3) cell widths. That bound is only correct in 2D. In 3D and above it skips cells that can still hold points within eps, so a few points near cell boundaries get different labels than scikit-learn gives them. The correct bound is sqrt(4 * dim - 3) (in 2D the two are identical).

  • Results now match scikit-learn's DBSCAN exactly.
  • Cost: 4% - 7% slower in 3D, mostly because of a wider range query per cell.

…an hold points within eps are visited (sqrt(dim+3) only holds in 2D)
@John-194
John-194 added this pull request to stack #7 September 18, 2026 13:00
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.

1 participant