class_docstr: Bandit policy base class.
  
  Parameters
  ----------
  reward_obj
      The reward object used to measure the performance of each arm. This can be a metric, a
      statistic, or a distribution.
  reward_scaler
      A reward scaler used to scale the rewards before they are fed to the reward object. This
      can be useful to scale the rewards to a (0, 1) range for instance.
  burn_in
      The number of steps to use for the burn-in phase. Each arm is given the chance to be pulled
      during the burn-in phase. This is useful to mitigate selection bias.
class_docstr_tok: ["Bandit","policy","base","class",".","Parameters","--","--","--","--","--","reward_obj","The","reward","object","used","to","measure","the","performance","of","each","arm",".","This","can","be","a","metric",",","a","statistic",",","or","a","distribution",".","reward_scaler","A","reward","scaler","used","to","scale","the","rewards","before","they","are","fed","to","the","reward","object",".","This","can","be","useful","to","scale","the","rewards","to","a","(","0",",","1",")","range","for","instance",".","burn_in","The","number","of","steps","to","use","for","the","burn-in","phase",".","Each","arm","is","given","the","chance","to","be","pulled","during","the","burn-in","phase",".","This","is","useful","to","mitigate","selection","bias","."]
code: def __post_init__(self):
      # It's only possible to use a reward scaler if the reward object is updated with univariate
      # reward values, because it manipulates the reward values directly.
      if self._REQUIRES_UNIVARIATE_REWARD or (
          self.reward_scaler
          and not (
              isinstance(self.reward_obj, proba.base.Distribution)
              or isinstance(self.reward_obj, stats.base.Univariate)
          )
      ):
          raise ValueError(
              "The reward object should be a distribution or a univariate statistic if a "
              "reward scaler is used."
          )
  
imports: from __future__ import annotations
  import abc
  import collections
  import typing
  from collections import Counter
  from river import base, compose, metrics, proba, stats, utils
label_desc: Use image node_id 2 for calling the Policy obj's underlying member method code with example usage: obj.__post_init__() without return types