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 add n_targets
allowing consistent shape prediction before calling fit
in GPR
#23099
base: main
Are you sure you want to change the base?
Conversation
Hi @glemaitre, could you help take a look at this PR, thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good. Could you add a what's new entry in 1.2.
Note that this is a bug fix rather than a feature.
n_targets
for GPRn_targets
allowing consistent shape prediction before calling fit
in GPR
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
:meth:`sample_y` before :meth:`fit`). This parameter is ignored once | ||
:meth:`fit` has been called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API-wise, ignoring n_targets
after fit
is strange to me.
@glemaitre Assuming n_targets
is set, what do you think of requiring the number of targets seen in fit
to be consistent with n_targets
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is less lenient and more conservative but I don't have any objection to that.
@MaxwellLZH Do you want to make this change of behaviour?
Reference Issues/PRs
This PR adds a new argument
n_targets
forGaussianProcessRegressor
as suggested in issue #22430 , which will be used to determine the output shape of bothpredict
andsample_y
, so the shape will be consistent before and after callingfit
method.Any other comments?
I'm not sure if we should raise error during the fit process if the dimension of
y
does not matchn_targets
, since once we fit the model the output shape will be determined by the shape of y.