class_docstr: Adaptive Random Forest regressor.
  
  The 3 most important aspects of Adaptive Random Forest [^1] are:
  
  1. inducing diversity through re-sampling
  
  2. inducing diversity through randomly selecting subsets of features for
     node splits
  
  3. drift detectors per base tree, which cause selective resets in response
     to drifts
  
  Notice that this implementation is slightly different from the original
  algorithm proposed in [^2]. The `HoeffdingTreeRegressor` is used as base
  learner, instead of `FIMT-DD`. It also adds a new strategy to monitor the
  predictions and check for concept drifts. The deviations of the predictions
  to the target are monitored and normalized in the [0, 1] range to fulfill ADWIN's
  requirements. We assume that the data subjected to the normalization follows
  a normal distribution, and thus, lies within the interval of the mean $\pm3\sigma$.
  
  Parameters
  ----------
  n_models
      Number of trees in the ensemble.
  max_features
      Max number of attributes for each node split.<br/>
      - If `int`, then consider `max_features` at each split.<br/>
      - If `float`, then `max_features` is a percentage and
        `int(max_features * n_features)` features are considered per split.<br/>
      - If "sqrt", then `max_features=sqrt(n_features)`.<br/>
      - If "log2", then `max_features=log2(n_features)`.<br/>
      - If None, then ``max_features=n_features``.
  lambda_value
      The lambda value for bagging (lambda=6 corresponds to Leveraging Bagging).
  metric
      Metric used to track trees performance within the ensemble. Depending,
      on the configuration, this metric is also used to weight predictions
      from the members of the ensemble. Defaults to `metrics.MSE()`.
  aggregation_method
      The method to use to aggregate predictions in the ensemble.<br/>
      - 'mean'<br/>
      - 'median' - If selected will disable the weighted vote.
  disable_weighted_vote
      If `True`, disables the weighted vote prediction, i.e. does not assign
      weights to individual tree's predictions and uses the arithmetic mean
      instead. Otherwise will use the `metric` value to weight predictions.
  drift_detector
      Drift Detection method. Set to None to disable Drift detection.
      Defaults to `drift.ADWIN(0.001)`.
  warning_detector
      Warning Detection method. Set to None to disable warning detection.
      Defaults to `drift.ADWIN(0.01)`.
  grace_period
      [*Tree parameter*] Number of instances a leaf should observe between
      split attempts.
  max_depth
      [*Tree parameter*] The maximum depth a tree can reach. If `None`, the
      tree will grow indefinitely.
  delta
      [*Tree parameter*] Allowed error in split decision, a value closer to 0
      takes longer to decide.
  tau
      [*Tree parameter*] Threshold below which a split will be forced to break
      ties.
  leaf_prediction
      [*Tree parameter*] Prediction mechanism used at leaves.</br>
      - 'mean' - Target mean</br>
      - 'model' - Uses the model defined in `leaf_model`</br>
      - 'adaptive' - Chooses between 'mean' and 'model' dynamically</br>
  leaf_model
      [*Tree parameter*] The regression model used to provide responses if
      `leaf_prediction='model'`. If not provided, an instance of
      `river.linear_model.LinearRegression` with the default hyperparameters
       is used.
  model_selector_decay
      [*Tree parameter*] The exponential decaying factor applied to the learning models'
      squared errors, that are monitored if `leaf_prediction='adaptive'`. Must be
      between `0` and `1`. The closer to `1`, the more importance is going to
      be given to past observations. On the other hand, if its value
      approaches `0`, the recent observed errors are going to have more
      influence on the final decision.
  nominal_attributes
      [*Tree parameter*] List of Nominal attributes. If empty, then assume that
      all attributes are numerical.
  splitter
      [*Tree parameter*] The Splitter or Attribute Observer (AO) used to monitor the class
      statistics of numeric features and perform splits. Splitters are available in the
      `tree.splitter` module. Different splitters are available for classification and
      regression tasks. Classification and regression splitters can be distinguished by their
      property `is_target_class`. This is an advanced option. Special care must be taken when
      choosing different splitters.By default, `tree.splitter.EBSTSplitter` is used if
      `splitter` is `None`.
  min_samples_split
      [*Tree parameter*] The minimum number of samples every branch resulting from a split
      candidate must have to be considered valid.
  binary_split
      [*Tree parameter*] If True, only allow binary splits.
  max_size
      [*Tree parameter*] Maximum memory (MB) consumed by the tree.
  memory_estimate_period
      [*Tree parameter*] Number of instances between memory consumption checks.
  stop_mem_management
      [*Tree parameter*] If True, stop growing as soon as memory limit is hit.
  remove_poor_attrs
      [*Tree parameter*] If True, disable poor attributes to reduce memory usage.
  merit_preprune
      [*Tree parameter*] If True, enable merit-based tree pre-pruning.
  seed
      Random seed for reproducibility.
  
  References
  ----------
  [^1]: Gomes, H.M., Bifet, A., Read, J., Barddal, J.P., Enembreck, F.,
        Pfharinger, B., Holmes, G. and Abdessalem, T., 2017. Adaptive random
        forests for evolving data stream classification. Machine Learning,
        106(9-10), pp.1469-1495.
  
  [^2]: Gomes, H.M., Barddal, J.P., Boiko, L.E., Bifet, A., 2018.
        Adaptive random forests for data stream regression. ESANN 2018.
  
  Examples
  --------
  
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import forest
  >>> from river import metrics
  >>> from river import preprocessing
  
  >>> dataset = datasets.TrumpApproval()
  
  >>> model = (
  ...     preprocessing.StandardScaler() |
  ...     forest.ARFRegressor(seed=42)
  ... )
  
  >>> metric = metrics.MAE()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  MAE: 0.788619
class_docstr_tok: ["Adaptive","Random","Forest","regressor",".","The","3","most","important","aspects","of","Adaptive","Random","Forest","[","^1","]","are",":","1.","inducing","diversity","through","re-sampling","2.","inducing","diversity","through","randomly","selecting","subsets","of","features","for","node","splits","3.","drift","detectors","per","base","tree",",","which","cause","selective","resets","in","response","to","drifts","Notice","that","this","implementation","is","slightly","different","from","the","original","algorithm","proposed","in","[","^2","]",".","The","`","HoeffdingTreeRegressor","`","is","used","as","base","learner",",","instead","of","`","FIMT-DD","`",".","It","also","adds","a","new","strategy","to","monitor","the","predictions","and","check","for","concept","drifts",".","The","deviations","of","the","predictions","to","the","target","are","monitored","and","normalized","in","the","[","0",",","1","]","range","to","fulfill","ADWIN's","requirements",".","We","assume","that","the","data","subjected","to","the","normalization","follows","a","normal","distribution",",","and","thus",",","lies","within","the","interval","of","the","mean","$","\\pm3\\sigma","$",".","Parameters","--","--","--","--","--","n_models","Number","of","trees","in","the","ensemble",".","max_features","Max","number","of","attributes","for","each","node","split.","<","br\/",">","-","If","`","int","`",",","then","consider","`","max_features","`","at","each","split.","<","br\/",">","-","If","`","float","`",",","then","`","max_features","`","is","a","percentage","and","`","int","(","max_features","*","n_features",")","`","features","are","considered","per","split.","<","br\/",">","-","If","``","sqrt","''",",","then","`","max_features=sqrt","(","n_features",")","`",".","<","br\/",">","-","If","``","log2","''",",","then","`","max_features=log2","(","n_features",")","`",".","<","br\/",">","-","If","None",",","then","``","max_features=n_features","``",".","lambda_value","The","lambda","value","for","bagging","(","lambda=6","corresponds","to","Leveraging","Bagging",")",".","metric","Metric","used","to","track","trees","performance","within","the","ensemble",".","Depending",",","on","the","configuration",",","this","metric","is","also","used","to","weight","predictions","from","the","members","of","the","ensemble",".","Defaults","to","`","metrics.MSE","(",")","`",".","aggregation_method","The","method","to","use","to","aggregate","predictions","in","the","ensemble.","<","br\/",">","-","'mean","'","<","br\/",">","-","'median","'","-","If","selected","will","disable","the","weighted","vote",".","disable_weighted_vote","If","`","True","`",",","disables","the","weighted","vote","prediction",",","i.e",".","does","not","assign","weights","to","individual","tree","'s","predictions","and","uses","the","arithmetic","mean","instead",".","Otherwise","will","use","the","`","metric","`","value","to","weight","predictions",".","drift_detector","Drift","Detection","method",".","Set","to","None","to","disable","Drift","detection",".","Defaults","to","`","drift.ADWIN","(","0.001",")","`",".","warning_detector","Warning","Detection","method",".","Set","to","None","to","disable","warning","detection",".","Defaults","to","`","drift.ADWIN","(","0.01",")","`",".","grace_period","[","*","Tree","parameter","*","]","Number","of","instances","a","leaf","should","observe","between","split","attempts",".","max_depth","[","*","Tree","parameter","*","]","The","maximum","depth","a","tree","can","reach",".","If","`","None","`",",","the","tree","will","grow","indefinitely",".","delta","[","*","Tree","parameter","*","]","Allowed","error","in","split","decision",",","a","value","closer","to","0","takes","longer","to","decide",".","tau","[","*","Tree","parameter","*","]","Threshold","below","which","a","split","will","be","forced","to","break","ties",".","leaf_prediction","[","*","Tree","parameter","*","]","Prediction","mechanism","used","at","leaves.","<","\/br",">","-","'mean","'","-","Target","mean","<","\/br",">","-","'model","'","-","Uses","the","model","defined","in","`","leaf_model","`","<","\/br",">","-","'adaptive","'","-","Chooses","between","'mean","'","and","'model","'","dynamically","<","\/br",">","leaf_model","[","*","Tree","parameter","*","]","The","regression","model","used","to","provide","responses","if","`","leaf_prediction='model","'","`",".","If","not","provided",",","an","instance","of","`","river.linear_model.LinearRegression","`","with","the","default","hyperparameters","is","used",".","model_selector_decay","[","*","Tree","parameter","*","]","The","exponential","decaying","factor","applied","to","the","learning","models'","squared","errors",",","that","are","monitored","if","`","leaf_prediction='adaptive","'","`",".","Must","be","between","`","0","`","and","`","1","`",".","The","closer","to","`","1","`",",","the","more","importance","is","going","to","be","given","to","past","observations",".","On","the","other","hand",",","if","its","value","approaches","`","0","`",",","the","recent","observed","errors","are","going","to","have","more","influence","on","the","final","decision",".","nominal_attributes","[","*","Tree","parameter","*","]","List","of","Nominal","attributes",".","If","empty",",","then","assume","that","all","attributes","are","numerical",".","splitter","[","*","Tree","parameter","*","]","The","Splitter","or","Attribute","Observer","(","AO",")","used","to","monitor","the","class","statistics","of","numeric","features","and","perform","splits",".","Splitters","are","available","in","the","`","tree.splitter","`","module",".","Different","splitters","are","available","for","classification","and","regression","tasks",".","Classification","and","regression","splitters","can","be","distinguished","by","their","property","`","is_target_class","`",".","This","is","an","advanced","option",".","Special","care","must","be","taken","when","choosing","different","splitters.By","default",",","`","tree.splitter.EBSTSplitter","`","is","used","if","`","splitter","`","is","`","None","`",".","min_samples_split","[","*","Tree","parameter","*","]","The","minimum","number","of","samples","every","branch","resulting","from","a","split","candidate","must","have","to","be","considered","valid",".","binary_split","[","*","Tree","parameter","*","]","If","True",",","only","allow","binary","splits",".","max_size","[","*","Tree","parameter","*","]","Maximum","memory","(","MB",")","consumed","by","the","tree",".","memory_estimate_period","[","*","Tree","parameter","*","]","Number","of","instances","between","memory","consumption","checks",".","stop_mem_management","[","*","Tree","parameter","*","]","If","True",",","stop","growing","as","soon","as","memory","limit","is","hit",".","remove_poor_attrs","[","*","Tree","parameter","*","]","If","True",",","disable","poor","attributes","to","reduce","memory","usage",".","merit_preprune","[","*","Tree","parameter","*","]","If","True",",","enable","merit-based","tree","pre-pruning",".","seed","Random","seed","for","reproducibility",".","References","--","--","--","--","--","[","^1","]",":","Gomes",",","H.M.",",","Bifet",",","A.",",","Read",",","J.",",","Barddal",",","J.P.",",","Enembreck",",","F.",",","Pfharinger",",","B.",",","Holmes",",","G.","and","Abdessalem",",","T.",",","2017",".","Adaptive","random","forests","for","evolving","data","stream","classification",".","Machine","Learning",",","106","(","9-10",")",",","pp.1469-1495",".","[","^2","]",":","Gomes",",","H.M.",",","Barddal",",","J.P.",",","Boiko",",","L.E.",",","Bifet",",","A.",",","2018",".","Adaptive","random","forests","for","data","stream","regression",".","ESANN","2018",".","Examples","--","--","--","--",">",">",">","from","river","import","datasets",">",">",">","from","river","import","evaluate",">",">",">","from","river","import","forest",">",">",">","from","river","import","metrics",">",">",">","from","river","import","preprocessing",">",">",">","dataset","=","datasets.TrumpApproval","(",")",">",">",">","model","=","(","...","preprocessing.StandardScaler","(",")","|","...","forest.ARFRegressor","(","seed=42",")","...",")",">",">",">","metric","=","metrics.MAE","(",")",">",">",">","evaluate.progressive_val_score","(","dataset",",","model",",","metric",")","MAE",":","0.788619"]
code: def _new_base_model(self):
      return BaseTreeRegressor(
          max_features=self.max_features,
          grace_period=self.grace_period,
          max_depth=self.max_depth,
          delta=self.delta,
          tau=self.tau,
          leaf_prediction=self.leaf_prediction,
          leaf_model=self.leaf_model,
          model_selector_decay=self.model_selector_decay,
          nominal_attributes=self.nominal_attributes,
          splitter=self.splitter,
          binary_split=self.binary_split,
          max_size=self.max_size,
          memory_estimate_period=self.memory_estimate_period,
          stop_mem_management=self.stop_mem_management,
          remove_poor_attrs=self.remove_poor_attrs,
          merit_preprune=self.merit_preprune,
          rng=self._rng,
      )
  
imports: from __future__ import annotations
  import abc
  import collections
  import copy
  import math
  import random
  import typing
  import numpy
  from river import base, metrics, stats
  from river.drift import ADWIN, NoDrift
  from river.tree.hoeffding_tree_classifier import HoeffdingTreeClassifier
  from river.tree.hoeffding_tree_regressor import HoeffdingTreeRegressor
  from river.tree.nodes.arf_htc_nodes import RandomLeafMajorityClass, RandomLeafNaiveBayes, RandomLeafNaiveBayesAdaptive
  from river.tree.nodes.arf_htr_nodes import RandomLeafAdaptive, RandomLeafMean, RandomLeafModel
  from river.tree.splitter import Splitter
  from river.utils.random import poisson
label_desc: Use image node_id 4 for calling the ARFRegressor obj's underlying member method code with example usage: obj._new_base_model() and returns: BaseTreeRegressor