code: def test_rfe(csr_container):
      generator = check_random_state(0)
      iris = load_iris()
      # Add some irrelevant features. Random seed is set to make sure that
      # irrelevant features are always irrelevant.
      X = np.c_[iris.data, generator.normal(size=(len(iris.data), 6))]
      X_sparse = csr_container(X)
      y = iris.target
  
      # dense model
      clf = SVC(kernel="linear")
      rfe = RFE(estimator=clf, n_features_to_select=4, step=0.1)
      rfe.fit(X, y)
      X_r = rfe.transform(X)
      clf.fit(X_r, y)
      assert len(rfe.ranking_) == X.shape[1]
  
      # sparse model
      clf_sparse = SVC(kernel="linear")
      rfe_sparse = RFE(
          estimator=clf_sparse, n_features_to_select=4, step=0.1
      )
      rfe_sparse.fit(X_sparse, y)
      X_r_sparse = rfe_sparse.transform(X_sparse)
  
      assert X_r.shape == iris.data.shape
      assert_array_almost_equal(X_r[:10], iris.data[:10])
  
      assert_array_almost_equal(rfe.predict(X), clf.predict(iris.data))
      assert rfe.score(X, y) == clf.score(iris.data, iris.target)
      assert_array_almost_equal(X_r, X_r_sparse.toarray())
  
imports: from operator import attrgetter
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal
  from sklearn.base import BaseEstimator, ClassifierMixin
  from sklearn.compose import TransformedTargetRegressor
  from sklearn.cross_decomposition import CCA, PLSCanonical, PLSRegression
  from sklearn.datasets import load_iris, make_friedman1
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.feature_selection import RFE, RFECV
  from sklearn.impute import SimpleImputer
  from sklearn.linear_model import LogisticRegression
  from sklearn.metrics import get_scorer, make_scorer, zero_one_loss
  from sklearn.model_selection import GroupKFold, cross_val_score
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import StandardScaler
  from sklearn.svm import SVC, SVR, LinearSVR
  from sklearn.utils import check_random_state
  from sklearn.utils._testing import ignore_warnings
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 2 for calling a global function with example usage: test_rfe(csr_container) without return types