DOC add note on last iteration on kmeans
Fixes
@@ -889,7 +889,7 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin):
Notes
------
- The k-means problem is solved using Lloyd's algorithm.
+ The k-means problem is solved using either Lloyd's or Elkan's algorithm.
The average complexity is given by O(k n T), were n is the number of
samples and T is the number of iteration.
@@ -902,6 +902,12 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin):
clustering algorithms available), but it falls in local minima. That's why
it can be useful to restart it several times.
+ If the algorithm stops before fully converging (because of ``tol`` of
+ ``max_iter``), ``labels_`` and ``means_`` will not be consistent, i.e. the
+ ``means_`` will not be the means of the points in each cluster.
+ Also, the estimator will reassign ``labels_`` after the last iteration to
+ make ``labels_`` consistent with ``predict`` on the training set.
+
"""
def __init__(self, n_clusters=8, init='k-means++', n_init=10,
