class_docstr: Running mode.
  
  The mode is simply the most common value. An approximate mode can be computed by setting the
  number of first unique values to count.
  
  Parameters
  ----------
  k
      Only the first `k` unique values will be included. If `k` equals -1, the exact mode is
      computed.
  
  Examples
  --------
  
  >>> from river import stats
  
  >>> X = ['sunny', 'cloudy', 'cloudy', 'rainy', 'rainy', 'rainy']
  >>> mode = stats.Mode(k=2)
  >>> for x in X:
  ...     mode.update(x)
  ...     print(mode.get())
  sunny
  sunny
  cloudy
  cloudy
  cloudy
  cloudy
  
  >>> mode = stats.Mode(k=-1)
  >>> for x in X:
  ...     mode.update(x)
  ...     print(mode.get())
  sunny
  sunny
  cloudy
  cloudy
  cloudy
  rainy
class_docstr_tok: ["Running","mode",".","The","mode","is","simply","the","most","common","value",".","An","approximate","mode","can","be","computed","by","setting","the","number","of","first","unique","values","to","count",".","Parameters","--","--","--","--","--","k","Only","the","first","`","k","`","unique","values","will","be","included",".","If","`","k","`","equals","-1",",","the","exact","mode","is","computed",".","Examples","--","--","--","--",">",">",">","from","river","import","stats",">",">",">","X","=","[","'sunny","'",",","'cloudy","'",",","'cloudy","'",",","'rainy","'",",","'rainy","'",",","'rainy","'","]",">",">",">","mode","=","stats.Mode","(","k=2",")",">",">",">","for","x","in","X",":","...","mode.update","(","x",")","...","print","(","mode.get","(",")",")","sunny","sunny","cloudy","cloudy","cloudy","cloudy",">",">",">","mode","=","stats.Mode","(","k=-1",")",">",">",">","for","x","in","X",":","...","mode.update","(","x",")","...","print","(","mode.get","(",")",")","sunny","sunny","cloudy","cloudy","cloudy","rainy"]
code: def name(self):
      return "mode"
  
file_path: river/river/stats/mode.py
imports: from __future__ import annotations
  import collections
  import numbers
  import typing
  from river import stats
label_desc: Use image node_id 2 for calling the Mode obj's underlying member method code with example usage: obj.name() and returns: str