class_docstr: This predictor selects between the target mean and the the user-selected regression model
   automatically. Faded error metrics are kept for both the predictors, and the most
  accurate one is selected automatically for each incoming instance.
class_docstr_tok: ["This","predictor","selects","between","the","target","mean","and","the","the","user-selected","regression","model","automatically",".","Faded","error","metrics","are","kept","for","both","the","predictors",",","and","the","most","accurate","one","is","selected","automatically","for","each","incoming","instance","."]
code: def learn_one(self, x: dict, y: base.typing.RegTarget, w: int = 1):
      abs_error_mean = abs(y - self.mean_predictor.predict_one(x))  # type: ignore
      abs_error_model = abs(y - self.model_predictor.predict_one(x))  # type: ignore
  
      self._mae_mean = (
          self.fading_factor * self._mae_mean + abs_error_mean
      )
      self._mae_model = (
          self.fading_factor * self._mae_model + abs_error_model
      )
  
      self.mean_predictor.learn_one(x, y, w)
  
      for _ in range(int(w)):
          self.model_predictor.learn_one(x, y)
  
imports: from __future__ import annotations
  import collections
  import functools
  import io
  import math
  import typing
  from river import anomaly, base, drift, linear_model, stats
  from river.tree import split_criterion
  from river.tree import splitter
  from .base import HoeffdingRule
label_desc: Use image node_id 2 for calling the AdaptiveRegressor obj's underlying member method code with example usage: obj.learn_one(x, y, w) without return types