code: def test_kernel_shap_with_a1a_sparse_zero_background():
      """Test with a sparse matrix for the background."""
  
      X, y = shap.datasets.a1a()
      (
          x_train,
          x_test,
          y_train,
          _,
      ) = sklearn.model_selection.train_test_split(
          X, y, test_size=0.01, random_state=0
      )
      linear_model = sklearn.linear_model.LinearRegression()
      linear_model.fit(x_train, y_train)
  
      _, cols = x_train.shape
      shape = 1, cols
      background = scipy.sparse.csr_matrix(shape, dtype=x_train.dtype)
      explainer = shap.KernelExplainer(linear_model.predict, background)
      explainer.shap_values(x_test)
  
file_path: shap/tests/explainers/test_kernel.py
imports: import numpy
  import pandas
  import scipy.sparse
  import sklearn
  import shap
label_desc: Use image node_id 8 for calling a global function with example usage: test_kernel_shap_with_a1a_sparse_zero_background() without return types