class_docstr: Confusion matrix class.
  
  >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2]
  >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2]
  >>> cm = ConfusionMatrix(y_actu, y_pred)
  >>> cm.classes
  [0, 1, 2]
  >>> cm.table
  {0: {0: 3, 1: 0, 2: 0}, 1: {0: 0, 1: 1, 2: 2}, 2: {0: 2, 1: 1, 2: 3}}
  >>> cm2 = ConfusionMatrix(matrix={"Class1": {"Class1": 1, "Class2": 2}, "Class2": {"Class1": 0, "Class2": 5}})
  >>> cm2
  pycm.ConfusionMatrix(classes: ['Class1', 'Class2'])
class_docstr_tok: ["Confusion","matrix","class",".",">",">",">","y_actu","=","[","2",",","0",",","2",",","2",",","0",",","1",",","1",",","2",",","2",",","0",",","1",",","2","]",">",">",">","y_pred","=","[","0",",","0",",","2",",","1",",","0",",","2",",","1",",","0",",","2",",","0",",","2",",","2","]",">",">",">","cm","=","ConfusionMatrix","(","y_actu",",","y_pred",")",">",">",">","cm.classes","[","0",",","1",",","2","]",">",">",">","cm.table","{","0",":","{","0",":","3",",","1",":","0",",","2",":","0","}",",","1",":","{","0",":","0",",","1",":","1",",","2",":","2","}",",","2",":","{","0",":","2",",","1",":","1",",","2",":","3","}","}",">",">",">","cm2","=","ConfusionMatrix","(","matrix=","{","``","Class1","''",":","{","``","Class1","''",":","1",",","``","Class2","''",":","2","}",",","``","Class2","''",":","{","``","Class1","''",":","0",",","``","Class2","''",":","5","}","}",")",">",">",">","cm2","pycm.ConfusionMatrix","(","classes",":","[","'Class1","'",",","'Class2","'","]",")"]
docstr: Plot confusion matrix.
  
  :param normalized: normalized flag for matrix
  :type normalized: bool
  :param one_vs_all: one-vs-all mode flag
  :type one_vs_all: bool
  :param class_name: target class name for one-vs-all mode
  :type class_name: any valid type
  :param title: plot title
  :type title: str
  :param number_label: number label flag
  :type number_label: bool
  :param cmap: color map
  :type cmap: matplotlib.colors.ListedColormap
  :param plot_lib: plotting library
  :type plot_lib: str
  :return: plot axes
code: def plot(
      self,
      normalized=False,
      one_vs_all=False,
      class_name=None,
      title="Confusion Matrix",
      number_label=False,
      cmap=None,
      plot_lib="matplotlib",
  ):
      """
      Plot confusion matrix.
  
      :param normalized: normalized flag for matrix
      :type normalized: bool
      :param one_vs_all: one-vs-all mode flag
      :type one_vs_all: bool
      :param class_name: target class name for one-vs-all mode
      :type class_name: any valid type
      :param title: plot title
      :type title: str
      :param number_label: number label flag
      :type number_label: bool
      :param cmap: color map
      :type cmap: matplotlib.colors.ListedColormap
      :param plot_lib: plotting library
      :type plot_lib: str
      :return: plot axes
      """
      matrix = self.to_array(
          normalized=normalized,
          one_vs_all=one_vs_all,
          class_name=class_name,
      )
      classes = self.classes
      if normalized:
          title += " (Normalized)"
      if one_vs_all and class_name in classes:
          classes = [class_name, "~"]
      try:
          from matplotlib import pyplot as plt
      except (ModuleNotFoundError, ImportError):
          raise pycmPlotError(MATPLOTLIB_PLOT_LIBRARY_ERROR)
      if cmap is None:
          cmap = plt.cm.gray_r
      fig, ax = plt.subplots()
      fig.canvas.manager.set_window_title(title)
      if plot_lib == "seaborn":
          try:
              import seaborn as sns
          except (ModuleNotFoundError, ImportError):
              raise pycmPlotError(SEABORN_PLOT_LIBRARY_ERROR)
          ax = sns.heatmap(matrix, cmap=cmap)
          return axes_gen(
              ax, classes, matrix, title, cmap, number_label, plot_lib
          )
      plt.imshow(matrix, cmap=cmap)
      plt.colorbar()
      return axes_gen(
          ax, classes, matrix, title, cmap, number_label, plot_lib
      )
  
imports: from __future__ import division
  from .pycm_error import pycmVectorError, pycmMatrixError, pycmCIError, pycmAverageError, pycmPlotError
  from .pycm_handler import __class_stat_init__, __overall_stat_init__
  from .pycm_handler import __obj_assign_handler__, __obj_file_handler__, __obj_matrix_handler__, __obj_vector_handler__, __obj_array_handler__
  from .pycm_handler import __imbalancement_handler__
  from .pycm_class_func import F_calc, IBA_calc, TI_calc, NB_calc, sensitivity_index_calc
  from .pycm_overall_func import weighted_kappa_calc, weighted_alpha_calc, alpha2_calc, brier_score_calc, log_loss_calc
  from .pycm_distance import DistanceType, DISTANCE_MAPPER
  from .pycm_output import *
  from .pycm_util import *
  from .pycm_param import *
  from .pycm_ci import __CI_overall_handler__, __CI_class_handler__
  import os
  import json
  import numpy
  from warnings import warn
label_desc: Use image node_id 37 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.plot(normalized, one_vs_all, class_name, title, number_label, cmap, plot_lib) and returns: axes_gen, axes_gen