diff --git a/doc/whats_new/v1.0.rst b/doc/whats_new/v1.0.rst index a78cbe69b746d..8a2351b04ecc2 100644 --- a/doc/whats_new/v1.0.rst +++ b/doc/whats_new/v1.0.rst @@ -386,6 +386,10 @@ Changelog supporting sparse matrix and raise the appropriate error message. :pr:`19879` by :user:`Guillaume Lemaitre `. +- |Efficiency| Changed ``algorithm`` argument for :class:`cluster.KMeans` in + :class:`preprocessing.KBinsDiscretizer` from ``auto`` to ``full``. + :pr:`19934` by :user:`Gleb Levitskiy `. + :mod:`sklearn.tree` ................... diff --git a/sklearn/preprocessing/_discretization.py b/sklearn/preprocessing/_discretization.py index 22fa236f3314e..9ce95a97544a5 100644 --- a/sklearn/preprocessing/_discretization.py +++ b/sklearn/preprocessing/_discretization.py @@ -205,7 +205,8 @@ def fit(self, X, y=None): init = (uniform_edges[1:] + uniform_edges[:-1])[:, None] * 0.5 # 1D k-means procedure - km = KMeans(n_clusters=n_bins[jj], init=init, n_init=1) + km = KMeans(n_clusters=n_bins[jj], init=init, n_init=1, + algorithm='full') centers = km.fit(column[:, None]).cluster_centers_[:, 0] # Must sort, centers may be unsorted even with sorted init centers.sort()