code: def test_single_feature(random_seed):
      """Make sure things work with a univariate linear regression."""
      Ridge = pytest.importorskip("sklearn.linear_model").Ridge
  
      # generate linear data
      rs = np.random.RandomState(random_seed)
      X = rs.normal(1, 10, size=(100, 1))
      y = 2 * X[:, 0] + 1 + rs.normal(scale=0.1, size=100)
  
      # train linear model
      model = Ridge(0.1)
      model.fit(X, y)
  
      # explain the model's predictions using SHAP values
      explainer = shap.LinearExplainer(model, X)
      shap_values = explainer.shap_values(X)
      assert (
          np.abs(explainer.expected_value - model.predict(X).mean())
          < 1e-6
      )
      assert (
          np.max(
              np.abs(
                  explainer.expected_value
                  + shap_values.sum(1)
                  - model.predict(X)
              )
          )
          < 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 12 for calling a global function with example usage: test_single_feature(random_seed) without return types