class_docstr: Construct a CoreML KNearestNeighborsClassifier specification.
  
  Please see the Core ML Nearest Neighbors protobuf message for more information
  on KNearestNeighborsClassifier parameters.
  
  Examples
  --------
  .. sourcecode:: python
  
      from coremltools.models.nearest_neighbors import KNearestNeighborsClassifierBuilder
      from coremltools.models.utils import save_spec
  
      # Create a KNearestNeighborsClassifier model that takes 4-dimensional input data and outputs a string label.
      >>> builder = KNearestNeighborsClassifierBuilder(input_name='input',
      ...                                              output_name='output',
      ...                                              number_of_dimensions=4,
      ...                                              default_class_label='default_label')
  
      # save the spec by the builder
      >>> save_spec(builder.spec, 'knnclassifier.mlmodel')
      
docstr: Set the weighting scheme for the KNearestNeighborsClassifier model.
  
  Parameters
  ----------
  weighting_scheme
          One of [ ``'uniform'``, ``'inverse_distance'`` ].
  
  Returns
  -------
  None
docstr_tok: ["Set","the","weighting","scheme","for","the","KNearestNeighborsClassifier","model",".","Parameters","--","--","--","--","--","weighting_scheme","One","of","[","``","'uniform","'","``",",","``","'inverse_distance","'","``","]",".","Returns","--","--","--","-","None"]
code: def weighting_scheme(self, weighting_scheme):
      """
      Set the weighting scheme for the KNearestNeighborsClassifier model.
  
      Parameters
      ----------
      weighting_scheme
              One of [ ``'uniform'``, ``'inverse_distance'`` ].
  
      Returns
      -------
      None
      """
      weighting_scheme = weighting_scheme.lower()
      if weighting_scheme not in self._VALID_WEIGHTING_SCHEMES:
          raise TypeError("Invalid weighting scheme")
  
      if weighting_scheme == "inverse_distance":
          self.spec.kNearestNeighborsClassifier.inverseDistanceWeighting.MergeFromString(
              b""
          )
      else:
          self.spec.kNearestNeighborsClassifier.uniformWeighting.MergeFromString(
              b""
          )
  
      # storing this in the object is just a convenience
      self._weighting_scheme = weighting_scheme
  
imports: import numpy
  import coremltools
  from ...proto import FeatureTypes_pb2
  from ..None import datatypes
label_desc: Use image node_id 11 for calling the KNearestNeighborsClassifierBuilder obj's underlying member method code with example usage: obj.weighting_scheme(weighting_scheme) without return types