class_docstr: Grouped Conditional Expectation plots are generated for a given instance and set of features.
  They show how the model prediction is affected when a pair of features of a given instance are
  perturbed. The perturbed features can be either a provided subset of the input covariates, or
  the top K features based on the importance rank obtained by a global explainer (e.g., SHAP).
  If the user provides a single feature then the algorithm produces a standard ICE plot where the
  selected feature varies according to a linespace grid. If the user chooses more than one feature,
  then the explainer produces 3D ICE plots. Here, two features vary simultaneously according to a
  meshgrid, the output of the model is stored for each pair of values.
docstr: First recursive binary partition using feature values sampling
  of the high dimensional data.
docstr_tok: ["First","recursive","binary","partition","using","feature","values","sampling","of","the","high","dimensional","data","."]
code: def _partition_sample(
      self,
      x: np.ndarray,
      n: int,
      d: int = 0,
  ):
      """
      First recursive binary partition using feature values sampling
      of the high dimensional data.
      """
      if 2**d > n:
          i = np.random.choice(x.shape[0], 1)
          return x[i]
  
      x_min = np.min(x, axis=0)
      x_max = np.max(x, axis=0)
  
      dim = np.argmax(x_max - x_min)
      y = np.quantile(x[:, dim], q=0.5)
      x_lo = x[np.where(x[:, dim] <= y)[0]]
      x_hi = x[np.where(x[:, dim] > y)[0]]
  
      s1, s2 = None, None
      if x_lo.shape[0] > 1:
          s1 = self._partition_sample(x_lo, n, d=d + 1)
          if len(s1.shape) == 1:
              s1 = s1[np.newaxis, ...]
  
      if x_hi.shape[0] > 1:
          s2 = self._partition_sample(x_hi, n, d=d + 1)
          if len(s2.shape) == 1:
              s2 = s2[np.newaxis, ...]
  
      if (s1 is not None) and (s2 is not None):
          s = np.concatenate([s1, s2], axis=0)
      else:
          s = s1 if s1 is not None else s2
      return s[:n] if d == 0 else s
  
file_path: AIX360/aix360/algorithms/gce/gce.py
imports: import warnings
  from typing import List, Union, Callable
  import numpy
  import pandas
  import shap
  from aix360.algorithms.lbbe import LocalBBExplainer
label_desc: Use image node_id 4 for calling the GroupedCEExplainer obj's underlying member method code with example usage: obj._partition_sample(x, n, d) and returns: unknown, x