(self, x1, X2)
return var
r"""
        Predicts the variance between a test points x1 and a set of points X2 by
           math: \sigma(X_1, X_2) = k_{X_1,X_2} - k_{X_1,X} * (K_{X,X}
                       + \sigma^2*\mathds{I})^-1 * k_{X,X_2})

        Parameters
        ----------
        x1: np.ndarray (1, D)
            First test point
        X2: np.ndarray (N, D)
            Set of test point
        Returns
        ----------
        np.array(N, 1)
            predictive variance between x1 and X2
r"""
        Predicts the variance between a test points x1 and a set of points X2 by
           math: \sigma(X_1, X_2) = k_{X_1,X_2} - k_{X_1,X} * (K_{X,X}
                       + \sigma^2*\mathds{I})^-1 * k_{X,X_2})
r Predicts the variance between a test points x1 and a set of points X2 by math : \ sigma ( X_1 X_2 ) = k_ { X_1 X_2 } - k_ { X_1 X } * ( K_ { X X } + \ sigma^2 * \ mathds { I } ) ^ - 1 * k_ { X X_2 } )
def predict_variance(self, x1, X2):
        r"""
        Predicts the variance between a test points x1 and a set of points X2 by
           math: \sigma(X_1, X_2) = k_{X_1,X_2} - k_{X_1,X} * (K_{X,X}
                       + \sigma^2*\mathds{I})^-1 * k_{X,X_2})

        Parameters
        ----------
        x1: np.ndarray (1, D)
            First test point
        X2: np.ndarray (N, D)
            Set of test point
        Returns
        ----------
        np.array(N, 1)
            predictive variance between x1 and X2

        """

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

        x_ = np.concatenate((x1, X2))
        _, var = self.predict(x_, full_cov=True)

        var = var[-1, :-1, np.newaxis]

        return var
def predict_variance ( self , x1 , X2 ) : if not self . is_trained : raise Exception ( 'Model has to be trained first!' ) x_ = np . concatenate ( ( x1 , X2 ) ) _ , var = self . predict ( x_ , full_cov = True ) var = var [ - 1 , : - 1 , np . newaxis ] return var