class_docstr: Bandit-based model selection for classification.
  
  Each model is associated with an arm. At each `learn_one` call, the policy decides which
  arm/model to pull. The reward is the performance of the model on the provided sample. The
  `predict_one` and `predict_proba_one` methods use the current best model.
  
  Parameters
  ----------
  models
      The models to select from.
  metric
      The metric that is used to measure the performance of each model.
  policy
      The bandit policy to use.
  
  Examples
  --------
  
  >>> from river import bandit
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import linear_model
  >>> from river import metrics
  >>> from river import model_selection
  >>> from river import optim
  >>> from river import preprocessing
  
  >>> models = [
  ...     linear_model.LogisticRegression(optimizer=optim.SGD(lr=lr))
  ...     for lr in [0.0001, 0.001, 1e-05, 0.01]
  ... ]
  
  >>> dataset = datasets.Phishing()
  >>> model = (
  ...     preprocessing.StandardScaler() |
  ...     model_selection.BanditClassifier(
  ...         models,
  ...         metric=metrics.Accuracy(),
  ...         policy=bandit.EpsilonGreedy(
  ...             epsilon=0.1,
  ...             decay=0.001,
  ...             burn_in=20,
  ...             seed=42
  ...         )
  ...     )
  ... )
  >>> metric = metrics.Accuracy()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  Accuracy: 88.96%
class_docstr_tok: ["Bandit-based","model","selection","for","classification",".","Each","model","is","associated","with","an","arm",".","At","each","`","learn_one","`","call",",","the","policy","decides","which","arm\/model","to","pull",".","The","reward","is","the","performance","of","the","model","on","the","provided","sample",".","The","`","predict_one","`","and","`","predict_proba_one","`","methods","use","the","current","best","model",".","Parameters","--","--","--","--","--","models","The","models","to","select","from",".","metric","The","metric","that","is","used","to","measure","the","performance","of","each","model",".","policy","The","bandit","policy","to","use",".","Examples","--","--","--","--",">",">",">","from","river","import","bandit",">",">",">","from","river","import","datasets",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","linear_model",">",">",">","from","river","import","metrics",">",">",">","from","river","import","model_selection",">",">",">","from","river","import","optim",">",">",">","from","river","import","preprocessing",">",">",">","models","=","[","...","linear_model.LogisticRegression","(","optimizer=optim.SGD","(","lr=lr",")",")","...","for","lr","in","[","0.0001",",","0.001",",","1e-05",",","0.01","]","...","]",">",">",">","dataset","=","datasets.Phishing","(",")",">",">",">","model","=","(","...","preprocessing.StandardScaler","(",")","|","...","model_selection.BanditClassifier","(","...","models",",","...","metric=metrics.Accuracy","(",")",",","...","policy=bandit.EpsilonGreedy","(","...","epsilon=0.1",",","...","decay=0.001",",","...","burn_in=20",",","...","seed=42","...",")","...",")","...",")",">",">",">","metric","=","metrics.Accuracy","(",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metric",")","Accuracy",":","88.96","%"]
code: def __init__(
      self,
      models,
      metric: metrics.base.ClassificationMetric,
      policy: bandit.base.Policy,
  ):
      super().__init__(models, metric)
      self.policy = policy.clone({"reward_obj": self.metric})
  
file_path: river/river/model_selection/bandit.py
imports: from __future__ import annotations
  from river import bandit, metrics, model_selection
label_desc: Use image node_id 1 to create a new BanditClassifier object from inherited base classes: BanditModelSection, model_selection.base with example: obj = BanditClassifier(models, metric, policy)