Skip to content

Commit db57c39

Browse files
committed
FIX clone base_clf before setting params.
1 parent 0295809 commit db57c39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sklearn/grid_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def fit(self, X, y=None, **params):
438438
if self.refit:
439439
# fit the best estimator using the entire dataset
440440
# clone first to work around broken estimators
441-
best_estimator = base_clf.set_params(**best_params)
441+
best_estimator = clone(base_clf).set_params(**best_params)
442442
best_estimator.fit(X, y, **self.fit_params)
443443
self._best_estimator_ = best_estimator
444444
self._set_methods()

0 commit comments

Comments
 (0)