首先需要安装pyGPs包
test = np.arange(0, 2800, 1)
x = x_train # x_train,y_train为np.array()数组
y = y_train
model = pyGPs.GPR() # specify model (GP regression)
model.getPosterior(x, y) # fit default model (mean zero & rbf kernel) with data
model.optimize(x, y) # optimize hyperparamters (default optimizer: single run minimize)
yvals=model.predict(test) # predict test cases
print(yvals)
model.plot()