(self, X_test, full_cov=False, **kwargs)
return mu, var
r"""
        Returns the predictive mean and variance of the objective function at
        the given test points.

        Parameters
        ----------
        X_test: np.ndarray (N, D)
            Input test points
        full_cov: bool
            If set to true than the whole covariance matrix between the test points is returned

        Returns
        ----------
        np.array(N,)
            predictive mean
        np.array(N,) or np.array(N, N) if full_cov == True
            predictive variance
r"""
        Returns the predictive mean and variance of the objective function at
        the given test points.
r Returns the predictive mean and variance of the objective function at the given test points .
def predict(self, X_test, full_cov=False, **kwargs):
        r"""
        Returns the predictive mean and variance of the objective function at
        the given test points.

        Parameters
        ----------
        X_test: np.ndarray (N, D)
            Input test points
        full_cov: bool
            If set to true than the whole covariance matrix between the test points is returned

        Returns
        ----------
        np.array(N,)
            predictive mean
        np.array(N,) or np.array(N, N) if full_cov == True
            predictive variance

        """

        if not self.is_trained:
            raise Exception('Model has to be trained first!')

        if self.normalize_input:
            X_test_norm, _, _ = normalization.zero_one_normalization(X_test, self.lower, self.upper)
        else:
            X_test_norm = X_test

        mu, var = self.gp.predict(self.y, X_test_norm)

        if self.normalize_output:
            mu = normalization.zero_mean_unit_var_unnormalization(mu, self.y_mean, self.y_std)
            var *= self.y_std ** 2
        if not full_cov:
            var = np.diag(var)

        # Clip negative variances and set them to the smallest
        # positive float value
        if var.shape[0] == 1:
            var = np.clip(var, np.finfo(var.dtype).eps, np.inf)
        else:
            var = np.clip(var, np.finfo(var.dtype).eps, np.inf)
            var[np.where((var < np.finfo(var.dtype).eps) & (var > -np.finfo(var.dtype).eps))] = 0

        return mu, var
def predict ( self , X_test , full_cov = False , * * kwargs ) : if not self . is_trained : raise Exception ( 'Model has to be trained first!' ) if self . normalize_input : X_test_norm , _ , _ = normalization . zero_one_normalization ( X_test , self . lower , self . upper ) else : X_test_norm = X_test mu , var = self . gp . predict ( self . y , X_test_norm ) if self . normalize_output : mu = normalization . zero_mean_unit_var_unnormalization ( mu , self . y_mean , self . y_std ) var *= self . y_std ** 2 if not full_cov : var = np . diag ( var ) # Clip negative variances and set them to the smallest # positive float value if var . shape [ 0 ] == 1 : var = np . clip ( var , np . finfo ( var . dtype ) . eps , np . inf ) else : var = np . clip ( var , np . finfo ( var . dtype ) . eps , np . inf ) var [ np . where ( ( var < np . finfo ( var . dtype ) . eps ) & ( var > - np . finfo ( var . dtype ) . eps ) ) ] = 0 return mu , var