Elffuss BraidHub

kikocis/auto-code-rover public

main · 1.1 KiBRawPermalink
1diff --git a/sklearn/mixture/base.py b/sklearn/mixture/base.py
2--- a/sklearn/mixture/base.py
3+++ b/sklearn/mixture/base.py
4@@ -257,11 +257,6 @@ def fit_predict(self, X, y=None):
5 best_params = self._get_parameters()
6 best_n_iter = n_iter
7
8- # Always do a final e-step to guarantee that the labels returned by
9- # fit_predict(X) are always consistent with fit(X).predict(X)
10- # for any value of max_iter and tol (and any random_state).
11- _, log_resp = self._e_step(X)
12-
13 if not self.converged_:
14 warnings.warn('Initialization %d did not converge. '
15 'Try different init parameters, '
16@@ -273,6 +268,11 @@ def fit_predict(self, X, y=None):
17 self.n_iter_ = best_n_iter
18 self.lower_bound_ = max_lower_bound
19
20+ # Always do a final e-step to guarantee that the labels returned by
21+ # fit_predict(X) are always consistent with fit(X).predict(X)
22+ # for any value of max_iter and tol (and any random_state).
23+ _, log_resp = self._e_step(X)
24+
25 return log_resp.argmax(axis=1)
26
27 def _e_step(self, X):