class_docstr: Beta distribution for binary data.
  
  A Beta distribution is very similar to a Bernoulli distribution in that it counts occurrences
  of boolean events. The differences lies in what is being measured. A Binomial distribution
  models the probability of an event occurring, whereas a Beta distribution models the
  probability distribution itself. In other words, it's a probability distribution over
  probability distributions.
  
  Parameters
  ----------
  alpha
      Initial alpha parameter.
  beta
      Initial beta parameter.
  seed
      Random number generator seed for reproducibility.
  
  Examples
  --------
  
  >>> from river import proba
  
  >>> successes = 81
  >>> failures = 219
  >>> beta = proba.Beta(successes, failures)
  
  >>> beta(.21), beta(.35)
  (0.867..., 0.165...)
  
  >>> for success in range(100):
  ...     beta.update(True)
  >>> for failure in range(200):
  ...     beta.update(False)
  
  >>> beta(.21), beta(.35)
  (2.525...e-05, 0.841...)
  
  >>> beta.cdf(.35)
  0.994168...
  
  References
  ----------
  [^1]: [What is the intuition behind beta distribution?](https://stats.stackexchange.com/questions/47771/what-is-the-intuition-behind-beta-distribution)
class_docstr_tok: ["Beta","distribution","for","binary","data",".","A","Beta","distribution","is","very","similar","to","a","Bernoulli","distribution","in","that","it","counts","occurrences","of","boolean","events",".","The","differences","lies","in","what","is","being","measured",".","A","Binomial","distribution","models","the","probability","of","an","event","occurring",",","whereas","a","Beta","distribution","models","the","probability","distribution","itself",".","In","other","words",",","it","'s","a","probability","distribution","over","probability","distributions",".","Parameters","--","--","--","--","--","alpha","Initial","alpha","parameter",".","beta","Initial","beta","parameter",".","seed","Random","number","generator","seed","for","reproducibility",".","Examples","--","--","--","--",">",">",">","from","river","import","proba",">",">",">","successes","=","81",">",">",">","failures","=","219",">",">",">","beta","=","proba.Beta","(","successes",",","failures",")",">",">",">","beta","(",".21",")",",","beta","(",".35",")","(","0.867","...",",","0.165","...",")",">",">",">","for","success","in","range","(","100",")",":","...","beta.update","(","True",")",">",">",">","for","failure","in","range","(","200",")",":","...","beta.update","(","False",")",">",">",">","beta","(",".21",")",",","beta","(",".35",")","(","2.525","...","e-05",",","0.841","...",")",">",">",">","beta.cdf","(",".35",")","0.994168","...","References","--","--","--","--","--","[","^1","]",":","[","What","is","the","intuition","behind","beta","distribution","?","]","(","https",":","\/\/stats.stackexchange.com\/questions\/47771\/what-is-the-intuition-behind-beta-distribution",")"]
code: def mode(self):
      try:
          return (self.alpha - 1) / (self.alpha + self.beta - 2)
      except ZeroDivisionError:
          return 0.5
  
file_path: river/river/proba/beta.py
imports: from __future__ import annotations
  import math
  import scipy.special
  from river.proba import base
label_desc: Use image node_id 7 for calling the Beta obj's underlying member method code with example usage: obj.mode() and returns: unknown, int