code: def class_separation_plot(
      pred_df, n_bins=150, threshold=None, figsize=(10, 6), title=None
  ):
      """
      Plots the predicted class probabilities for multiple classes.
      Usefull for visualizing predicted interaction values such as 5 star ratings, where a "class" is a star rating,
      or visualizing predicted class probabilities for binary classification model or recommender system.
      The true class states are colored.
      ----------
      pred_df: pandas dataframe
          a dataframe containing a column of predicted interaction values or classification probabilites,
          and a column of true class 1 and class 0 states.
          This dataframe must contain columns named "predicted" and "truth"
          example:
                  predicted | truth
                  5.345345	|  5
                  2.072020	|  2
      n_bins: number of bins for histogram.
      threshold: float. default = 0.5
          A single number between 0 and 1 identifying the threshold to classify observations to class
          example: 0.5
      figsize: size of figure
      title: plot title
      Returns:
      -------
          A classification probability plot
      """
      recommender_palette = [
          "#ED2BFF",
          "#14E2C0",
          "#FF9F1C",
          "#5E2BFF",
          "#FC5FA3",
      ]
      classes = pred_df.truth.unique()
      plt.figure(figsize=figsize)
      for i in range(len(classes)):
          single_class = classes[i]
          sns.distplot(
              pred_df.query("truth == @single_class")["predicted"],
              bins=n_bins,
              color=recommender_palette[i],
              label="True {}".format(single_class),
          )
      plt.legend()
      if threshold == None:
          pass
      else:
          plt.axvline(threshold, color="black", linestyle="--")
      plt.xlabel("Predicted value")
      plt.ylabel("Frequency")
      if title == None:
          plt.title(" ")
      else:
          plt.title(title)
      plt.show()
  
imports: import matplotlib.pyplot
  import numpy
  import pandas
  import plotly.graph_objects
  import seaborn
  from funcsigs import signature
  from matplotlib.lines import Line2D
  from sklearn.metrics import auc, average_precision_score, precision_recall_curve, roc_curve
label_desc: Use image node_id 7 for calling a global function with example usage: class_separation_plot(pred_df, n_bins, threshold, figsize, title) without return types