class_docstr: Boosting for classification.
  
  For each incoming observation, each model's `learn_one` method is called `k` times where
  `k` is sampled from a Poisson distribution of parameter lambda. The lambda parameter is
  updated when the weaks learners fit successively the same observation.
  
  Parameters
  ----------
  model
      The classifier to boost.
  n_models
      The number of models in the ensemble.
  seed
      Random number generator seed for reproducibility.
  
  Examples
  --------
  
  In the following example three tree classifiers are boosted together. The performance is
  slightly better than when using a single tree.
  
  >>> from river import datasets
  >>> from river import ensemble
  >>> from river import evaluate
  >>> from river import metrics
  >>> from river import tree
  
  >>> dataset = datasets.Phishing()
  
  >>> metric = metrics.LogLoss()
  
  >>> model = ensemble.AdaBoostClassifier(
  ...     model=(
  ...         tree.HoeffdingTreeClassifier(
  ...             split_criterion='gini',
  ...             delta=1e-5,
  ...             grace_period=2000
  ...         )
  ...     ),
  ...     n_models=5,
  ...     seed=42
  ... )
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  LogLoss: 0.370805
  
  >>> print(model)
  AdaBoostClassifier(HoeffdingTreeClassifier)
  
  References
  ----------
  [^1]: [Oza, N.C., 2005, October. Online bagging and boosting. In 2005 IEEE international conference on systems, man and cybernetics (Vol. 3, pp. 2340-2345). Ieee.](https://ti.arc.nasa.gov/m/profile/oza/files/ozru01a.pdf)
class_docstr_tok: ["Boosting","for","classification",".","For","each","incoming","observation",",","each","model","'s","`","learn_one","`","method","is","called","`","k","`","times","where","`","k","`","is","sampled","from","a","Poisson","distribution","of","parameter","lambda",".","The","lambda","parameter","is","updated","when","the","weaks","learners","fit","successively","the","same","observation",".","Parameters","--","--","--","--","--","model","The","classifier","to","boost",".","n_models","The","number","of","models","in","the","ensemble",".","seed","Random","number","generator","seed","for","reproducibility",".","Examples","--","--","--","--","In","the","following","example","three","tree","classifiers","are","boosted","together",".","The","performance","is","slightly","better","than","when","using","a","single","tree",".",">",">",">","from","river","import","datasets",">",">",">","from","river","import","ensemble",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","metrics",">",">",">","from","river","import","tree",">",">",">","dataset","=","datasets.Phishing","(",")",">",">",">","metric","=","metrics.LogLoss","(",")",">",">",">","model","=","ensemble.AdaBoostClassifier","(","...","model=","(","...","tree.HoeffdingTreeClassifier","(","...","split_criterion='gini","'",",","...","delta=1e-5",",","...","grace_period=2000","...",")","...",")",",","...","n_models=5",",","...","seed=42","...",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metric",")","LogLoss",":","0.370805",">",">",">","print","(","model",")","AdaBoostClassifier","(","HoeffdingTreeClassifier",")","References","--","--","--","--","--","[","^1","]",":","[","Oza",",","N.C.",",","2005",",","October",".","Online","bagging","and","boosting",".","In","2005","IEEE","international","conference","on","systems",",","man","and","cybernetics","(","Vol",".","3",",","pp",".","2340-2345",")",".","Ieee",".","]","(","https",":","\/\/ti.arc.nasa.gov\/m\/profile\/oza\/files\/ozru01a.pdf",")"]
code: def __init__(
      self, model: base.Classifier, n_models=10, seed: int | None = None
  ):
      super().__init__(model, n_models, seed)
      self.wrong_weight: collections.defaultdict = (
          collections.defaultdict(int)
      )
      self.correct_weight: collections.defaultdict = (
          collections.defaultdict(int)
      )
  
file_path: river/river/ensemble/boosting.py
imports: from __future__ import annotations
  import collections
  import math
  from river import base, drift, linear_model, utils
label_desc: Use image node_id 1 to create a new AdaBoostClassifier object from inherited base classes: base, base with example: obj = AdaBoostClassifier(model, n_models, seed)