code: def test_sparse_matrix_inputs():
      lr = LinearRegression()
      svr_lin = SVR(kernel="linear", gamma="auto")
      ridge = Ridge(random_state=1)
      svr_rbf = SVR(kernel="rbf", gamma="auto")
      stack = StackingCVRegressor(
          regressors=[svr_lin, lr, ridge],
          meta_regressor=svr_rbf,
          random_state=42,
      )
  
      # dense
      stack.fit(X1, y).predict(X1)
      mse = 0.21
      got = np.mean((stack.predict(X1) - y) ** 2)
      assert round(got, 2) == mse, got
  
      # sparse
      stack.fit(sparse.csr_matrix(X1), y)
  
      if Version(sklearn_version) < Version("0.21"):
          expected_value = 0.20
      elif Version(sklearn_version) < Version("0.22"):
          expected_value = 0.20
      else:
          expected_value = 0.21
  
      got = np.mean((stack.predict(sparse.csr_matrix(X1)) - y) ** 2)
      assert round(got, 2) == expected_value, got
  
imports: import random
  import numpy
  import pytest
  from packaging.version import Version
  from scipy import sparse
  from sklearn import __version__
  from sklearn.base import clone
  from sklearn.linear_model import Lasso, LinearRegression, Ridge
  from sklearn.model_selection import GridSearchCV, KFold, train_test_split
  from sklearn.neighbors import KNeighborsRegressor
  from sklearn.svm import SVR
  from mlxtend.externals.estimator_checks import NotFittedError
  from mlxtend.regressor import StackingCVRegressor
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 13 for calling a global function with example usage: test_sparse_matrix_inputs() without return types