code: def _get_confusion_matrix(Yhat, Y):
      if len(Yhat) != len(Y):
          raise NameError("Yhat has different length")
      TP = np.dot(np.array(Y), np.array(Yhat))
      FP = np.sum(Yhat) - TP
      TN = len(Y) - np.sum(Y) - FP
      FN = len(Yhat) - np.sum(Yhat) - TN
      return TP, FP, TN, FN
  
imports: import itertools
  import operator
  import os
  import warnings
  from os.path import join
  from bisect import bisect_left
  from collections import defaultdict
  from copy import deepcopy
  from itertools import combinations
  from random import sample
  import numpy
  import pandas
  from mlxtend.frequent_patterns import fpgrowth
  from numpy.random import random
  from pandas import read_csv
  from scipy.sparse import csc_matrix
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.utils.multiclass import check_classification_targets
  from sklearn.utils.validation import check_X_y, check_is_fitted
  from imodels.rule_set.rule_set import RuleSet
  from imodels.util.arguments import check_fit_arguments
label_desc: Use image node_id 5 for calling a global function with example usage: _get_confusion_matrix(Yhat, Y) and returns: TP,  FP,  TN,  FN