You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
IIRC we have several places where we still validate in `__init__` (as well
as `fit`), which is consistent with validating in `set_params` (or
`__setattr__`).
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?
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.
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.
Activity
thomasjpfan commentedon Nov 29, 2018
It looks like
BaseSGDdoes validation whenset_paramsis called:scikit-learn/sklearn/linear_model/stochastic_gradient.py
Lines 103 to 106 in dbd28e7
For example, using
set_paramsto setalpha=-np.infinSGDClassifierwill trigger a warning intest_check_estimator_clones.jnothman commentedon Dec 2, 2018
amueller commentedon Dec 28, 2018
So we should change the test? Or discontinue that practice? I would lean towards former but we tend to to the latter usually...
thomasjpfan commentedon Dec 29, 2018
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?jnothman commentedon Jan 1, 2019
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.
jnothman commentedon Oct 27, 2019
I think this is inconsistent, but fairly innocuous... do we want to fix it?
thomasjpfan commentedon Oct 28, 2019
I would want to fix this to have a consistent API. The most conservative fix would be to issue a
FutureWarningat first and then move the validation intofit.Personally, I would prefer moving the validation into
fitand consider this a bug fix.adrinjalali commentedon Apr 16, 2020
take
adrinjalali commentedon Apr 21, 2020
removed the milestone, PR is now WIP.