docstr: Checks if the inputs to the explain method match the explainer setup if shap interaction values
  are to be explained.
  
  Parameters
  ----------
  approximate
      See `explain` documentation.
  background_data
      See `fit` documentation.
  y
      See `explain` documentation.
  
  Raises
  ------
  NotImplementedError
      If a background dataset is passed to the `fit` method or argument `y` is specified to the `explain`
      method. These algorithms are not yet supported in the `shap` library.
  
  Warns
  -----
  If approximate values are requested. These values are not defined for interactions.
code: def _check_interactions(
      self,
      approximate: bool,
      background_data: Union[np.ndarray, pd.DataFrame, None],
      y: Optional[np.ndarray],
  ) -> None:
      """
      Checks if the inputs to the explain method match the explainer setup if shap interaction values
      are to be explained.
  
      Parameters
      ----------
      approximate
          See `explain` documentation.
      background_data
          See `fit` documentation.
      y
          See `explain` documentation.
  
      Raises
      ------
      NotImplementedError
          If a background dataset is passed to the `fit` method or argument `y` is specified to the `explain`
          method. These algorithms are not yet supported in the `shap` library.
  
      Warns
      -----
      If approximate values are requested. These values are not defined for interactions.
      """
  
      self.approximate = approximate
      if approximate:
          logger.warning(
              "Approximate shap values are not defined for shap interaction values, "
              "ignoring argument!"
          )
          self.approximate = False
      if background_data is not None:
          raise NotImplementedError(
              "Interactions can currently only be computed if no background dataset is specified. "
              "Re-instantiate the explainer and run fit without any arguments to compute shap "
              "interaction values!"
          )
      if y is not None:
          raise NotImplementedError(
              "Interactions can currently only be computed if no background dataset is specified "
              "but explaining loss functions requires a background dataset. Re-instantiate the "
              "explainer with model_output='log_loss' and run fit(background_data=my_data) to "
              "explain loss values!!"
          )
  
imports: import copy
  import logging
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import numpy
  import pandas
  import shap
  import shap.utils._legacy
  from scipy import sparse
  from scipy.special import expit
  from shap import KernelExplainer
  from alibi.api.defaults import DEFAULT_DATA_KERNEL_SHAP, DEFAULT_DATA_TREE_SHAP, DEFAULT_META_KERNEL_SHAP, DEFAULT_META_TREE_SHAP
  from alibi.api.interfaces import Explainer, Explanation, FitMixin
  from alibi.utils.wrappers import methdispatch
label_desc: Use image node_id 8 for calling the TreeShap obj's underlying member method code with example usage: obj._check_interactions(approximate, background_data, y) without return types