class_docstr: Multilabel confusion matrix class.
  
  >>> mlcm = MultiLabelCM([{'dog'}, {'cat', 'dog'}], [{'cat'}, {'cat'}])
  >>> mlcm.actual_vector_multihot
  [[0, 1], [1, 1]]
  >>> mlcm.predict_vector_multihot
  [[1, 0], [1, 0]]
docstr: Return confusion matrices based on samples.
  
  :param index: sample index for confusion matrix
  :type index: int
  :return: confusion matrix corresponding to the given sample number
docstr_tok: ["Return","confusion","matrices","based","on","samples",".",":","param","index",":","sample","index","for","confusion","matrix",":","type","index",":","int",":","return",":","confusion","matrix","corresponding","to","the","given","sample","number"]
code: def get_cm_by_sample(self, index):
      """
      Return confusion matrices based on samples.
  
      :param index: sample index for confusion matrix
      :type index: int
      :return: confusion matrix corresponding to the given sample number
      """
      if index < 0 or index >= len(self.actual_vector):
          raise pycmMultiLabelError(VECTOR_INDEX_ERROR)
      if index not in self.samplewise_cms:
          cm = ConfusionMatrix(
              self.actual_vector_multihot[index],
              self.predict_vector_multihot[index],
              sample_weight=self.weights,
          )
          self.samplewise_cms[index] = cm
          return cm
      return self.samplewise_cms[index]
  
file_path: pycm/pycm/pycm_multilabel_cm.py
imports: from __future__ import division
  from .pycm_error import pycmVectorError, pycmMultiLabelError
  from .pycm_param import *
  from .pycm_obj import ConfusionMatrix
  import numpy
label_desc: Use image node_id 3 for calling the MultiLabelCM obj's underlying member method code with example usage: obj.get_cm_by_sample(index) and returns: self, cm