Skip to content

Fix to check if len(y) > 1 when normalize option is enabled in GaussianProcess._gpr.fit #19474

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

Closed
wants to merge 1 commit into from

Conversation

th-yoon
Copy link

@th-yoon th-yoon commented Feb 17, 2021

Reference Issues/PRs

#19361
#18388

What does this implement/fix? Explain your changes.

Normalizing y when len(y) <= 1 does not make sense, as self._y_train_std = np.std(y, axis=0) will become 0, which would lead to divide-by-zero.

Any other comments?

@NicolasHug
Copy link
Member

Thanks for the PR @th-yoon , looking at the other PRs it seems that the more general issue is when std(y) == 0 which can happen not just when len(y) == 1 but also when y is constant (which can happen in cross-validation settings), so I fear that the proposed fix might be too specific

@cmarmo cmarmo added the Superseded PR has been replace by a newer PR label Mar 25, 2021
@thomasjpfan
Copy link
Member

thomasjpfan commented Apr 8, 2021

Closing because #19703 has tests and recent reviews to resolve the issue.

@thomasjpfan thomasjpfan closed this Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:gaussian_process Superseded PR has been replace by a newer PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants