class_docstr: K-Nearest Neighbors (KNN) for classification.
  
  Samples are stored using a first-in, first-out strategy. The strategy to perform search
  queries in the data buffer is defined by the `engine` parameter.
  
  Parameters
  ----------
  n_neighbors
      The number of nearest neighbors to search for.
  engine
      The search engine used to store the instances and perform search queries. Depending
      on the choose engine, search will be exact or approximate. Please, consult the
      documentation of each available search engine for more details on its usage.
      By default, use the `SWINN` search engine for approximate search queries.
  weighted
      Weight the contribution of each neighbor by it's inverse distance.
  cleanup_every
      This determines at which rate old classes are cleaned up. Classes that
      have been seen in the past but that are not present in the current
      window are dropped. Classes are never dropped when this is set to 0.
  softmax
      Whether or not to use softmax normalization to normalize the neighbors contributions.
      Votes are divided by the total number of votes if this is `False`.
  
  Notes
  -----
  Note that since the window is moving and we keep track of all classes that
  are added at some point, a class might be returned in a result (with a
  value of 0) if it is no longer in the window. You can call
  model.clean_up_classes(), or set `cleanup_every` to a non-zero value.
  
  Examples
  --------
  >>> import functools
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import metrics
  >>> from river import neighbors
  >>> from river import preprocessing
  >>> from river import utils
  
  >>> dataset = datasets.Phishing()
  
  To select a custom distance metric which takes one or several parameter, you can wrap your
  chosen distance using `functools.partial`:
  
  >>> l1_dist = functools.partial(utils.math.minkowski_distance, p=1)
  
  >>> model = (
  ...     preprocessing.StandardScaler() |
  ...     neighbors.KNNClassifier(
  ...         engine=neighbors.SWINN(
  ...             dist_func=l1_dist,
  ...             seed=42
  ...         )
  ...     )
  ... )
  
  >>> evaluate.progressive_val_score(dataset, model, metrics.Accuracy())
  Accuracy: 89.67%
class_docstr_tok: ["K-Nearest","Neighbors","(","KNN",")","for","classification",".","Samples","are","stored","using","a","first-in",",","first-out","strategy",".","The","strategy","to","perform","search","queries","in","the","data","buffer","is","defined","by","the","`","engine","`","parameter",".","Parameters","--","--","--","--","--","n_neighbors","The","number","of","nearest","neighbors","to","search","for",".","engine","The","search","engine","used","to","store","the","instances","and","perform","search","queries",".","Depending","on","the","choose","engine",",","search","will","be","exact","or","approximate",".","Please",",","consult","the","documentation","of","each","available","search","engine","for","more","details","on","its","usage",".","By","default",",","use","the","`","SWINN","`","search","engine","for","approximate","search","queries",".","weighted","Weight","the","contribution","of","each","neighbor","by","it","'s","inverse","distance",".","cleanup_every","This","determines","at","which","rate","old","classes","are","cleaned","up",".","Classes","that","have","been","seen","in","the","past","but","that","are","not","present","in","the","current","window","are","dropped",".","Classes","are","never","dropped","when","this","is","set","to","0.","softmax","Whether","or","not","to","use","softmax","normalization","to","normalize","the","neighbors","contributions",".","Votes","are","divided","by","the","total","number","of","votes","if","this","is","`","False","`",".","Notes","--","--","-","Note","that","since","the","window","is","moving","and","we","keep","track","of","all","classes","that","are","added","at","some","point",",","a","class","might","be","returned","in","a","result","(","with","a","value","of","0",")","if","it","is","no","longer","in","the","window",".","You","can","call","model.clean_up_classes","(",")",",","or","set","`","cleanup_every","`","to","a","non-zero","value",".","Examples","--","--","--","--",">",">",">","import","functools",">",">",">","from","river","import","datasets",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","metrics",">",">",">","from","river","import","neighbors",">",">",">","from","river","import","preprocessing",">",">",">","from","river","import","utils",">",">",">","dataset","=","datasets.Phishing","(",")","To","select","a","custom","distance","metric","which","takes","one","or","several","parameter",",","you","can","wrap","your","chosen","distance","using","`","functools.partial","`",":",">",">",">","l1_dist","=","functools.partial","(","utils.math.minkowski_distance",",","p=1",")",">",">",">","model","=","(","...","preprocessing.StandardScaler","(",")","|","...","neighbors.KNNClassifier","(","...","engine=neighbors.SWINN","(","...","dist_func=l1_dist",",","...","seed=42","...",")","...",")","...",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metrics.Accuracy","(",")",")","Accuracy",":","89.67","%"]
code: def _multiclass(self):
      return True
  
file_path: river/river/neighbors/knn_classifier.py
imports: from __future__ import annotations
  import functools
  from river import base, utils
  from river.neighbors import SWINN
  from .base import BaseNN, FunctionWrapper
label_desc: Use image node_id 2 for calling the KNNClassifier obj's underlying member method code with example usage: obj._multiclass() and returns: True