class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
docstr: Tests conversion of a scikit KNeighborsClassifier with an invalid distance metric.
docstr_tok: ["Tests","conversion","of","a","scikit","KNeighborsClassifier","with","an","invalid","distance","metric","."]
code: def test_conversion_unsupported_distance_function(self):
      """Tests conversion of a scikit KNeighborsClassifier with an invalid distance metric."""
      # There are many possible distance functions for a brute force neighbors function, but these 3 should give us
      # coverage over the converter code.
      scikit_model = KNeighborsClassifier(
          algorithm="brute", metric="manhattan"
      )
      scikit_model.fit(self.iris_X, self.iris_y)
      self.assertRaises(TypeError, sklearn.convert, scikit_model)
  
      scikit_model = KNeighborsClassifier(
          algorithm="kd_tree", metric="chebyshev"
      )
      scikit_model.fit(self.iris_X, self.iris_y)
      self.assertRaises(TypeError, sklearn.convert, scikit_model)
  
      scikit_model = KNeighborsClassifier(
          algorithm="brute", metric="minkowski", p=3
      )
      scikit_model.fit(self.iris_X, self.iris_y)
      self.assertRaises(TypeError, sklearn.convert, scikit_model)
  
      def callable_distance_function():
          print("Inside callable_distance_function")
  
      scikit_model = KNeighborsClassifier(
          algorithm="brute", metric=callable_distance_function
      )
      scikit_model.fit(self.iris_X, self.iris_y)
      self.assertRaises(TypeError, sklearn.convert, scikit_model)
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/test/sklearn_tests/test_k_neighbors_classifier.py
imports: import unittest
  import numpy
  from scipy import sparse
  from coremltools._deps import _HAS_SKLEARN
label_desc: Use image node_id 10 for calling the KNeighborsClassifierScikitTest obj's underlying member method code with example usage: obj.test_conversion_unsupported_distance_function() without return types