class_docstr: Scales data using exponentially weighted moving average and variance.
  
  Under the hood, a exponentially weighted running mean and variance are maintained for each
  feature. This can potentially provide better results for drifting data in comparison to
  `preprocessing.StandardScaler`. Indeed, the latter computes a global mean and variance for each
  feature, whereas this scaler weights data in proportion to their recency.
  
  Parameters
  ----------
  fading_factor
      This parameter is passed to `stats.EWVar`. It is expected to be in [0, 1]. More weight is
      assigned to recent samples the closer `fading_factor` is to 1.
  
  Examples
  --------
  
  Consider the following series which contains a positive trend.
  
  >>> import random
  
  >>> random.seed(42)
  >>> X = [
  ...     {'x': random.uniform(4 + i, 6 + i)}
  ...     for i in range(8)
  ... ]
  >>> for x in X:
  ...     print(x)
  {'x': 5.278}
  {'x': 5.050}
  {'x': 6.550}
  {'x': 7.446}
  {'x': 9.472}
  {'x': 10.353}
  {'x': 11.784}
  {'x': 11.173}
  
  This scaler works well with this kind of data because it uses statistics that assign higher
  weight to more recent data.
  
  >>> from river import preprocessing
  
  >>> scaler = preprocessing.AdaptiveStandardScaler(fading_factor=.6)
  
  >>> for x in X:
  ...     scaler.learn_one(x)
  ...     print(scaler.transform_one(x))
  {'x': 0.0}
  {'x': -0.816}
  {'x': 0.812}
  {'x': 0.695}
  {'x': 0.754}
  {'x': 0.598}
  {'x': 0.651}
  {'x': 0.124}
class_docstr_tok: ["Scales","data","using","exponentially","weighted","moving","average","and","variance",".","Under","the","hood",",","a","exponentially","weighted","running","mean","and","variance","are","maintained","for","each","feature",".","This","can","potentially","provide","better","results","for","drifting","data","in","comparison","to","`","preprocessing.StandardScaler","`",".","Indeed",",","the","latter","computes","a","global","mean","and","variance","for","each","feature",",","whereas","this","scaler","weights","data","in","proportion","to","their","recency",".","Parameters","--","--","--","--","--","fading_factor","This","parameter","is","passed","to","`","stats.EWVar","`",".","It","is","expected","to","be","in","[","0",",","1","]",".","More","weight","is","assigned","to","recent","samples","the","closer","`","fading_factor","`","is","to","1",".","Examples","--","--","--","--","Consider","the","following","series","which","contains","a","positive","trend",".",">",">",">","import","random",">",">",">","random.seed","(","42",")",">",">",">","X","=","[","...","{","'","x","'",":","random.uniform","(","4","+","i",",","6","+","i",")","}","...","for","i","in","range","(","8",")","...","]",">",">",">","for","x","in","X",":","...","print","(","x",")","{","'","x","'",":","5.278","}","{","'","x","'",":","5.050","}","{","'","x","'",":","6.550","}","{","'","x","'",":","7.446","}","{","'","x","'",":","9.472","}","{","'","x","'",":","10.353","}","{","'","x","'",":","11.784","}","{","'","x","'",":","11.173","}","This","scaler","works","well","with","this","kind","of","data","because","it","uses","statistics","that","assign","higher","weight","to","more","recent","data",".",">",">",">","from","river","import","preprocessing",">",">",">","scaler","=","preprocessing.AdaptiveStandardScaler","(","fading_factor=.6",")",">",">",">","for","x","in","X",":","...","scaler.learn_one","(","x",")","...","print","(","scaler.transform_one","(","x",")",")","{","'","x","'",":","0.0","}","{","'","x","'",":","-0.816","}","{","'","x","'",":","0.812","}","{","'","x","'",":","0.695","}","{","'","x","'",":","0.754","}","{","'","x","'",":","0.598","}","{","'","x","'",":","0.651","}","{","'","x","'",":","0.124","}"]
code: def learn_one(self, x):
      for i, xi in x.items():
          self.vars[i].update(xi)
          self.means[i].update(xi)
  
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import numbers
  import numpy
  import pandas
  from river import base, stats, utils
label_desc: Use image node_id 2 for calling the AdaptiveStandardScaler obj's underlying member method code with example usage: obj.learn_one(x) without return types