code: def svr_tuned_predictions(x_train, y_train, x_test, y_test):
      @optunity.cross_validated(
          x=x_train, y=y_train, num_iter=2, num_folds=5
      )
      def tune_cv(x_train, y_train, x_test, y_test, C, gamma):
          model = sklearn.svm.SVR(C=C, gamma=gamma).fit(
              x_train, y_train
          )
          predictions = model.predict(x_test)
          return optunity.metrics.mse(y_test, predictions)
  
      optimal_pars, _, _ = optunity.minimize(
          tune_cv, 200, C=[0, 20], gamma=[0, 10], pmap=optunity.pmap
      )
      tuned_model = sklearn.svm.SVR(**optimal_pars).fit(
          x_train, y_train
      )
      return tuned_model.predict(x_test).tolist()
  
file_path: optunity/bin/examples/python/sklearn/svr.py
imports: import math
  import itertools
  import optunity
  import optunity.metrics
  import sklearn.svm
  import matplotlib.pylab
  import time
  from sklearn.datasets import load_diabetes
label_desc: Use image node_id 4 for calling a global function with example usage: svr_tuned_predictions(x_train, y_train, x_test, y_test) and returns: tuned_model, optunity