code: def _create_model(self, X, Y):
          
  
          # --- define kernel
          self.input_dim = X.shape[1]
          if self.kernel is None:
              kern = GPy.kern.Matern52(self.input_dim, variance=1., ARD=self.ARD) #+ GPy.kern.Bias(self.input_dim)
          else:
              kern = self.kernel
              self.kernel = None
  
          # --- define model
          noise_var = Y.var()*0.01 if self.noise_var is None else self.noise_var
  
          if not self.sparse:
              self.model = GPy.models.GPRegression(X, Y, kernel=kern, noise_var=noise_var)
          else:
              self.model = GPy.models.SparseGPRegression(X, Y, kernel=kern, num_inducing=self.num_inducing)
  
          # --- restrict variance if exact evaluations of the objective
          if self.exact_feval:
              self.model.Gaussian_noise.constrain_fixed(1e-6, warning=False)
          else:
              # --- We make sure we do not get ridiculously small residual noise variance
              self.model.Gaussian_noise.constrain_bounded(1e-9, 1e6, warning=False)
docs: Creates the model given some input data X and Y.