code: def plot_influence(conf, mse_values, prediction_times, complexities):
      """
      Plot influence of model complexity on both accuracy and latency.
      """
  
      fig = plt.figure()
      fig.subplots_adjust(right=0.75)
  
      # first axes (prediction error)
      ax1 = fig.add_subplot(111)
      line1 = ax1.plot(complexities, mse_values, c="tab:blue", ls="-")[
          0
      ]
      ax1.set_xlabel("Model Complexity (%s)" % conf["complexity_label"])
      y1_label = conf["prediction_performance_label"]
      ax1.set_ylabel(y1_label)
  
      ax1.spines["left"].set_color(line1.get_color())
      ax1.yaxis.label.set_color(line1.get_color())
      ax1.tick_params(axis="y", colors=line1.get_color())
  
      # second axes (latency)
      ax2 = fig.add_subplot(111, sharex=ax1, frameon=False)
      line2 = ax2.plot(
          complexities, prediction_times, c="tab:orange", ls="-"
      )[0]
      ax2.yaxis.tick_right()
      ax2.yaxis.set_label_position("right")
      y2_label = "Time (s)"
      ax2.set_ylabel(y2_label)
      ax1.spines["right"].set_color(line2.get_color())
      ax2.yaxis.label.set_color(line2.get_color())
      ax2.tick_params(axis="y", colors=line2.get_color())
  
      plt.legend(
          (line1, line2),
          ("prediction error", "prediction latency"),
          loc="upper center",
      )
  
      plt.title(
          "Influence of varying '%s' on %s"
          % (conf["changing_param"], conf["estimator"].__name__)
      )
  
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 4 for calling a global function with example usage: plot_influence(conf, mse_values, prediction_times, complexities) without return types