code: def plot_labelled_numerical_stats(
      cls, labelled_stats, all_stats, label_column, feature_column
  ):
      display(Markdown("### %s" % feature_column))
      labelled_stats_table = []
      plt.figure(figsize=(16, 4))
      plt.subplot(131)
      legends = []
      plots = []
      for _class, _stats in labelled_stats.items():
          hist = _stats.histogram
          x = [i[0] for i in hist]
          w = [(i[1] - i[0]) for i in hist]
          h = [i[2] for i in hist]
          p = plt.bar(x=x, height=h, width=w, align="edge", alpha=0.4)
          legends.append(_class)
          plots.append(p)
          labelled_stats_table.append(
              {
                  "class": _class,
                  "min": _stats.min,
                  "max": _stats.max,
                  "mean": _stats.mean,
                  "median": _stats.sd,
                  "sd": _stats.max,
                  "total_count": _stats.total_count,
              }
          )
      plt.legend(plots, legends)
      plt.title(
          "Distribution: %s - %s" % (label_column, feature_column)
      )
      plt.xlabel(feature_column)
      plt.subplot(132)
  
      hist = all_stats.histogram
      x = [i[0] for i in hist]
      w = [(i[1] - i[0]) * 0.9 for i in hist]
      h = [i[2] for i in hist]
      x_ticks = ["%.2f-%.2f" % (i[0], i[1]) for i in hist]
      x_tick_locs = [(i[0] + i[1]) * 0.5 for i in hist]
      plt.bar(x=x, height=h, width=w, align="edge", alpha=0.8)
      plt.xticks(x_tick_locs, x_ticks, rotation=90)
      plt.title("All Distribution")
      plt.xlabel(feature_column)
      labelled_stats_table.append(
          {
              "class": "all",
              "min": all_stats.min,
              "max": all_stats.max,
              "mean": all_stats.mean,
              "median": all_stats.sd,
              "sd": all_stats.max,
              "total_count": all_stats.total_count,
          }
      )
      plt.subplot(133)
  
      legends = []
      plots = []
      for _class, _stats in labelled_stats.items():
          kde = np.array([[x, y] for (x, y) in _stats.kde])
          plt.plot(kde[:, 0], kde[:, 1])
          legends.append(_class)
          plots.append(p)
      plt.xlabel(feature_column)
  
      kde = np.array([[x, y] for (x, y) in all_stats.kde])
      plt.plot(kde[:, 0], kde[:, 1], "--")
      legends.append("all")
      plt.legend(legends)
      plt.title("KDE: %s - %s" % (label_column, feature_column))
  
      plt.show()
  
      _stats_df = pd.DataFrame.from_records(labelled_stats_table)
      display(_stats_df)
  
file_path: contextual-ai/xai/plots/data_stats_notebook_plots.py
imports: from collections import Counter
  import matplotlib.pyplot
  import pandas
  import numpy
  import seaborn
  from IPython.display import display, Markdown
label_desc: Use image node_id 4 for calling the NotebookPlots obj's underlying member method code with example usage: obj.plot_labelled_numerical_stats(cls, labelled_stats, all_stats, label_column, feature_column) without return types