[MRG][HOTFIX] BUGFIX _store train_scores only if return_train_score is True#7535
[MRG][HOTFIX] BUGFIX _store train_scores only if return_train_score is True#7535NelleV merged 1 commit intoscikit-learn:masterfrom
Conversation
|
Why is it optional? Ie, what does storing train_score when we should be break? |
|
No we have an option |
|
(One example where it fails) >>> from sklearn.model_selection import GridSearchCV
>>> from sklearn.svm import LinearSVC
>>> from sklearn.datasets import make_classification
>>> X, y = make_classification()
>>> svm = LinearSVC()
>>> gs = GridSearchCV(svm, param_grid={'C': [0.1, 0.001]},
... return_train_score=False)
>>> gs.fit(X, y)
UnboundLocalError: local variable 'train_scores' referenced before assignment |
|
On why we even have that option, it was added so users who don't need it can turn it off to keep the |
|
gah so the false case wasn't tested? That's bad. re back-port: it's release, we need to do 0.18.1 for this fix. |
|
LGTM |
|
Hi @raghavrv |
|
Sorry for the reviewing fail :/ |
|
@NelleV Thanks for the feedback and merge. Yes I've been skimping on PR descriptions lately. Apologies... I'll try to make a clear description from the next PR. |
|
So are we gonna do a 0.18.1 relatively soon then? |
Extremely sorry for the sloppiness. This should be back ported into 0.18.
@amueller @jnothman Apologies :(