[MRG] BUG: check equality instead of identity in check_cv#12155
[MRG] BUG: check equality instead of identity in check_cv#12155qinhanmin2014 merged 3 commits intoscikit-learn:masterfrom
Conversation
|
I did not put any entry in what's new since that we introduce it in 0.20 and that we should add it inside the upcoming release. Need to be back-ported to #11948 |
qinhanmin2014
left a comment
There was a problem hiding this comment.
LGTM, thanks for the PR and sorry for the bug.
|
If this is included in 0.20.1, maybe we need an entry. But I prefer to hurry it into 0.20 since it seems to be serious. |
rth
left a comment
There was a problem hiding this comment.
Thanks for catching this!
There are a few other similar cases there that might need to be fixed,
$ rg "\w+ is '"
model_selection/_split.py
425: if n_splits is 'warn':
496: if n_splits is 'warn':
597: if n_splits is 'warn':
751: if n_splits is 'warn':
1942: if cv is None or cv is 'warn':
| # the parameters leading to a failure in check_cv due to cv is 'warn' | ||
| # instead of cv == 'warn'. | ||
| X, y = load_iris(return_X_y=True) | ||
| clf = SVC(gamma='auto') |
There was a problem hiding this comment.
Can we just use a LogisticRegresion? (Trying to gain ms on the test suite run, also just makes sense to use the simplest estimator there is since it's not relevant)
| X, y = load_iris(return_X_y=True) | ||
| clf = SVC(gamma='auto') | ||
| grid = GridSearchCV(clf, param_grid={'C': [1, 10]}) | ||
| cross_validate(grid, X, y, n_jobs=-1) |
Don't worry I think that this one of the side of sprinting :) |
|
+1 on including this in 0.20.0 (so re-doing the tag) |
|
More generally, maybe we should avoid comparing strings with |
Haven't seen other occurrences, but I may have missed something (e.g. when |
|
We cannot tests |
|
+1 for fixing it even without tests.. |
|
I'm fine with changing |
qinhanmin2014
left a comment
There was a problem hiding this comment.
LGTM. Let's merge when green.
|
I am ok with redoing the tag as well to include this as long as nothing has been pushed to pypi yet. |
* tag '0.20.0': (77 commits) ColumnTransformer generalization to work on empty lists (scikit-learn#12084) add sparse_threshold to make_columns_transformer (scikit-learn#12152) [MRG] Convert ColumnTransformer input list to numpy array (scikit-learn#12104) Change version to 0.20.0 BUG: check equality instead of identity in check_cv (scikit-learn#12155) [MRG] Fix FutureWarnings in logistic regression examples (scikit-learn#12114) [MRG] Update test_metaestimators to pass y parameter when calling score (scikit-learn#12089) DOC Removed duplicated doc in tree.rst (scikit-learn#11922) [MRG] DOC covariance doctest examples (scikit-learn#12124) typo and formatting fixes in 0.20 doc (scikit-learn#11963) DOC Replaced the deprecated early_stopping parameter with n_iter_no_change. (scikit-learn#12133) [MRG +1] ColumnTransformer: store evaluated function column specifier during fit (scikit-learn#12107) Fix typo (scikit-learn#12126) DOC Typo in OneHotEncoder DOC Update fit_transform docstring of OneHotEncoder (scikit-learn#12117) DOC Removing quotes from variant names. (scikit-learn#12113) DOC BaggingRegressor missing default value for oob_score in docstring (scikit-learn#12108) [MRG] MNT Re-enable PyPy CI (scikit-learn#12039) MNT Only checks warnings on latest depedendencies versions in CI (scikit-learn#12048) TST Ignore warnings in common test to avoid collection errors (scikit-learn#12093) ...
* releases: (77 commits) ColumnTransformer generalization to work on empty lists (scikit-learn#12084) add sparse_threshold to make_columns_transformer (scikit-learn#12152) [MRG] Convert ColumnTransformer input list to numpy array (scikit-learn#12104) Change version to 0.20.0 BUG: check equality instead of identity in check_cv (scikit-learn#12155) [MRG] Fix FutureWarnings in logistic regression examples (scikit-learn#12114) [MRG] Update test_metaestimators to pass y parameter when calling score (scikit-learn#12089) DOC Removed duplicated doc in tree.rst (scikit-learn#11922) [MRG] DOC covariance doctest examples (scikit-learn#12124) typo and formatting fixes in 0.20 doc (scikit-learn#11963) DOC Replaced the deprecated early_stopping parameter with n_iter_no_change. (scikit-learn#12133) [MRG +1] ColumnTransformer: store evaluated function column specifier during fit (scikit-learn#12107) Fix typo (scikit-learn#12126) DOC Typo in OneHotEncoder DOC Update fit_transform docstring of OneHotEncoder (scikit-learn#12117) DOC Removing quotes from variant names. (scikit-learn#12113) DOC BaggingRegressor missing default value for oob_score in docstring (scikit-learn#12108) [MRG] MNT Re-enable PyPy CI (scikit-learn#12039) MNT Only checks warnings on latest depedendencies versions in CI (scikit-learn#12048) TST Ignore warnings in common test to avoid collection errors (scikit-learn#12093) ...
* dfsg: (77 commits) ColumnTransformer generalization to work on empty lists (scikit-learn#12084) add sparse_threshold to make_columns_transformer (scikit-learn#12152) [MRG] Convert ColumnTransformer input list to numpy array (scikit-learn#12104) Change version to 0.20.0 BUG: check equality instead of identity in check_cv (scikit-learn#12155) [MRG] Fix FutureWarnings in logistic regression examples (scikit-learn#12114) [MRG] Update test_metaestimators to pass y parameter when calling score (scikit-learn#12089) DOC Removed duplicated doc in tree.rst (scikit-learn#11922) [MRG] DOC covariance doctest examples (scikit-learn#12124) typo and formatting fixes in 0.20 doc (scikit-learn#11963) DOC Replaced the deprecated early_stopping parameter with n_iter_no_change. (scikit-learn#12133) [MRG +1] ColumnTransformer: store evaluated function column specifier during fit (scikit-learn#12107) Fix typo (scikit-learn#12126) DOC Typo in OneHotEncoder DOC Update fit_transform docstring of OneHotEncoder (scikit-learn#12117) DOC Removing quotes from variant names. (scikit-learn#12113) DOC BaggingRegressor missing default value for oob_score in docstring (scikit-learn#12108) [MRG] MNT Re-enable PyPy CI (scikit-learn#12039) MNT Only checks warnings on latest depedendencies versions in CI (scikit-learn#12048) TST Ignore warnings in common test to avoid collection errors (scikit-learn#12093) ...
closes #12154
Check for equality instead of identity which does not hold when n_jobs=-1 due to some copy.