code: def test_sparse_matrix_inputs_and_features_in_secondary():
      lr = LinearRegression()
      svr_lin = SVR(kernel="linear", gamma="auto")
      rf = RandomForestRegressor(n_estimators=10, random_state=2)
      ridge = Ridge(random_state=0)
      svr_rbf = SVR(kernel="rbf", gamma="auto")
      stack = StackingRegressor(
          regressors=[svr_lin, lr, ridge, rf],
          meta_regressor=svr_rbf,
          use_features_in_secondary=True,
      )
  
      # dense
      stack.fit(X1, y).predict(X1)
      mse = 0.14
      got = np.mean((stack.predict(X1) - y) ** 2)
      assert round(got, 2) == mse
  
      # sparse
      stack.fit(sparse.csr_matrix(X1), y)
      mse = 0.14
      got = np.mean((stack.predict(sparse.csr_matrix(X1)) - y) ** 2)
      assert round(got, 2) == mse
  
imports: import numpy
  import pytest
  from numpy.testing import assert_almost_equal
  from packaging.version import Version
  from scipy import sparse
  from sklearn import __version__
  from sklearn.base import clone
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import LinearRegression, Ridge
  from sklearn.model_selection import GridSearchCV, train_test_split
  from sklearn.neighbors import KNeighborsRegressor
  from sklearn.svm import SVR
  from mlxtend.externals.estimator_checks import NotFittedError
  from mlxtend.regressor import StackingRegressor
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 22 for calling a global function with example usage: test_sparse_matrix_inputs_and_features_in_secondary() without return types