code: def test_results_opt_best_output_bayesian_search_skopt_with_output_gp_minimize_skopt():  # pragma: no cover
      """
      Test results_opt_best output of _bayesian_search_skopt with output gp_minimize() skopt.
      """
      forecaster = ForecasterAutoreg(
          regressor=Ridge(random_state=123), lags=2
      )
  
      steps = 3
      n_validation = 12
      y_train = y[:-n_validation]
      metric = "mean_absolute_error"
      initial_train_size = len(y_train)
      fixed_train_size = True
      refit = True
      verbose = False
  
      search_space = [Real(0.01, 1.0, "log-uniform", name="alpha")]
      n_trials = 10
      random_state = 123
  
      @use_named_args(search_space)
      def objective(
          forecaster=forecaster,
          y=y,
          steps=steps,
          metric=metric,
          initial_train_size=initial_train_size,
          fixed_train_size=fixed_train_size,
          refit=refit,
          verbose=verbose,
          **params,
      ) -> float:
          forecaster.set_params(**params)
  
          metric, _ = backtesting_forecaster(
              forecaster=forecaster,
              y=y,
              steps=steps,
              metric=metric,
              initial_train_size=initial_train_size,
              fixed_train_size=fixed_train_size,
              refit=refit,
              verbose=verbose,
          )
  
          return abs(metric)
  
      results_opt = gp_minimize(
          func=objective,
          dimensions=search_space,
          n_calls=n_trials,
          random_state=random_state,
      )
  
      lags_grid = [4, 2]
      search_space = {
          "alpha": Real(0.01, 1.0, "log-uniform", name="alpha")
      }
      return_best = False
  
      results_opt_best = _bayesian_search_skopt(
          forecaster=forecaster,
          y=y,
          lags_grid=lags_grid,
          search_space=search_space,
          steps=steps,
          metric=metric,
          refit=refit,
          initial_train_size=initial_train_size,
          fixed_train_size=fixed_train_size,
          n_trials=n_trials,
          random_state=random_state,
          return_best=return_best,
          verbose=verbose,
          kwargs_gp_minimize={},
      )[1]
  
      assert results_opt.x == results_opt_best.x
      assert results_opt.fun == results_opt_best.fun
  
imports: import re
  import pytest
  import numpy
  import pandas
  import sys
  from pytest import approx
  from importlib import metadata
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import Ridge
  from sklearn.metrics import mean_absolute_error
  from skforecast.ForecasterAutoreg import ForecasterAutoreg
  from skforecast.ForecasterAutoregCustom import ForecasterAutoregCustom
  from skforecast.model_selection import backtesting_forecaster
  from .fixtures_model_selection import y
  from tqdm import tqdm
  from functools import partialmethod
label_desc: Use image node_id 8 for calling a global function with example usage: test_results_opt_best_output_bayesian_search_skopt_with_output_gp_minimize_skopt() and returns: abs