code: def test_knn_scoring_metric():
      iris = load_iris()
      X = iris.data
      y = iris.target
      knn = KNeighborsClassifier(n_neighbors=4)
      sfs5 = SFS(
          knn,
          k_features=3,
          forward=False,
          floating=True,
          cv=4,
          verbose=0,
      )
      sfs5 = sfs5.fit(X, y)
  
      if Version(sklearn_version) < Version("0.22"):
          assert round(sfs5.k_score_, 4) == 0.9728
      else:
          assert round(sfs5.k_score_, 4) == 0.9732
  
      sfs6 = SFS(
          knn,
          k_features=3,
          forward=False,
          floating=True,
          cv=4,
          verbose=0,
      )
      sfs6 = sfs6.fit(X, y)
      if Version(sklearn_version) < Version("0.22"):
          assert round(sfs5.k_score_, 4) == 0.9728
      else:
          assert round(sfs5.k_score_, 4) == 0.9732
  
      sfs7 = SFS(
          knn,
          k_features=3,
          forward=False,
          floating=True,
          scoring="f1_macro",
          cv=4,
      )
      sfs7 = sfs7.fit(X, y)
      if Version(sklearn_version) < Version("0.22"):
          assert round(sfs5.k_score_, 4) == 0.9727
      else:
          assert round(sfs5.k_score_, 4) == 0.9732
  
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 23 for calling a global function with example usage: test_knn_scoring_metric() without return types