class_docstr: Class representing the base learner of SRPClassifier.
class_docstr_tok: ["Class","representing","the","base","learner","of","SRPClassifier","."]
code: def learn_one(
      self,
      x: dict,
      y: base.typing.RegTarget,
      *,
      w: int,
      n_samples_seen: int,
      **kwargs,
  ):
      all_features = list(x.keys())
      if self.features is not None:
          # Select the subset of features to use
          x_subset = {k: x[k] for k in self.features if k in x}
      else:
          # Use all features
          x_subset = x
  
      # TODO Find a way to verify if the model natively supports sample_weight (w)
      for _ in range(int(w)):
          self.model.learn_one(x=x_subset, y=y, **kwargs)
  
      # Drift detection input
      y_pred = self.model.predict_one(x_subset)
      if self.drift_detection_criteria == "error":
          # Track absolute error
          drift_detector_input = abs(y_pred - y)
      else:  # self.drift_detection_criteria == "prediction"
          # Track predicted target values
          drift_detector_input = y_pred
  
      if self._background_learner:
          # Train the background learner
          # Note: Pass the original instance x so features are correctly
          # selected based on the corresponding subspace
          self._background_learner.learn_one(
              x=x, y=y, w=w, n_samples_seen=n_samples_seen  # type: ignore
          )
  
      if (
          not self.disable_drift_detector
          and not self.is_background_learner
      ):
          # Check for warnings only if the background learner is active
          if not self.disable_background_learner:
              # Update the warning detection method
              self.warning_detector.update(drift_detector_input)
              # Check if there was a change
              if self.warning_detector.drift_detected:
                  self.n_warnings_detected += 1
                  self._trigger_warning(
                      all_features=all_features,
                      n_samples_seen=n_samples_seen,
                  )
  
          # ===== Drift detection =====
          # Update the drift detection method
          self.drift_detector.update(drift_detector_input)
          # Check if the was a change
          if self.drift_detector.drift_detected:
              self.n_drifts_detected += 1
              # There was a change, reset the model
              self.reset(
                  all_features=all_features,
                  n_samples_seen=n_samples_seen,
              )
  
imports: from __future__ import annotations
  import collections
  import itertools
  import math
  import random
  import numpy
  from river import base
  from river.drift import ADWIN
  from river.metrics import MAE, Accuracy
  from river.metrics.base import ClassificationMetric, Metric, RegressionMetric
  from river.tree import HoeffdingTreeClassifier, HoeffdingTreeRegressor
  from river.utils.random import poisson
label_desc: Use image node_id 2 for calling the BaseSRPRegressor obj's underlying member method code with example usage: obj.learn_one(x, y) without return types