mmgp.backends.scikit_learn ========================== .. py:module:: mmgp.backends.scikit_learn Classes ------- .. autoapisummary:: mmgp.backends.scikit_learn.Regressor Module Contents --------------- .. py:class:: Regressor(options: dict) Bases: :py:obj:`mmgp.regressor.RegressorBase` scikit-learn regressor :param algo: The regression algorithm to use. :type algo: str :param options: A dictionary of options specific to the chosen algorithm. Allowed fields are "kernel", "optim", "num_restarts", "max_iters" and "anisotropic". :type options: dict .. py:attribute:: algo :value: 'scikit-learn' .. py:attribute:: options .. py:method:: fit(X: numpy.ndarray, y: numpy.ndarray) -> Self Train the regression model on the provided data. :param X: The input features for training. :type X: np.ndarray :param y: The target values for training. :type y: np.ndarray .. py:method:: predict(X: numpy.ndarray, return_var: bool) -> numpy.ndarray Make predictions using the trained regression model. :param X: The input features for making predictions. Array of size 1 x self.input_dim :type X: np.ndarray :param return_var: True if prediction variance is computed :type return_var: bool :returns: Predicted target values (and variances). One array (two arrays) of size 1 x self.output_dim :rtype: np.ndarray .. py:method:: predict_Monte_Carlo_draw(X: numpy.ndarray) -> numpy.ndarray Generate Monte Carlo draws from the trained regression model. :param X: The input features for generating draws. Array of size 1 x self.input_dim :type X: np.ndarray :returns: Monte Carlo draw from the posterior of the regression model. Array of size 1 x self.output_dim :rtype: np.ndarray