code: def generate_confusion_matrix_plot(
      y_true: Union[np.array, list],
      y_pred: Union[np.array, list],
      colors_dict: Optional[dict] = None,
  ) -> plt.Figure:
      """
      Returns a matplotlib figure containing a confusion matrix that is computed using y_true and
      y_pred parameters.
  
      Parameters
      ----------
      y_true : array-like
          Ground truth (correct) target values.
      y_pred : array-like
          Estimated targets as returned by a classifier.
      colors_dict : dict
          dict of colors used
      Returns
      -------
      matplotlib.pyplot.Figure
      """
      colors_dict = colors_dict or get_palette("default")
      col_scale = get_pyplot_color(
          colors=colors_dict["report_confusion_matrix"]
      )
      cmap_gradient = LinearSegmentedColormap.from_list(
          "col_corr", col_scale, N=100
      )
  
      df_cm = pd.crosstab(
          y_true, y_pred, rownames=["Actual"], colnames=["Predicted"]
      )
      fig, ax = plt.subplots(figsize=(7, 4))
      sns.heatmap(df_cm, ax=ax, annot=True, cmap=cmap_gradient, fmt="g")
      return fig
  
file_path: shapash/shapash/report/plots.py
imports: from typing import Union, Optional
  import pandas
  import numpy
  import seaborn
  import matplotlib.pyplot
  from matplotlib.colors import LinearSegmentedColormap
  from shapash.utils.utils import truncate_str
  from shapash.report.common import VarType
  from shapash.style.style_utils import get_pyplot_color, get_palette
label_desc: Use image node_id 5 for calling a global function with example usage: generate_confusion_matrix_plot(y_true, y_pred, colors_dict) and returns: fig