Browse files

FIX clone base_clf before setting params.

  • Loading branch information...
1 parent 0295809 commit db57c3939639b28c7809d9626fe058f8806993fe @amueller amueller committed Apr 13, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 sklearn/grid_search.py
View
2 sklearn/grid_search.py
@@ -438,7 +438,7 @@ def fit(self, X, y=None, **params):
if self.refit:
# fit the best estimator using the entire dataset
# clone first to work around broken estimators
- best_estimator = base_clf.set_params(**best_params)
+ best_estimator = clone(base_clf).set_params(**best_params)
best_estimator.fit(X, y, **self.fit_params)
self._best_estimator_ = best_estimator
self._set_methods()

0 comments on commit db57c39

Please sign in to comment.