code: def test_searchcv_sklearn_compatibility():
      """
      Test whether the BayesSearchCV is compatible with base sklearn methods
      such as clone, set_params, get_params.
      """
  
      X, y = load_iris(return_X_y=True)
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, train_size=0.75, random_state=0
      )
  
      # used to try different model classes
      pipe = Pipeline([("model", SVC())])
  
      # single categorical value of 'model' parameter sets the model class
      lin_search = {
          "model": Categorical([LinearSVC()]),
          "model__C": Real(1e-6, 1e6, prior="log-uniform"),
      }
  
      dtc_search = {
          "model": Categorical([DecisionTreeClassifier()]),
          "model__max_depth": Integer(1, 32),
          "model__min_samples_split": Real(
              1e-3, 1.0, prior="log-uniform"
          ),
      }
  
      svc_search = {
          "model": Categorical([SVC()]),
          "model__C": Real(1e-6, 1e6, prior="log-uniform"),
          "model__gamma": Real(1e-6, 1e1, prior="log-uniform"),
          "model__degree": Integer(1, 8),
          "model__kernel": Categorical(["linear", "poly", "rbf"]),
      }
  
      opt = BayesSearchCV(pipe, [(lin_search, 1), svc_search], n_iter=2)
  
      opt_clone = clone(opt)
  
      params, params_clone = opt.get_params(), opt_clone.get_params()
      assert params.keys() == params_clone.keys()
  
      for param, param_clone in zip(
          params.items(), params_clone.items()
      ):
          assert param[0] == param_clone[0]
          assert isinstance(param[1], type(param_clone[1]))
  
      opt.set_params(search_spaces=[(dtc_search, 1)])
  
      opt.fit(X_train, y_train)
      opt_clone.fit(X_train, y_train)
  
      total_evaluations = len(opt.cv_results_["mean_test_score"])
      total_evaluations_clone = len(
          opt_clone.cv_results_["mean_test_score"]
      )
  
      # test if expected number of subspaces is explored
      assert total_evaluations == 1
      assert total_evaluations_clone == 1 + 2
  
imports: import pytest
  from sklearn.datasets import load_iris, make_classification
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.svm import SVC, LinearSVC
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.base import clone
  from sklearn.base import BaseEstimator
  from scipy.stats import rankdata
  import numpy
  from numpy.testing import assert_array_equal
  from skopt.space import Real, Categorical, Integer
  from skopt import BayesSearchCV
label_desc: Use image node_id 6 for calling a global function with example usage: test_searchcv_sklearn_compatibility() without return types