code: def benchmark_influence(conf):
      """
      Benchmark influence of `changing_param` on both MSE and latency.
      """
      prediction_times = []
      prediction_powers = []
      complexities = []
      for param_value in conf["changing_param_values"]:
          conf["tuned_params"][conf["changing_param"]] = param_value
          estimator = conf["estimator"](**conf["tuned_params"])
  
          print("Benchmarking %s" % estimator)
          estimator.fit(
              conf["data"]["X_train"], conf["data"]["y_train"]
          )
          conf["postfit_hook"](estimator)
          complexity = conf["complexity_computer"](estimator)
          complexities.append(complexity)
          start_time = time.time()
          for _ in range(conf["n_samples"]):
              y_pred = estimator.predict(conf["data"]["X_test"])
          elapsed_time = (time.time() - start_time) / float(
              conf["n_samples"]
          )
          prediction_times.append(elapsed_time)
          pred_score = conf["prediction_performance_computer"](
              conf["data"]["y_test"], y_pred
          )
          prediction_powers.append(pred_score)
          print(
              "Complexity: %d | %s: %.4f | Pred. Time: %fs\n"
              % (
                  complexity,
                  conf["prediction_performance_label"],
                  pred_score,
                  elapsed_time,
              )
          )
      return prediction_powers, prediction_times, complexities
  
file_path: scikit-learn/examples/applications/plot_model_complexity_influence.py
imports: import time
  import matplotlib.pyplot
  import numpy
  from sklearn import datasets
  from sklearn.ensemble import GradientBoostingRegressor
  from sklearn.linear_model import SGDClassifier
  from sklearn.metrics import hamming_loss, mean_squared_error
  from sklearn.model_selection import train_test_split
  from sklearn.svm import NuSVR
label_desc: Use image node_id 2 for calling a global function with example usage: benchmark_influence(conf) and returns: prediction_powers,  prediction_times,  complexities