Skip to content

Commit

Permalink
fixed bug: _k_means._centers_dense Index out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVFeng committed May 6, 2020
1 parent 50cbca3 commit d4dcdbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clustering/equal_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ def _kmeans_single(X, n_clusters, x_squared_norms, max_iter=300,
precompute_distances=precompute_distances,
distances=distances)

sample_weight = [1.0] * np.asarray(len(labels))
sample_weight = np.asarray([1.0] * len(labels))
# computation of the means is also called the M-step of EM
if sp.issparse(X):
centers = _k_means._centers_sparse(X, sample_weight, labels, n_clusters,
Expand Down

0 comments on commit d4dcdbc

Please sign in to comment.