Skip to content

Commit 42b2995

Browse files
committed
BUG: fix test to use sparse array
1 parent a2e37eb commit 42b2995

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sklearn/cluster/tests/test_k_means.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,13 @@ def test_minibatch_reassign():
325325
for this_X in (X, X_csr):
326326
mb_k_means = MiniBatchKMeans(n_clusters=n_clusters, batch_size=1,
327327
random_state=42)
328-
mb_k_means.fit(X)
328+
mb_k_means.fit(this_X)
329329
centers_before = mb_k_means.cluster_centers_.copy()
330330
try:
331331
old_stdout = sys.stdout
332332
sys.stdout = StringIO()
333333
# Turn on verbosity to smoke test the display code
334-
_mini_batch_step(X, (X ** 2).sum(axis=1),
334+
_mini_batch_step(this_X, (X ** 2).sum(axis=1),
335335
mb_k_means.cluster_centers_,
336336
mb_k_means.counts_, np.zeros(X.shape[1], np.double),
337337
False, random_reassign=True, random_state=42,

0 commit comments

Comments
 (0)