gboeing/data-visualization

if min_samples>1, then def dbscan_reduce errors out

gauravagnihotri opened this issue · 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)