code: def test_knn_rbf_groupkfold():
      nan_roc_auc_scorer = make_scorer(nan_roc_auc_score)
      rng = np.random.RandomState(123)
      iris = load_iris()
      X = iris.data
      # knn = KNeighborsClassifier(n_neighbors=4)
      forest = RandomForestClassifier(
          n_estimators=100, random_state=123
      )
      bool_01 = [
          True if item == 0 else False for item in iris["target"]
      ]
      bool_02 = [
          True if (item == 1 or item == 2) else False
          for item in iris["target"]
      ]
      groups = []
      y_new = []
      for ind, _ in enumerate(bool_01):
          if bool_01[ind]:
              groups.append("attribute_A")
              y_new.append(0)
          if bool_02[ind]:
              throw = rng.rand()
              if throw < 0.5:
                  groups.append("attribute_B")
              else:
                  groups.append("attribute_C")
              throw2 = rng.rand()
              if throw2 < 0.5:
                  y_new.append(0)
              else:
                  y_new.append(1)
      y_new_bool = [True if item == 1 else False for item in y_new]
      cv_obj = GroupKFold(n_splits=3)
      cv_obj_list = list(cv_obj.split(X, np.array(y_new_bool), groups))
      sfs1 = SFS(
          forest,
          k_features=3,
          forward=True,
          floating=False,
          cv=cv_obj_list,
          scoring=nan_roc_auc_scorer,
          verbose=0,
      )
      sfs1 = sfs1.fit(X, y_new)
      expect = {
          1: {
              "cv_scores": np.array([0.52, nan, 0.72]),
              "avg_score": 0.62,
              "feature_idx": (1,),
          },
          2: {
              "cv_scores": np.array([0.42, nan, 0.65]),
              "avg_score": 0.53,
              "feature_idx": (1, 2),
          },
          3: {
              "cv_scores": np.array([0.47, nan, 0.63]),
              "avg_score": 0.55,
              "feature_idx": (1, 2, 3),
          },
      }
  
      dict_compare_utility(
          d_actual=sfs1.subsets_, d_desired=expect, decimal=1
      )
  
imports: import numpy
  import pandas
  from numpy import nan
  from numpy.testing import assert_almost_equal
  from packaging.version import Version
  from sklearn import __version__
  from sklearn.datasets import load_iris
  from sklearn.decomposition import PCA
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.linear_model import LinearRegression
  from sklearn.metrics import accuracy_score, make_scorer, roc_auc_score
  from sklearn.model_selection import GridSearchCV, GroupKFold
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.pipeline import Pipeline
  from mlxtend.classifier import SoftmaxRegression
  from mlxtend.data import boston_housing_data
  from mlxtend.feature_selection import SequentialFeatureSelector
  from mlxtend.utils import assert_raises
label_desc: Use image node_id 13 for calling a global function with example usage: test_knn_rbf_groupkfold() without return types