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 switch to binary_crossentropy if a binary problem #14869

Merged
merged 4 commits into from Sep 20, 2019

Conversation

@adrinjalali
Copy link
Member

adrinjalali commented Sep 2, 2019

Fixes #14858.

Raise a warning and switch to binary_crossentropy if it's a binary classification problem and categorical_crossentropy is given.

@adrinjalali adrinjalali requested a review from NicolasHug Sep 2, 2019
@NicolasHug

This comment has been minimized.

Copy link
Contributor

NicolasHug commented Sep 2, 2019

Thanks for the PR.

If the user specifies categorical_crossentropy on a binary classif problem, I think we should either:

  1. raise an error
  2. still use categorical_crossentropy but raise a warning "you're building 2 trees instead of 1 so just use 'binary_crossentropy' or even better, use 'auto' ".

I'm in favor of just raising an error (because we have the 'auto' option that just works). But I'm OK with option 2 as well. The current proposal is re-implementing the 'auto' logic but with a warning so I don't think we want that.

Copy link
Contributor

NicolasHug left a comment

Thanks!

@adrinjalali

This comment has been minimized.

Copy link
Member Author

adrinjalali commented Sep 8, 2019

@ogrisel maybe you could have a look?

@adrinjalali

This comment has been minimized.

Copy link
Member Author

adrinjalali commented Sep 19, 2019

ping @ogrisel or @glemaitre should be an easy one :)

Copy link
Contributor

glemaitre left a comment

Apart of the comment raised by @thomasjpfan LGTM

@glemaitre

This comment has been minimized.

Copy link
Contributor

glemaitre commented Sep 20, 2019

I pushed the fix and will merge when it is green

@glemaitre glemaitre added this to TO BE MERGED in Guillaume's pet Sep 20, 2019
@glemaitre glemaitre merged commit 38af35d into scikit-learn:master Sep 20, 2019
19 checks passed
19 checks passed
LGTM analysis: C/C++ No code changes detected
Details
LGTM analysis: JavaScript No code changes detected
Details
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
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/patch 100% of diff hit (target 96.91%)
Details
codecov/project Absolute coverage decreased by -0.16% but relative coverage increased by +3.08% compared to 1018f9f
Details
scikit-learn.scikit-learn Build #20190920.6 succeeded
Details
scikit-learn.scikit-learn (Linux py35_conda_openblas) Linux py35_conda_openblas succeeded
Details
scikit-learn.scikit-learn (Linux py35_ubuntu_atlas) Linux py35_ubuntu_atlas succeeded
Details
scikit-learn.scikit-learn (Linux pylatest_conda_mkl) Linux pylatest_conda_mkl succeeded
Details
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas) Linux pylatest_pip_openblas_pandas succeeded
Details
scikit-learn.scikit-learn (Linux32 py35_ubuntu_atlas_32bit) Linux32 py35_ubuntu_atlas_32bit succeeded
Details
scikit-learn.scikit-learn (Windows py35_pip_openblas_32bit) Windows py35_pip_openblas_32bit succeeded
Details
scikit-learn.scikit-learn (Windows py37_conda_mkl) Windows py37_conda_mkl succeeded
Details
scikit-learn.scikit-learn (macOS pylatest_conda_mkl) macOS pylatest_conda_mkl succeeded
Details
@glemaitre glemaitre moved this from TO BE MERGED to MERGED in Guillaume's pet Sep 20, 2019
@adrinjalali adrinjalali deleted the adrinjalali:hgbt/crossentropy branch Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
4 participants
You can’t perform that action at this time.