Understanding score of 1 in scikit-learn Gaussian process regressor

£可爱£侵袭症+ 提交于 2021-01-29 10:15:18

问题


I'm new to Gaussian processes and struggling to validate the output of my scikit GPR.

I'm particularly concerned with the fact that my GPR returns a score of 1, which doesn't make any sense to me because the coefficient of determination of this data should not be equal to 1.

Is there a particular problem with the GRP or data that is implied by a score of 1? I've included my code, and my X,Y are each arrays of length 15.

I have additionally tried both the Matern and RBF kernels on their own with default parameters. I get slightly different predictions but still with a score of 1 both times.

gp = gaussian_process.GaussianProcessRegressor(
                     alpha=1e-10,                                 
                     copy_X_train=True,                             
                     kernel = Matern() + 1*RBF(1),                            
                     n_restarts_optimizer=10,                        
                     normalize_y=False,                             
                     random_state=None)

gp.fit(X, Y)
score = gp.score(X, Y)
print(score)
x_pred = np.atleast_2d(np.linspace(0,10,1000)).T
y_pred, sigma = gp.predict(x_pred, return_std=True)

Any advice is appreciated, thanks!

来源:https://stackoverflow.com/questions/61067867/understanding-score-of-1-in-scikit-learn-gaussian-process-regressor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!