Open himkwtn opened 1 month ago
This is a good point, although fairly low impact, since I believe set_params()
is only used in gridsearch, which is not done much with SINDy, and we can cheat by doing the same validation in set_params()
that we do in __init__()
. That said, this is something we want, and the way to do this is:
__init__()
__init__
to pass, and then __init__
to fit()
Right now, parameters validation is done in the constructor as follows https://github.com/dynamicslab/pysindy/blob/3e8a4455fd4de046225344dda9b516d0d013ee36/pysindy/optimizers/sr3.py#L138-L163
According to the scikit-learn documents, validations should be done in the fit method because if we call set_params, it will bypass the validation in the constructor.
Reproducing code example: