dora/active_sampling/gp_sampler.py
def predict(self, Xq, real=True):
        """
        Predict the query mean and variance using the Gaussian process model.

            Infers the mean and variance of the Gaussian process at given
            locations using the data collected so far

        .. note :: [Properties Modified]
                    (None)

        Parameters
        ----------
        Xq : numpy.ndarray
            Query points
        real : bool, optional
            To use only the real observations or also the virtual observations

        Returns
        -------
        numpy.ndarray
            Expectance of the prediction at the given locations
        numpy.ndarray
            Variance of the prediction at the given locations
        """
        assert self.hyperparams, "Sampler is not trained yet. " \
                                 "Possibly not enough observations provided."

        # To use only the real data, extract the real data and compute the
        # regressors using only the real data
        if real:
            X_real, y_real = self.get_real_data()
            regressors = [gp.condition(X_real, y_real[:, i_task] -
                          self.y_mean[i_task],
                          self.kerneldef, self.hyperparams[i_task])
                          for i_task in range(self.n_tasks)]

        # Otherwise, just use the regressors we already have
        else:
            regressors = self.regressors

        # Compute using the standard predictor sequence
        predictors = [gp.query(r, Xq) for r in regressors]
        yq_exp = [gp.mean(p) for p in predictors]
        yq_var = [gp.variance(p) for p in predictors]

        return np.asarray(yq_exp).T + self.y_mean, np.asarray(yq_var).T

        Predict the query mean and variance using the Gaussian process model.

            Infers the mean and variance of the Gaussian process at given
            locations using the data collected so far

        .. note :: [Properties Modified]
                    (None)

        Parameters
        ----------
        Xq : numpy.ndarray
            Query points
        real : bool, optional
            To use only the real observations or also the virtual observations

        Returns
        -------
        numpy.ndarray
            Expectance of the prediction at the given locations
        numpy.ndarray
            Variance of the prediction at the given locations
        
Predict the query mean and variance using the Gaussian process model.
Infers the mean and variance of the Gaussian process at given
locations using the data collected so far

note :: [Properties Modified]
(None)

Parameters

Xq : numpy.ndarray
Query points
real : bool, optional
To use only the real observations or also the virtual observations

Returns

numpy.ndarray
Expectance of the prediction at the given locations
numpy.ndarray
Variance of the prediction at the given locations
Predict the query mean and variance using the Gaussian process model . Infers the mean and variance of the Gaussian process at given locations using the data collected so far note :: [ Properties Modified ] ( None ) Parameters Xq : numpy . ndarray Query points real : bool optional To use only the real observations or also the virtual observations Returns numpy . ndarray Expectance of the prediction at the given locations numpy . ndarray Variance of the prediction at the given locations
def predict(self, Xq, real=True):
        assert self.hyperparams, "Sampler is not trained yet. " \
                                 "Possibly not enough observations provided."
        if real:
            X_real, y_real = self.get_real_data()
            regressors = [gp.condition(X_real, y_real[:, i_task] -
                          self.y_mean[i_task],
                          self.kerneldef, self.hyperparams[i_task])
                          for i_task in range(self.n_tasks)]
        else:
            regressors = self.regressors
        predictors = [gp.query(r, Xq) for r in regressors]
        yq_exp = [gp.mean(p) for p in predictors]
        yq_var = [gp.variance(p) for p in predictors]
        return np.asarray(yq_exp).T + self.y_mean, np.asarray(yq_var).T
def predict ( self , Xq , real = True ) : assert self . hyperparams , "Sampler is not trained yet. " "Possibly not enough observations provided." if real : X_real , y_real = self . get_real_data ( ) regressors = [ gp . condition ( X_real , y_real [ : , i_task ] - self . y_mean [ i_task ] , self . kerneldef , self . hyperparams [ i_task ] ) for i_task in range ( self . n_tasks ) ] else : regressors = self . regressors predictors = [ gp . query ( r , Xq ) for r in regressors ] yq_exp = [ gp . mean ( p ) for p in predictors ] yq_var = [ gp . variance ( p ) for p in predictors ] return np . asarray ( yq_exp ) . T + self . y_mean , np . asarray ( yq_var ) . T
Predict the query mean and variance using the Gaussian process model.
Predict the query mean and variance using the Gaussian process model .
"""
        Predict the query mean and variance using the Gaussian process model.

            Infers the mean and variance of the Gaussian process at given
            locations using the data collected so far

        .. note :: [Properties Modified]
                    (None)

        Parameters
        ----------
        Xq : numpy.ndarray
            Query points
        real : bool, optional
            To use only the real observations or also the virtual observations

        Returns
        -------
        numpy.ndarray
            Expectance of the prediction at the given locations
        numpy.ndarray
            Variance of the prediction at the given locations
        """ # To use only the real data, extract the real data and compute the # regressors using only the real data # Otherwise, just use the regressors we already have # Compute using the standard predictor sequence
self
Xq
real