def predict(self, train_x):
k_trans = self.kernel(train_x, self._x)
y_mean = k_trans.dot(self._alpha_vector) // Line 4 (y_mean = f_star)
return y_mean
def kernel(X, Y=None):
if Y is None:
After Change
// Check if any of the variances is negative because of
// numerical issues. If yes: set the variance to 0.
y_var_negative = y_var < 0
if np.any(y_var_negative):
warnings.warn("Predicted variances smaller than 0. "
"Setting those variances to 0.")
y_var[y_var_negative] = 0.0