The Wayback Machine - https://web.archive.org/web/20210823163042/https://github.com/scikit-learn/scikit-learn/pull/18343
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX allow to output error_score if a scoring failure happen #18343

Merged
merged 36 commits into from Oct 9, 2020

Conversation

@glemaitre
Copy link
Contributor

@glemaitre glemaitre commented Sep 4, 2020

Supersedes and closes #17617
Fixes #17589

Move scoring within try/except to give an error score instead of failing.

dsandeep0138 and others added 28 commits Jun 17, 2020
- If a scorer fails during the model selection, set score to
  error_score similar to the fit failing scenario
- Modify scorer fail test cases to expect warning messages
  instead of a ValueError exception
- If a scorer fails during the model selection, set score to
  error_score similar to the fit failing scenario
- Modify scorer fail test cases to expect warning messages
  instead of a ValueError exception
- Tests are mofified to catch warnings instead of assert_warns
- UserWarning is thrown now when scoring fails, instead of reusing
  the FitFailedWarning which is misleading
Also handle the case, when MultiMetric scorer fails and throws
an exception.
@glemaitre glemaitre changed the title Stalled 17617 FIX allow to output error_score if a scoring failure happen Sep 4, 2020
Copy link
Member

@thomasjpfan thomasjpfan left a comment

This needs a whats new entry.

Otherwise LGTM.

sklearn/model_selection/tests/test_validation.py Outdated Show resolved Hide resolved
@glemaitre glemaitre added this to WAITING FOR REVIEW in Guillaume's pet Sep 7, 2020
@rth rth self-requested a review Sep 23, 2020
@ogrisel
ogrisel approved these changes Oct 8, 2020
Copy link
Member

@ogrisel ogrisel left a comment

Small API improvement suggestion but otherwise LGTM:

sklearn/model_selection/_validation.py Outdated Show resolved Hide resolved
sklearn/feature_selection/_rfe.py Outdated Show resolved Hide resolved
sklearn/model_selection/tests/test_validation.py Outdated Show resolved Hide resolved
@ogrisel ogrisel merged commit 7dcb1ac into scikit-learn:master Oct 9, 2020
21 checks passed
21 checks passed
@lgtm-com
LGTM analysis: C/C++ No code changes detected
Details
@lgtm-com
LGTM analysis: JavaScript No code changes detected
Details
@lgtm-com
LGTM analysis: Python No new or fixed alerts
Details
ci/circleci: deploy Your tests passed on CircleCI!
Details
ci/circleci: doc Your tests passed on CircleCI!
Details
@circleci-artifacts-redirector
ci/circleci: doc artifact Link to 0/doc/_changed.html
Details
ci/circleci: doc-min-dependencies Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
@codecov
codecov/patch 100.00% of diff hit (target 98.16%)
Details
@codecov
codecov/project 98.17% (+0.00%) compared to 5a73abc
Details
@azure-pipelines
scikit-learn.scikit-learn Build #20201008.58 succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linting) Linting succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_conda_openblas) Linux py36_conda_openblas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux py36_ubuntu_atlas) Linux py36_ubuntu_atlas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux32 py36_ubuntu_atlas_32bit) Linux32 py36_ubuntu_atlas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl) Linux_Runs pylatest_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py36_pip_openblas_32bit) Windows py36_pip_openblas_32bit succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_mkl) macOS pylatest_conda_mkl succeeded
Details
@azure-pipelines
scikit-learn.scikit-learn (macOS pylatest_conda_mkl_no_openmp) macOS pylatest_conda_mkl_no_openmp succeeded
Details
@ogrisel
Copy link
Member

@ogrisel ogrisel commented Oct 9, 2020

amrcode added a commit to amrcode/scikit-learn that referenced this pull request Oct 19, 2020
jayzed82 added a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
@glemaitre glemaitre moved this from WAITING FOR REVIEW to WAITING FOR CONSENSUS in Guillaume's pet Jun 30, 2021
@glemaitre glemaitre moved this from WAITING FOR CONSENSUS to TO BE MERGED in Guillaume's pet Jun 30, 2021
@glemaitre glemaitre moved this from TO BE MERGED to MERGED in Guillaume's pet Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment