コード例 #1
0
ファイル: gp_estimator.py プロジェクト: wuyou33/surf12adam
def plot_gp_pred(sigma, **fillargs):
#    pdb.set_trace()
    nugget = (sigma ** 2 / (0.1 + d.astype('float') ** 2))
    gp = GaussianProcess(corr='squared_exponential', nugget=nugget)
    gp.fit(np.atleast_2d(range(n)).T, np.atleast_2d(d).T)
    x = np.atleast_2d(np.linspace(0, n - 1)).T
    y_pred, MSE = gp.predict(x, eval_MSE=True)
    pylab.plot(x, y_pred)
    pylab.fill_between(x.T[0], y_pred + MSE, y_pred - MSE, **fillargs)
コード例 #2
0
    def _calculate(self):
        from sklearn.gaussian_process.gaussian_process import GaussianProcess

        X = self.xs.reshape((self.xs.shape[0], 1))
        y = self.ys
        yserr = self.yserr
        nugget = (yserr / y) ** 2
        gp = GaussianProcess(
#                             nugget=nugget
                             )

        gp.fit(X, y)
        return gp