code: def _test_kneighbors_classifier(
      self,
      n_neighbors=5,
      algorithm="brute",
      weights="uniform",
      metric="minkowski",
      metric_params={"p": 2},
      score_w_train_data=False,
  ):
      for data in [datasets.load_breast_cancer(), datasets.load_iris()]:
          X, y = data.data, data.target
          X = X.astype(np.float32)
  
          if metric == "wminkowski":
              metric_params = {"w": np.random.rand(X.shape[1])}
          elif metric == "seuclidean":
              metric_params = {"V": np.random.rand(X.shape[1])}
          elif metric == "mahalanobis":
              V = np.cov(X.T)
              metric_params = {"VI": np.linalg.inv(V)}
  
          model = KNeighborsClassifier(
              n_neighbors=n_neighbors,
              algorithm=algorithm,
              weights=weights,
              metric=metric,
              metric_params=metric_params,
          )
  
          n_train_rows = int(X.shape[0] * 0.6)
          model.fit(X[:n_train_rows, :], y[:n_train_rows])
  
          if not score_w_train_data:
              X = X[n_train_rows:, :]
  
          extra_config = {
              hummingbird.ml.operator_converters.constants.BATCH_SIZE: X.shape[
                  0
              ]
          }
          torch_model = hummingbird.ml.convert(
              model, "torch", extra_config=extra_config
          )
          self.assertTrue(torch_model is not None)
          np.testing.assert_allclose(
              model.predict_proba(X),
              torch_model.predict_proba(X),
              rtol=1e-6,
              atol=1e-5,
          )
  
imports: import unittest
  from packaging.version import Version, parse
  import numpy
  import sklearn
  import torch
  from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
  from sklearn import datasets
  import hummingbird.ml
label_desc: Use image node_id 1 for calling the TestSklearnKNeighbors obj's underlying member method code with example usage: obj._test_kneighbors_classifier(n_neighbors, algorithm, weights, metric, metric_params, score_w_train_data) without return types