Skip to content

Change the default of *SearchCV's error_score to np.nan #10309

Closed

Description

@jnothman

It can be pretty unpleasant when your grid search fails. That's why the error_score parameter was introduced. The default error_score='raise' helps make absolutely clear that there was a failure by terminating the program, but it might be kind to just set the score to NaN and raise a warning. We could consider deprecating it:

  • change the default temporarily to error_score='raise-deprecating'
  • continue to raise an error with 'raise-deprecating' but also warn that in the future, this error will not be raised, and the user can choose between error_score='raise' or the new default, error_score=np.nan.
  • change the default to error_score=np.nan in a couple of versions time

Other devs may want to give feedback on this idea before we go ahead with implementation/merge.

Activity

  1. added
    Easy
    good first issue
    on Dec 14, 2017
  2. amueller commented on Dec 14, 2017

    @amueller
    Member

    What happens for the refit? Do we just exclude the failed ones and warn about it?

  3. jnothman commented on Dec 15, 2017

    @jnothman
    MemberAuthor

    Well, I suppose we'd better be careful when sorting scores to watch out for NaNs (I doubt we check this case atm)... and to raise an error if the best_estimator_ has a NaN score. We could use -np.inf instead so that we get sorting for free.

  4. uwaisiqbal commented on Dec 17, 2017

    @uwaisiqbal

    I'd like to take this on if that's ok. I'm a new contributor and would like to get my first PR in 🙌

  5. jnothman commented on Dec 17, 2017

    @jnothman
    MemberAuthor
  6. mohdsanadzakirizvi commented on Dec 25, 2017

    @mohdsanadzakirizvi

    is this issue open to be worked on?

  7. jnothman commented on Dec 25, 2017

    @jnothman
    MemberAuthor

    Well @Oasis789 has not yet opened a PR

  8. GKjohns commented on Jan 22, 2018

    @GKjohns
    Contributor

    @Oasis789 any word on this? I can take it over if you're swamped with other stuff

  9. uwaisiqbal commented on Jan 22, 2018

    @uwaisiqbal

    I should be able to do it this weekend. Planned to work on it over Christmas but fell it.

  10. rotuna commented on Feb 2, 2018

    @rotuna

    Could I please try to work on this, if it's open to be worked on?

  11. jnothman commented on Feb 3, 2018

    @jnothman
    MemberAuthor

    @Oasis789, if you have not started work sufficiently, perhaps you should say so and let someone else take it...?

  12. uwaisiqbal commented on Feb 3, 2018

    @uwaisiqbal

    Currently working on this. Should have a PR open soon.

  13. uwaisiqbal commented on Feb 4, 2018

    @uwaisiqbal

    I've opened a PR for this issue #10583

    Please have a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Easygood first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions