-
-
Notifications
You must be signed in to change notification settings - Fork 26k
CLN Improve doc/error consistency for GaussianProcessRegressor #19687
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
Conversation
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.
Thank you for the PR @chrisyeh96 !
Minor comment, otherwise LGTM
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
I made the suggested changes, but I noticed an additional problem. The function def sample_y(self, X, n_samples=1, random_state=0):
"""Draw samples from Gaussian process and evaluate at X.
Parameters
----------
X : array-like of shape (n_samples, n_features) or list of object
Query points where the GP is evaluated.
n_samples : int, default=1
The number of samples drawn from the Gaussian process
... The existing documentation uses Thoughts on how to best resolve this duplicity? @thomasjpfan |
What do you think of updating the docstring of X : array-like of shape (n_samples_X, n_features) or list of object |
@thomasjpfan: agreed I also made some other small fixes / clarifications as well. |
@thomasjpfan I undid the |
Bump. Will these changes be merged soon? @thomasjpfan |
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.
PRs with code changes need 2 reviews. I think if we revert the code changes, I would be okay with merging with only the documentation changes.
raise ValueError("alpha must be a scalar or an array " | ||
"with same number of entries as y. (%d != %d)" |
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 a code change. Given the title of the PR, I would revert.
@@ -315,8 +315,7 @@ def predict(self, X, return_std=False, return_cov=False): | |||
""" | |||
if return_std and return_cov: | |||
raise RuntimeError( | |||
"Not returning standard deviation of predictions when " | |||
"returning full covariance.") | |||
"At most one of return_std or return_cov can be requested.") |
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 a code change. Given the title of the PR, I would revert.
I'd rather not have to waste time creating a 2nd pull request for the code changes. Is there any way to get a 2nd reviewer on this? Thanks! |
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.
I'll merge because this PR changes to the error messages are small and are an improvement.
…t-learn#19687) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Improves the documentation for
GaussianProcessRegressor
.n_targets
instead of a combination ofn_targets
andn_output_dims
Regarding the last note though, it seems like scikit-learn hasn't standardized on the proper word to describe a multi-target / multi-output regression. Some models use "target," while others use "output." I chose to use
n_targets
here because it is used by most of the linear models, and no other page usedn_output_dims
. (Several others usen_outputs
.)