8000 backward compatible np.newaxis · scikit-learn/scikit-learn@3e78842 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e78842

Browse files
author
bhsu
committed
backward compatible np.newaxis
1 parent 820549d commit 3e78842

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/cluster/k_means_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ def _mini_batch_step(X, x_squared_norms, centers, counts,
10731073
centers[center_idx] *= counts[center_idx]
10741074

10751075
# inplace sum with new points members of this cluster
1076-
weighted_X = np.multiply(sample_weight[center_mask, np.newaxis], X[center_mask])
1076+
weighted_X = np.multiply(sample_weight[center_mask][:, np.newaxis], X[center_mask])
10771077
centers[center_idx] += np.sum(weighted_X, axis=0)
10781078

10791079
# update the count statistics for this center

0 commit comments

Comments
 (0)
0