code: def optimize_svc(data, targets):
      """Apply Bayesian Optimization to SVC parameters."""
  
      def svc_crossval(expC, expGamma):
          """Wrapper of SVC cross validation.
  
          Notice how we transform between regular and log scale. While this
          is not technically necessary, it greatly improves the performance
          of the optimizer.
          """
          C = 10**expC
          gamma = 10**expGamma
          return svc_cv(C=C, gamma=gamma, data=data, targets=targets)
  
      optimizer = BayesianOptimization(
          f=svc_crossval,
          pbounds={"expC": (-3, 2), "expGamma": (-4, -1)},
          random_state=1234,
          verbose=2,
      )
      optimizer.maximize(n_iter=10)
  
      print("Final result:", optimizer.max)
  
file_path: BayesianOptimization/examples/sklearn_example.py
imports: from sklearn.datasets import make_classification
  from sklearn.model_selection import cross_val_score
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.svm import SVC
  from bayes_opt import BayesianOptimization
  from bayes_opt.util import Colours
label_desc: Use image node_id 4 for calling a global function with example usage: optimize_svc(data, targets) and returns: svc_cv