code: def test_shape_values_linear_many_features():
      Ridge = pytest.importorskip("sklearn.linear_model").Ridge
  
      coef = np.array([1, 2]).T
  
      # FIXME: this test should ideally pass with any random seed. See #2960
      random_seed = 0
      rs = np.random.RandomState(random_seed)
      # generate linear data
      X = rs.normal(1, 10, size=(1000, len(coef)))
      y = np.dot(X, coef) + 1 + rs.normal(scale=0.1, size=1000)
  
      # train linear model
      model = Ridge(0.1)
      model.fit(X, y)
  
      # explain the model's predictions using SHAP values
      explainer = shap.LinearExplainer(model, X.mean(0).reshape(1, -1))
  
      values = explainer.shap_values(X)
  
      assert values.shape == (1000, 2)
  
      expected = (X - X.mean(0)) * coef
      np.testing.assert_allclose(expected - values, 0, atol=0.01)
  
file_path: shap/tests/explainers/test_linear.py
imports: import numpy
  import pytest
  import scipy.special
  import shap
label_desc: Use image node_id 11 for calling a global function with example usage: test_shape_values_linear_many_features() without return types