You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that there is duplicate codes in _labels_inertia_precompute_dense function. initial_assignment function and below for loop is doing same thing.
labels, mindist = initial_assignment(labels, mindist, n_samples, all_distances, max_cluster_size)
all_points = np.arange(n_samples)
for point in all_points:
for point_dist in get_best_point_distances(point, all_distances):
cluster_id, point_dist = point_dist
# initial assignment
if not is_cluster_full(cluster_id, max_cluster_size, labels):
labels[point] = cluster_id
mindist[point] = point_dist
break
Following code is initial_assignment function.
def initial_assignment(labels, mindist, n_samples, all_distances, max_cluster_size):
"""Initial assignment of labels and mindist"""
all_points = np.arange(n_samples)
for point in all_points:
for point_dist in get_best_point_distances(point, all_distances):
cluster_id, point_dist = point_dist
# initial assignment
if not is_cluster_full(cluster_id, max_cluster_size, labels):
labels[point] = cluster_id
mindist[point] = point_dist
break
return labels, mindist
The text was updated successfully, but these errors were encountered:
I think that there is duplicate codes in
_labels_inertia_precompute_dense
function.initial_assignment
function and below for loop is doing same thing.Following code is
initial_assignment
function.The text was updated successfully, but these errors were encountered: