def predict(self, X, **kwargs):
        r"""
        Returns the predictive mean and variance of the objective function at
        the specified test point.

        Parameters
        ----------
        X: np.ndarray (N, D)
            Input test points

        Returns
        ----------
        np.array(N,1)
            predictive mean
        np.array(N,1)
            predictive variance

        """
        # For EnvES we transform s to (1 - s)^2
        if self.basis_func is not None:
            X_test = deepcopy(X)
            X_test[:, self.dim] = self.basis_func(X_test[:, self.dim])
        else:
            X_test = X

        if self.model is None:
            logger.error("The model has to be trained first!")
            raise ValueError

        mu, var = self.model.predict(self.Y[:, 0], X_test)

        # Clip negative variances and set them to the smallest
        # positive float values
        if var.shape[0] == 1:
            var = np.clip(var, np.finfo(var.dtype).eps, np.inf)
        else:
            var[np.diag_indices(var.shape[0])] = np.clip(
                                            var[np.diag_indices(var.shape[0])],
                                            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[:, np.newaxis], var
dataset/ETHPy150Open automl/RoBO/robo/models/gaussian_process.py/GaussianProcess.predict/original