docstr: Checks whether the inputs to the `explain` method match the explainer setup if shap interaction values are
  not required
  
  Parameters
  ----------
  background_data
      See `fit` method documentation.
  model_output
      See `TreeShap` constructor documentation.
  y
      See `explain` method documentation.
  
  Raises
  ------
  NotImplementedError
      If the users passes labels to the `explain` method but does not specify a background dataset or
      if the user does not pass a background dataset to `fit` and specifies a `model_output` other than
      `'raw'` when initialising the explainer.
  ValueError
      If the user passes labels to the `explain` method but has not set `model_output='log_loss'` when
      initialising the explainer.
code: def _check_explainer_setup(
      self,
      background_data: Union[np.ndarray, pd.DataFrame, None],
      model_output: str,
      y: Optional[np.ndarray],
  ) -> None:
      """
      Checks whether the inputs to the `explain` method match the explainer setup if shap interaction values are
      not required
  
      Parameters
      ----------
      background_data
          See `fit` method documentation.
      model_output
          See `TreeShap` constructor documentation.
      y
          See `explain` method documentation.
  
      Raises
      ------
      NotImplementedError
          If the users passes labels to the `explain` method but does not specify a background dataset or
          if the user does not pass a background dataset to `fit` and specifies a `model_output` other than
          `'raw'` when initialising the explainer.
      ValueError
          If the user passes labels to the `explain` method but has not set `model_output='log_loss'` when
          initialising the explainer.
      """
  
      # check settings are correct for loss value explanations
      if y is not None:
          if background_data is None:
              raise NotImplementedError(
                  "Loss values can only currently be explained with respect to the value over a background dataset. "
                  "Re-instantiate the explainer and run fit(background_data=my_data)!"
              )
          if model_output != "log_loss":
              raise ValueError(
                  "Model output should be set to 'log_loss' in order to explain loss values. Re-instantiate the model"
                  "with the option `model_output='log_loss' passed to the constructor, call  "
                  "fit(background_data=my_data) and then explain with the default arguments."
              )
      # check model output data is compatible with background data setting
      else:
          if background_data is None:
              if model_output != "raw":
                  raise NotImplementedError(
                      f"Without a background dataset, only raw output can be explained currently. "
                      f"To explain output {model_output}, select a background dataset, re-instanstiate the "
                      f"explainer with the desired model output option and then call fit(background_data=my_data)!"
                  )
  
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 9 for calling the TreeShap obj's underlying member method code with example usage: obj._check_explainer_setup(background_data, model_output, y) without return types