def fitting_gaussian_process(self, x_train, y_train): """ Given the training samples, fitting a gaussian process model :param x_train: training x :param y_train: training y :return: the learned gaussian model """ kernel = C(1.0, (1e-3, 1e3)) * Matern(length_scale=np.ones( (feature_map().shape[0], )), length_scale_bounds=(0.01, 10.0e20), nu=1.5) gpr = GaussianProcessRegressor(kernel=kernel, n_restarts_optimizer=10) gpr.fit(x_train, y_train) gpr.optimizer = None return gpr