Improving the error message on the Gaussian Process Regression
See original GitHub issueI’m trying to do my first Gaussian Process Regression using scikit-learn.
Here’s my MWE:
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import Matern
kernel=Matern(nu=0.5)
model=lambda x: x*np.sin(x)
xdata=np.array([1,3,5,6,8])
ydata=model(xdata)
xfit=xdata[:,np.newaxis]
gp=GaussianProcessRegressor(kernel=kernel,alpha=0.5)
gp.fit(xfit,ydata)
When I run the above, I get
(...)\sklearn\gaussian_process\kernels.py:1623: RuntimeWarning: invalid value encountered in true_divide
K_gradient = K[..., np.newaxis] * D \
Why is that? If I change the nu in the kernel to 1.5, the error disappears… I though it could be due to an inversion in the covariance matrix when compution the gaussian process, but I’ve used an alpha=0.5.
Also, if I try to plot the graph, with the code as is, I get a really strange plot… I somehow need to use length_scale_bounds=(1e-1, 10.0) to create a more truthful graph.
This tells me that probably the length-scale parameter is trying to go to problematic regions of the parameter space…
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Gaussian Process Regression with Location Errors - arXiv
Abstract. In this paper, we investigate Gaussian process regression mod- els where inputs are subject to measurement error. In spatial statistics,.
Read more >Validation of error bars with Gaussian process regression
I think that the covariance that you're using is improper. When you set alpha = 0.2 * np.abs(y) , what you're doing is...
Read more >Evaluation of Gaussian process regression kernel functions ...
Gaussian process regression (GPR) is a popular data-driven method used to build a statistical complementary model to correct systematic prediction error and ...
Read more >Uniform Error Bounds for Gaussian Process Regression with ...
Based on this work an improved bound is derived in [9] in order to analyze the regret of an upper confidence bound algorithm...
Read more >Quick Start to Gaussian Process Regression | by Hilarie Sit
Gaussian process regression (GPR) is a nonparametric, Bayesian approach to regression that is making waves in the area of machine learning.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@cmarmo that warning is consistent with the hypothesis I put forward of the inversion of the covariance matrix being done for values that are problematic.
Thanks @AidarShakerimoff for the follow-up! And thanks @anoldmaninthesea for the report. Closing then as fixed in #19396.