class_docstr: Learning Node of the Hoeffding Adaptive Tree regressor.
  
  Parameters
  ----------
  stats
      Initial class observations.
  depth
      The depth of the learning node in the tree.
  splitter
      The numeric attribute observer algorithm used to monitor target statistics
      and perform split attempts.
  drift_detector
      The detector used to monitor concept drifts.
  rng
      Random number generator used in Poisson sampling.
  kwargs
      Other parameters passed to the learning node.
class_docstr_tok: ["Learning","Node","of","the","Hoeffding","Adaptive","Tree","regressor",".","Parameters","--","--","--","--","--","stats","Initial","class","observations",".","depth","The","depth","of","the","learning","node","in","the","tree",".","splitter","The","numeric","attribute","observer","algorithm","used","to","monitor","target","statistics","and","perform","split","attempts",".","drift_detector","The","detector","used","to","monitor","concept","drifts",".","rng","Random","number","generator","used","in","Poisson","sampling",".","kwargs","Other","parameters","passed","to","the","learning","node","."]
code: def learn_one(
      self, x, y, *, w=1.0, tree=None, parent=None, parent_branch=None
  ):
      y_pred = self.prediction(x, tree=tree)
  
      if tree.bootstrap_sampling:
          # Perform bootstrap-sampling
          k = poisson(rate=1, rng=self.rng)
          if k > 0:
              w *= k
  
      drift_input = abs(y - y_pred)
      old_error = self._error_tracker.mean.get()
      # Update the drift detector
      self.drift_detector.update(drift_input)
      self._error_tracker.update(drift_input)
      error_change = self.drift_detector.drift_detected
  
      # Error is decreasing
      if error_change and self._error_tracker.mean.get() < old_error:
          # Reset the error estimator
          self._error_tracker = self._error_tracker.clone()
  
      # Update learning model
      super().learn_one(x, y, w=w, tree=tree)
  
      weight_seen = self.total_weight
  
      if weight_seen - self.last_split_attempt_at >= tree.grace_period:
          if self.depth >= tree.max_depth:
              # Depth-based pre-pruning
              self.deactivate()
              tree._n_inactive_leaves += 1
              tree._n_active_leaves -= 1
          elif self.is_active():
              tree._attempt_to_split(
                  self,
                  parent,
                  parent_branch,
                  drift_detector=tree.drift_detector.clone(),
              )
              self.last_split_attempt_at = weight_seen
  
imports: from __future__ import annotations
  import math
  from river import stats
  from river.utils.random import poisson
  from .branch import DTBranch, NominalBinaryBranch, NominalMultiwayBranch, NumericBinaryBranch, NumericMultiwayBranch
  from .htr_nodes import LeafAdaptive, LeafMean, LeafModel
  from .leaf import HTLeaf
label_desc: Use image node_id 3 for calling the AdaLeafRegressor obj's underlying member method code with example usage: obj.learn_one(x, y) without return types