docstr: Initialises background data if the user passes an `np.ndarray` object as input.
  If the user specifies feature grouping then a `shap_utils.DenseData` object
  is returned. Weights are handled separately to avoid triggering assertion
  correct inside `shap` library. Otherwise, the original data is returned and
  is handled by the `shap` library internally.
code: def _(
      self, background_data, *args, **kwargs
  ) -> Union[np.ndarray, shap_utils.Data]:
      """
      Initialises background data if the user passes an `np.ndarray` object as input.
      If the user specifies feature grouping then a `shap_utils.DenseData` object
      is returned. Weights are handled separately to avoid triggering assertion
      correct inside `shap` library. Otherwise, the original data is returned and
      is handled by the `shap` library internally.
      """
  
      group_names, groups, weights = args
      new_args = (
          (group_names, groups, weights)
          if weights is not None
          else (group_names, groups)
      )
      if self.use_groups:
          return shap_utils.DenseData(background_data, *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 6 for calling the KernelShap obj's underlying member method code with example usage: obj._(background_data) and returns: shap_utils, background_data