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: Save ConfusionMatrix object in .obj file.
  
  :param name: filename
  :type name: str
  :param address: flag for address return
  :type address: bool
  :param save_stat: save statistics flag
  :type save_stat: bool
  :param save_vector: save vectors flag
  :type save_vector: bool
  :return: saving address as dict {"Status":bool, "Message":str}
code: def save_obj(
      self, name, address=True, save_stat=False, save_vector=True
  ):
      """
      Save ConfusionMatrix object in .obj file.
  
      :param name: filename
      :type name: str
      :param address: flag for address return
      :type address: bool
      :param save_stat: save statistics flag
      :type save_stat: bool
      :param save_vector: save vectors flag
      :type save_vector: bool
      :return: saving address as dict {"Status":bool, "Message":str}
      """
      try:
          message = None
          obj_file = open(name + ".obj", "w")
          actual_vector_temp = self.actual_vector
          predict_vector_temp = self.predict_vector
          prob_vector_temp = self.prob_vector
          weights_vector_temp = self.weights
          matrix_temp = {k: self.table[k].copy() for k in self.classes}
          matrix_items = []
          for i in self.classes:
              matrix_items.append((i, list(matrix_temp[i].items())))
          (
              actual_vector_temp,
              predict_vector_temp,
              prob_vector_temp,
              weights_vector_temp,
          ) = map(
              vector_serializer,
              [
                  actual_vector_temp,
                  predict_vector_temp,
                  prob_vector_temp,
                  weights_vector_temp,
              ],
          )
          dump_dict = {
              "Actual-Vector": actual_vector_temp,
              "Predict-Vector": predict_vector_temp,
              "Prob-Vector": prob_vector_temp,
              "Matrix": matrix_items,
              "Digit": self.digit,
              "Sample-Weight": weights_vector_temp,
              "Transpose": self.transpose,
              "Imbalanced": self.imbalance,
          }
          if save_stat:
              dump_dict["Class-Stat"] = self.class_stat
              dump_dict["Overall-Stat"] = self.overall_stat
          if not save_vector:
              dump_dict["Actual-Vector"] = None
              dump_dict["Predict-Vector"] = None
              dump_dict["Prob-Vector"] = None
              dump_dict["Sample-Weight"] = None
          json.dump(dump_dict, obj_file)
          if address:
              message = os.path.join(
                  os.getcwd(), name + ".obj"
              )  # pragma: no cover
          return {"Status": True, "Message": message}
      except Exception as e:
          return {"Status": False, "Message": str(e)}
  
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 12 for calling the ConfusionMatrix obj's underlying member method code with example usage: obj.save_obj(name, address, save_stat, save_vector) and returns: dict, dict