data-visualization icon indicating copy to clipboard operation
data-visualization copied to clipboard

if min_samples>1, then def dbscan_reduce errors out

Open gauravagnihotri opened this issue 1 year ago • 0 comments

I think this particular piece of code causes error num_clusters = len(set(cluster_labels))

clusters = pd.Series([coords[cluster_labels==n] for n in range(num_clusters)])

since when min_samples>1, there are points that are considered 'noisy' and get a label '-1' that label should be discarded,

cluster_set = set(cluster_labels)

if -1 in cluster_set: cluster_set.remove(-1)

num_clusters = len(cluster_set)

gauravagnihotri avatar May 17 '23 00:05 gauravagnihotri