class_docstr: Random over-sampling.
  
  This is a wrapper for classifiers. It will train the provided classifier by over-sampling the
  stream of given observations so that the class distribution seen by the classifier follows
  a given desired distribution. The implementation is a discrete version of reverse rejection
  sampling.
  
  See [Working with imbalanced data](/user-guide/imbalanced-learning) for example usage.
  
  Parameters
  ----------
  classifier
  desired_dist
      The desired class distribution. The keys are the classes whilst the values are the desired
      class percentages. The values must sum up to 1.
  seed
      Random seed for reproducibility.
  
  Examples
  --------
  
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import imblearn
  >>> from river import linear_model
  >>> from river import metrics
  >>> from river import preprocessing
  
  >>> model = imblearn.RandomOverSampler(
  ...     (
  ...         preprocessing.StandardScaler() |
  ...         linear_model.LogisticRegression()
  ...     ),
  ...     desired_dist={False: 0.4, True: 0.6},
  ...     seed=42
  ... )
  
  >>> dataset = datasets.CreditCard().take(3000)
  
  >>> metric = metrics.LogLoss()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  LogLoss: 0.0457...
code: def __init__(
      self,
      classifier: base.Classifier,
      desired_dist: dict,
      seed: int | None = None,
  ):
      super().__init__(classifier=classifier, seed=seed)
      self.desired_dist = desired_dist
      self._actual_dist: typing.Counter = collections.Counter()
      self._pivot = None
  
imports: from __future__ import annotations
  import collections
  import random
  import typing
  from river import base, utils
label_desc: Use image node_id 1 to create a new RandomOverSampler object from inherited base classes: ClassificationSampler with example: obj = RandomOverSampler(classifier, desired_dist, seed)