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 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
Copy link
Member

@NicolasHug 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
Member

@NicolasHug NicolasHug left a comment

Thanks!

@adrinjalali
Copy link
Member Author

@adrinjalali adrinjalali commented Sep 8, 2019

@ogrisel maybe you could have a look?

@adrinjalali
Copy link
Member Author

@adrinjalali adrinjalali commented Sep 19, 2019

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

Copy link
Contributor

@glemaitre glemaitre left a comment

Apart of the comment raised by @thomasjpfan LGTM

@glemaitre
Copy link
Contributor

@glemaitre 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
@glemaitre glemaitre moved this from TO BE MERGED to MERGED in Guillaume's pet Sep 20, 2019
@adrinjalali adrinjalali deleted the hgbt/crossentropy branch Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

4 participants