code: def plot_grid_search(
      cv_results, grid_param_1, grid_param_2, name_param_1, name_param_2
  ):
      # plotting grid results from David Alvarez on Stack Overflow
  
      # Get Test Scores Mean and std for each grid search
      scores_mean = cv_results["mean_test_score"]
      scores_mean = np.array(scores_mean).reshape(
          len(grid_param_2), len(grid_param_1)
      )
      scores_sd = cv_results["std_test_score"]
      scores_sd = np.array(scores_sd).reshape(
          len(grid_param_2), len(grid_param_1)
      )
  
      # Plot Grid search scores
      _, ax = plt.subplots(1, 1)
  
      # Param1 is the X-axis, Param 2 is represented as a different curve (color line)
      for idx, val in enumerate(grid_param_2):
          ax.plot(
              grid_param_1,
              scores_mean[idx, :],
              "-o",
              label=name_param_2 + ": " + str(val),
          )
  
      ax.set_title("Grid Search Scores", fontsize=20, fontweight="bold")
      ax.set_xlabel(name_param_1, fontsize=16)
      ax.set_ylabel("CV Average Score", fontsize=16)
      ax.legend(loc="best", fontsize=15)
      ax.grid(True)
  
imports: import matplotlib.pyplot
  import numpy
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.model_selection import GridSearchCV, GroupKFold
  from sklearn.preprocessing import StandardScaler
  import seglearn
label_desc: Use image node_id 1 for calling a global function with example usage: plot_grid_search(cv_results, grid_param_1, grid_param_2, name_param_1, name_param_2) without return types