code: def _intersection_mat(result_mat, first_idx, second_idx, n_clusters):
      """Calculate the number of overlappings of second_idx based on first_idx.
      alignment_mat[i,j] represents the number of labels == j in second_idx
      when labels == i in the first idx.
  
      In other words, we should do the alignment based on the max by first
      assigning the most
  
      Parameters
      ----------
      result_mat
      first_idx
      second_idx
      n_clusters
  
      Returns
      -------
  
      """
      alignment_mat = np.zeros([n_clusters, n_clusters])
      for i in range(n_clusters):
          for j in range(n_clusters):
              i_index = np.argwhere(result_mat[:, first_idx] == i)
              j_index = np.argwhere(result_mat[:, second_idx] == j)
              inter_ij = np.intersect1d(i_index, j_index)
              alignment_mat[i, j] = len(inter_ij)
  
      return alignment_mat
  
file_path: combo/combo/models/cluster_comb.py
imports: import numpy
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from numpy.testing import assert_equal
  from pyod.utils.utility import check_parameter
  from .base import BaseAggregator
  from .score_comb import majority_vote
label_desc: Use image node_id 2 for calling a global function with example usage: _intersection_mat(result_mat, first_idx, second_idx, n_clusters) and returns: alignment_mat