code: def gp_regression_learner(
      df: pd.DataFrame,
      features: List[str],
      target: str,
      kernel: kernels.Kernel = None,
      alpha: float = 0.1,
      extra_variance: Union[str, float] = "fit",
      return_std: bool = False,
      extra_params: Dict[str, Any] = None,
      prediction_column: str = "prediction",
      encode_extra_cols: bool = True,
  ) -> LearnerReturnType:
      """
      Fits an gaussian process regressor to the dataset.
  
      Parameters
      ----------
  
      df: pandas.DataFrame
          A Pandas' DataFrame with features and target columns.
          The model will be trained to predict the target column
          from the features.
  
      features: list of str
          A list os column names that are used as features for the model. All this names
          should be in `df`.
  
      target: str
          The name of the column in `df` that should be used as target for the model.
          This column should be numerical and continuous, since this is a regression model.
  
      kernel: sklearn.gaussian_process.kernels
          The kernel specifying the covariance function of the GP. If None is passed,
          the kernel "1.0 * RBF(1.0)" is used as default. Note that the kernel's hyperparameters
          are optimized during fitting.
  
      alpha: float
          Value added to the diagonal of the kernel matrix during fitting. Larger values correspond to increased
          noise level in the observations. This can also prevent a potential numerical issue during fitting,
          by ensuring that the calculated values form a positive definite matrix.
  
      extra_variance: float
          The amount of extra variance to scale to the predictions in standard deviations. If left as the default "fit",
          Uses the standard deviation of the target.
  
      return_std: bool
          If True, the standard-deviation of the predictive distribution at the query points is returned
          along with the mean.
  
      extra_params: dict {"hyperparameter_name" : hyperparameter_value}, optional
          Other parameters for the GaussianProcessRegressor model. See the list in:
          http://scikit-learn.org/stable/modules/generated/sklearn.gaussian_process.GaussianProcessRegressor.html
          If not passed, the default will be used.
  
      prediction_column : str
          The name of the column with the predictions from the model.
  
      encode_extra_cols : bool (default: True)
          If True, treats all columns in `df` with name pattern fklearn_feat__col==val` as feature columns.
      """
  
      params = extra_params if extra_params else {}
  
      params["alpha"] = alpha
      params["kernel"] = kernel
  
      features = (
          features
          if not encode_extra_cols
          else expand_features_encoded(df, features)
      )
  
      gp = GaussianProcessRegressor(**params)
      gp.fit(df[features], df[target])
  
      extra_variance = (
          df[target].std()
          if extra_variance == "fit"
          else extra_variance
          if extra_variance
          else 1
      )
  
      def p(new_df: pd.DataFrame) -> pd.DataFrame:
          if return_std:
              pred_mean, pred_std = gp.predict(
                  df[features], return_std=True
              )
              pred_std *= extra_variance
              return new_df.assign(
                  **{
                      prediction_column: pred_mean,
                      prediction_column + "_std": pred_std,
                  }
              )
          else:
              return new_df.assign(
                  **{prediction_column: gp.predict(df[features])}
              )
  
      p.__doc__ = learner_pred_fn_docstring("gp_regression_learner")
  
      log = {
          "gp_regression_learner": {
              "features": features,
              "target": target,
              "parameters": merge(
                  params,
                  {
                      "extra_variance": extra_variance,
                      "return_std": return_std,
                  },
              ),
              "prediction_column": prediction_column,
              "package": "sklearn",
              "package_version": sk_version,
              "training_samples": len(df),
          },
          "object": gp,
      }
  
      return p, p(df), log
  
file_path: fklearn/src/fklearn/training/regression.py
imports: from typing import Any, Dict, List, Union
  import numpy
  import pandas
  from toolz import merge, curry, assoc
  from sklearn.linear_model import LinearRegression, ElasticNet
  from sklearn.gaussian_process import GaussianProcessRegressor, kernels
  from sklearn import __version__
  from fklearn.common_docstrings import learner_pred_fn_docstring, learner_return_docstring
  from fklearn.types import LearnerReturnType
  from fklearn.training.utils import log_learner_time, expand_features_encoded
label_desc: Use image node_id 4 for calling a global function with example usage: gp_regression_learner(df, features, target, kernel, alpha, extra_variance, return_std, extra_params, prediction_column, encode_extra_cols) and returns: p,  p,  log, new_df, new_df