class_docstr: Jointly trains 2 surrogate decision trees.
  Refines diff (or sim) regions by sample generation.
code: def H(self, y, mode="entropy"):
      if isinstance(y, pd.Series):
          y = y.to_numpy()
  
      if y.shape[0] == 0:
          return 0.0
      classes = np.unique(y)
  
      p = (y == classes[:, None]).sum(axis=1)
      p = p / y.shape[0]
  
      """ entropy range = [0, 1]
               gini   range = [0, 1/2]
               0 --> pure
               1 --> impure
          """
      if mode == "entropy":
          eps = 1e-8
          return -(p * np.log2(p + eps)).sum()
      else:
          return (p * (1 - p)).sum()
  
imports: import numpy
  import pandas
  from aix360.algorithms.imd.rule import Rule
label_desc: Use image node_id 2 for calling the JointSurrogateTree obj's underlying member method code with example usage: obj.H(y, mode) and returns: int, unknown, unknown