class_docstr: Calculate the confusion matrix of the model on the given dataset.
  
  For object detection, each detected bounding box calculates the IoU for each label and then that label class is
  used for the confusion matrix. detected bounding boxes that don't match a label has their own class and same
  for labels without detected bounding boxes.
  
  Parameters
  ----------
  categories_to_display (int, default 10):
      Maximum number of categories to display
  confidence_threshold (float, default 0.3):
      Threshold to consider bounding box as detected.
  iou_threshold (float, default 0.5):
      Threshold to consider detected bounding box as labeled bounding box.
  normalized (bool, default True):
      boolean that determines whether to normalize the true values of the matrix.
  {additional_check_init_params:2*indent}
class_docstr_tok: ["Calculate","the","confusion","matrix","of","the","model","on","the","given","dataset",".","For","object","detection",",","each","detected","bounding","box","calculates","the","IoU","for","each","label","and","then","that","label","class","is","used","for","the","confusion","matrix",".","detected","bounding","boxes","that","do","n't","match","a","label","has","their","own","class","and","same","for","labels","without","detected","bounding","boxes",".","Parameters","--","--","--","--","--","categories_to_display","(","int",",","default","10",")",":","Maximum","number","of","categories","to","display","confidence_threshold","(","float",",","default","0.3",")",":","Threshold","to","consider","bounding","box","as","detected",".","iou_threshold","(","float",",","default","0.5",")",":","Threshold","to","consider","detected","bounding","box","as","labeled","bounding","box",".","normalized","(","bool",",","default","True",")",":","boolean","that","determines","whether","to","normalize","the","true","values","of","the","matrix",".","{","additional_check_init_params:2","*","indent","}"]
docstr: Initialize run by creating an empty matrix the size of the data.
docstr_tok: ["Initialize","run","by","creating","an","empty","matrix","the","size","of","the","data","."]
code: def initialize_run(
      self, context: Context, dataset_kind: DatasetKind = None
  ):
      """Initialize run by creating an empty matrix the size of the data."""
      context.assert_task_type(
          TaskType.CLASSIFICATION, TaskType.OBJECT_DETECTION
      )
      self.matrix = defaultdict(lambda: defaultdict(int))
  
imports: import typing
  from collections import defaultdict
  from queue import PriorityQueue
  import numpy
  import pandas
  from deepchecks.core import CheckResult, DatasetKind
  from deepchecks.utils.abstracts.confusion_matrix_abstract import create_confusion_matrix_figure
  from deepchecks.vision._shared_docs import docstrings
  from deepchecks.vision.base_checks import SingleDatasetCheck
  from deepchecks.vision.context import Context
  from deepchecks.vision.metrics_utils.iou_utils import jaccard_iou
  from deepchecks.vision.vision_data import TaskType
  from deepchecks.vision.vision_data.batch_wrapper import BatchWrapper
label_desc: Use image node_id 2 for calling the ConfusionMatrixReport obj's underlying member method code with example usage: obj.initialize_run(context, dataset_kind) without return types