class_docstr: Running mode over a window.
  
  The mode is the most common value.
  
  Parameters
  ----------
  window_size
      Size of the rolling window.
  
  Attributes
  ----------
  counts : collections.defaultdict
      Value counts.
  
  Examples
  --------
  
  >>> from river import stats
  
  >>> X = ['sunny', 'sunny', 'sunny', 'rainy', 'rainy', 'rainy', 'rainy']
  >>> rolling_mode = stats.RollingMode(window_size=2)
  >>> for x in X:
  ...     rolling_mode.update(x)
  ...     print(rolling_mode.get())
  sunny
  sunny
  sunny
  sunny
  rainy
  rainy
  rainy
  
  >>> rolling_mode = stats.RollingMode(window_size=5)
  >>> for x in X:
  ...     rolling_mode.update(x)
  ...     print(rolling_mode.get())
  sunny
  sunny
  sunny
  sunny
  sunny
  rainy
  rainy
class_docstr_tok: ["Running","mode","over","a","window",".","The","mode","is","the","most","common","value",".","Parameters","--","--","--","--","--","window_size","Size","of","the","rolling","window",".","Attributes","--","--","--","--","--","counts",":","collections.defaultdict","Value","counts",".","Examples","--","--","--","--",">",">",">","from","river","import","stats",">",">",">","X","=","[","'sunny","'",",","'sunny","'",",","'sunny","'",",","'rainy","'",",","'rainy","'",",","'rainy","'",",","'rainy","'","]",">",">",">","rolling_mode","=","stats.RollingMode","(","window_size=2",")",">",">",">","for","x","in","X",":","...","rolling_mode.update","(","x",")","...","print","(","rolling_mode.get","(",")",")","sunny","sunny","sunny","sunny","rainy","rainy","rainy",">",">",">","rolling_mode","=","stats.RollingMode","(","window_size=5",")",">",">",">","for","x","in","X",":","...","rolling_mode.update","(","x",")","...","print","(","rolling_mode.get","(",")",")","sunny","sunny","sunny","sunny","sunny","rainy","rainy"]
code: def get(self):
      return max(self.counts, key=self.counts.get, default=None)
  
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 4 for calling the RollingMode obj's underlying member method code with example usage: obj.get() and returns: max