docstr: Initialises background data if the user passes a `pandas.core.frame.DataFrame` as input.
  If the user has specified groups and given a data frame, it initialises a `shap_utils.DenseData`
  object explicitly as this is not handled by `shap` library internally. Otherwise, data initialisation,
  is left to the `shap` library.
code: def _(
      self, background_data, *args, **kwargs
  ) -> Union[shap_utils.Data, pd.core.frame.DataFrame]:
      """
      Initialises background data if the user passes a `pandas.core.frame.DataFrame` as input.
      If the user has specified groups and given a data frame, it initialises a `shap_utils.DenseData`
      object explicitly as this is not handled by `shap` library internally. Otherwise, data initialisation,
      is left to the `shap` library.
      """
  
      _, groups, weights = args
      new_args = (groups, weights) if weights is not None else (groups,)
      if self.use_groups:
          logger.info(
              "Group names are specified by column headers, group_names will be ignored!"
          )
          keep_index = kwargs.get("keep_index", False)
          if keep_index:
              return shap_utils.DenseDataWithIndex(
                  background_data.values,
                  list(background_data.columns),
                  background_data.index.values,
                  background_data.index.name,
                  *new_args,
              )
          else:
              return shap_utils.DenseData(
                  background_data.values,
                  list(background_data.columns),
                  *new_args,
              )
      else:
          return background_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 8 for calling the KernelShap obj's underlying member method code with example usage: obj._(background_data) and returns: background_data, shap_utils, shap_utils