Skip to content

Warnings in common tests about set_params #12652

Open

Description

@amueller

There's a bunch of "ValueError occurred during set_params.", introduced in #7760. This doesn't look good imho because it probably means we're violating API somewhere. We should investigate.

Activity

  1. added this to the 0.21 milestone on Nov 22, 2018
  2. thomasjpfan commented on Nov 29, 2018

    @thomasjpfan
    Member

    It looks like BaseSGD does validation when set_params is called:

    def set_params(self, *args, **kwargs):
    super(BaseSGD, self).set_params(*args, **kwargs)
    self._validate_params(set_max_iter=False)
    return self

    For example, using set_params to set alpha=-np.inf in SGDClassifier will trigger a warning in test_check_estimator_clones.

  3. jnothman commented on Dec 2, 2018

    @jnothman
    Member
  4. amueller commented on Dec 28, 2018

    @amueller
    MemberAuthor

    So we should change the test? Or discontinue that practice? I would lean towards former but we tend to to the latter usually...

  5. thomasjpfan commented on Dec 29, 2018

    @thomasjpfan
    Member

    I was always under the impression that parameter validation should be done at the beginning of fit. This sounds like something that should be standardized, maybe in a SLEP?

  6. jnothman commented on Jan 1, 2019

    @jnothman
    Member

    Yes, this is something that has become tacitly standardised over time, but we have some legacy behaviour.

    It is hard to strictly maintain backwards compatibility while removing that legacy behaviour, but I'm okay to see what it looks like, or give up on strict compat.

  7. modified the milestones: 0.21, 0.22 on Apr 24, 2019
  8. jnothman commented on Oct 27, 2019

    @jnothman
    Member

    I think this is inconsistent, but fairly innocuous... do we want to fix it?

  9. thomasjpfan commented on Oct 28, 2019

    @thomasjpfan
    Member

    I would want to fix this to have a consistent API. The most conservative fix would be to issue a FutureWarning at first and then move the validation into fit.

    Personally, I would prefer moving the validation into fit and consider this a bug fix.

  10. modified the milestones: 0.22, 0.23 on Oct 31, 2019
  11. adrinjalali commented on Apr 16, 2020

    @adrinjalali
    Member

    take

  12. removed this from the 0.23 milestone on Apr 21, 2020
  13. adrinjalali commented on Apr 21, 2020

    @adrinjalali
    Member

    removed the milestone, PR is now WIP.

  14. added
    module:test-suite
    on Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

module:test-suite

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions