code: def test_sparse():
      """Validate running LinearExplainer on scipy sparse data"""
      make_multilabel_classification = pytest.importorskip(
          "sklearn.datasets"
      ).make_multilabel_classification
      LogisticRegression = pytest.importorskip(
          "sklearn.linear_model"
      ).LogisticRegression
  
      n_features = 20
      X, y = make_multilabel_classification(
          n_samples=100,
          sparse=True,
          n_features=n_features,
          n_classes=1,
          n_labels=2,
      )
  
      # train linear model
      model = LogisticRegression()
      model.fit(X, y.squeeze())
  
      # explain the model's predictions using SHAP values
      explainer = shap.LinearExplainer(model, X)
      shap_values = explainer.shap_values(X)
      assert (
          np.max(
              np.abs(
                  scipy.special.expit(
                      explainer.expected_value + shap_values.sum(1)
                  )
                  - model.predict_proba(X)[:, 1]
              )
          )
          < 1e-6
      )
  
file_path: shap/tests/explainers/test_linear.py
imports: import numpy
  import pytest
  import scipy.special
  import shap
label_desc: Use image node_id 13 for calling a global function with example usage: test_sparse() without return types