class_docstr: Approximate Large Margin Algorithm (ALMA).
  
  Parameters
  ----------
  p
  alpha
  B
  C
  
  Attributes
  ----------
  w : collections.defaultdict
      The current weights.
  k : int
      The number of instances seen during training.
  
  Examples
  --------
  
  >>> from river import datasets
  >>> from river import evaluate
  >>> from river import linear_model
  >>> from river import metrics
  >>> from river import preprocessing
  
  >>> dataset = datasets.Phishing()
  
  >>> model = (
  ...     preprocessing.StandardScaler() |
  ...     linear_model.ALMAClassifier()
  ... )
  
  >>> metric = metrics.Accuracy()
  
  >>> evaluate.progressive_val_score(dataset, model, metric)
  Accuracy: 82.56%
  
  References
  ----------
  [^1]: [Gentile, Claudio. "A new approximate maximal margin classification algorithm." Journal of Machine Learning Research 2.Dec (2001): 213-242](http://www.jmlr.org/papers/volume2/gentile01a/gentile01a.pdf)
code: def learn_one(self, x, y):
      # Convert 0 to -1
      y = int(y or -1)
  
      gamma = self.B * math.sqrt(self.p - 1) / math.sqrt(self.k)
  
      if y * self._raw_dot(x) < (1 - self.alpha) * gamma:
          eta = self.C / (math.sqrt(self.p - 1) * math.sqrt(self.k))
  
          for i, xi in x.items():
              self.w[i] += eta * y * xi
  
          norm = utils.math.norm(self.w, order=self.p)
  
          for i in x:
              self.w[i] /= max(1, norm)
  
          self.k += 1
  
file_path: river/river/linear_model/alma.py
imports: from __future__ import annotations
  import collections
  import math
  from river import base, utils
label_desc: Use image node_id 4 for calling the ALMAClassifier obj's underlying member method code with example usage: obj.learn_one(x, y) without return types