Skip to content
Snippets Groups Projects
Commit dc5d57de authored by Gael Varoquaux's avatar Gael Varoquaux Committed by Lars Buitinck
Browse files

ENH: Remove unused copy in k-means

One copy was done above the copy removed.
parent 7c2cd61a
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,12 @@
======
Enhancements
------------
- Minor performance improvements to k-means by `Gael Varoquaux`_.
Bug fixes
---------
......
......@@ -237,8 +237,7 @@ def k_means(X, n_clusters, init='k-means++', precompute_distances=True,
if not sp.issparse(X) or hasattr(init, '__array__'):
X_mean = X.mean(axis=0)
if not sp.issparse(X):
if copy_x:
X = X.copy()
# The copy was already done above
X -= X_mean
if hasattr(init, '__array__'):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment