code: def get_confusion_matrix(model, data, thread_count=-1):
      """
      Build confusion matrix.
  
      Parameters
      ----------
      model : catboost.CatBoost
          The trained model.
  
      data : catboost.Pool
          A set of samples to build confusion matrix with.
  
      thread_count : int (default=-1)
          Number of threads to work with.
          If -1, then the number of threads is set to the number of CPU cores.
  
      Returns
      -------
      confusion matrix : array, shape = [n_classes, n_classes]
      """
      if not isinstance(data, Pool):
          raise CatBoostError("data must be a catboost.Pool")
  
      return _get_confusion_matrix(model._object, data, thread_count)
  
imports: from .None import _catboost
  from .core import Pool, CatBoostError, ARRAY_TYPES, PATH_TYPES, fspath, _update_params_quantize_part, _process_synonyms
  from collections import defaultdict
  from contextlib import contextmanager
  import sys
  import numpy
  import warnings
label_desc: Use image node_id 8 for calling a global function with example usage: get_confusion_matrix(model, data, thread_count) and returns: _get_confusion_matrix