code: def test_regression_cv_3_and_r2(load_diabetes_dataset):
      #  test for regression using cv=3, and the r2 as metric.
      X, y = load_diabetes_dataset
      sel = SelectBySingleFeaturePerformance(
          estimator=LinearRegression(),
          scoring="r2",
          cv=3,
          threshold=0.01,
      )
      sel.fit(X, y)
  
      # expected output
      Xtransformed = pd.DataFrame(X[[0, 2, 3, 4, 5, 6, 7, 8, 9]].copy())
  
      performance_dict = {
          0: 0.029,
          1: -0.004,
          2: 0.337,
          3: 0.192,
          4: 0.037,
          5: 0.018,
          6: 0.152,
          7: 0.177,
          8: 0.315,
          9: 0.139,
      }
  
      # test init params
      assert sel.cv == 3
      assert sel.scoring == "r2"
      assert sel.threshold == 0.01
      # fit params
      assert sel.features_to_drop_ == [1]
      assert all(
          np.round(sel.feature_performance_[f], 3)
          == performance_dict[f]
          for f in sel.feature_performance_.keys()
      )
      # test transform output
      pd.testing.assert_frame_equal(sel.transform(X), Xtransformed)
  
file_path: feature_engine/tests/test_selection/test_single_feature_performance_selection.py
imports: import warnings
  import numpy
  import pandas
  import pytest
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LinearRegression
  from sklearn.tree import DecisionTreeRegressor
  from feature_engine.selection import SelectBySingleFeaturePerformance
label_desc: Use image node_id 2 for calling a global function with example usage: test_regression_cv_3_and_r2(load_diabetes_dataset) without return types