Skip to content

Commit 635ab93

Browse files
committed
DBSCAN: Slight performance improvement.
1 parent e3d1d9c commit 635ab93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/cluster/dbscan_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def dbscan(X, eps=0.5, min_samples=5, metric='minkowski',
153153
labels[noise] = label_num
154154
# A candidate is a core point in the current cluster that has
155155
# not yet been used to expand the current cluster.
156-
candidates = np.intersect1d(noise, core_samples)
156+
candidates = np.intersect1d(noise, core_samples, assume_unique=True)
157157
# Current cluster finished.
158158
# Next core point found will start a new cluster.
159159
label_num += 1

0 commit comments

Comments
 (0)