code: def plots_regression(target, predictions):
      figures = []
      try:
          MAX_SAMPLES = 5000
          fig = plt.figure(figsize=(10, 7))
          ax1 = fig.add_subplot(1, 1, 1)
          samples = target.shape[0]
          if samples > MAX_SAMPLES:
              samples = MAX_SAMPLES
          ax1.scatter(
              target[:samples],
              predictions[:samples],
              c="tab:blue",
              alpha=0.2,
          )
          plt.xlabel("True values")
          plt.ylabel("Predicted values")
          plt.title(
              f"Target values vs Predicted values (samples={samples})"
          )
          plt.tight_layout(pad=5.0)
          figures += [
              {
                  "title": "True vs Predicted",
                  "fname": "true_vs_predicted.png",
                  "figure": fig,
              }
          ]
  
          # residual plot
          fig = plt.figure(figsize=(10, 7))
          ax1 = fig.add_subplot(1, 1, 1)
          residuals = (
              target[:samples].values - predictions[:samples].values
          )
          ax1.scatter(
              predictions[:samples], residuals, c="tab:blue", alpha=0.2
          )
          plt.xlabel("Predicted values")
          plt.ylabel("Residuals")
          plt.title(
              f"Predicted values vs Residuals (samples={samples})"
          )
          plt.tight_layout(pad=5.0)
          bb = ax1.get_position()
  
          ax2 = fig.add_axes(
              (bb.x0 + bb.size[0], bb.y0, 0.05, bb.size[1])
          )
          ax2.set_xticklabels([])
          ax2.set_yticklabels([])
          ax2.hist(residuals, 50, orientation="horizontal", alpha=0.5)
          ax2.axis("off")
  
          figures += [
              {
                  "title": "Predicted vs Residuals",
                  "fname": "predicted_vs_residuals.png",
                  "figure": fig,
              }
          ]
          plt.close("all")
  
      except Exception as e:
          print(str(e))
      return figures
  
file_path: mljar-supervised/supervised/utils/additional_plots.py
imports: import os
  import numpy
  import pandas
  import scikitplot
  from matplotlib import pyplot
  from supervised.algorithms.registry import BINARY_CLASSIFICATION, MULTICLASS_CLASSIFICATION, REGRESSION
label_desc: Use image node_id 3 for calling the AdditionalPlots obj's underlying member method code with example usage: obj.plots_regression(target, predictions) and returns: figures