class_docstr: Biased matrix factorization trained with alternating least squares :cite:p:`Zhou2008-bj`.  This
  is a prediction-oriented algorithm suitable for explicit feedback data, using the alternating
  least squares approach to compute :math:`P` and :math:`Q` to minimize the regularized squared
  reconstruction error of the ratings matrix.
  
  It provides two solvers for the optimization step (the `method` parameter):
  
  ``'cd'`` (the default)
      Coordinate descent :cite:p:`Takacs2011-ix`, adapted for a separately-trained bias model and
      to use weighted regularization as in the original ALS paper :cite:p:`Zhou2008-bj`.
  ``'lu'``
      A direct implementation of the original ALS :cite:p:`Zhou2008-bj` using LU-decomposition
      to solve for the optimized matrices.
  
  See the base class :class:`.MFPredictor` for documentation on
  the estimated parameters you can extract from a trained model.
  
  Args:
      features(int): the number of features to train
      iterations(int): the number of iterations to train
      reg(float): the regularization factor; can also be a tuple ``(ureg, ireg)`` to
          specify separate user and item regularization terms.
      damping(float): damping factor for the underlying bias.
      bias(bool or :class:`Bias`): the bias model.  If ``True``, fits a :class:`Bias` with
          damping ``damping``.
      method(str): the solver to use (see above).
      rng_spec:
          Random number generator or state (see :func:`seedbank.numpy_rng`).
      progress: a :func:`tqdm.tqdm`-compatible progress bar function
docstr: Run ALS to train a model, returning each iteration as a generator.
  
  Args:
      ratings: the ratings data frame.
  
  Returns:
      The algorithm (for chaining).
docstr_tok: ["Run","ALS","to","train","a","model",",","returning","each","iteration","as","a","generator",".","Args",":","ratings",":","the","ratings","data","frame",".","Returns",":","The","algorithm","(","for","chaining",")","."]
code: def fit_iters(self, ratings, **kwargs):
      """
      Run ALS to train a model, returning each iteration as a generator.
  
      Args:
          ratings: the ratings data frame.
  
      Returns:
          The algorithm (for chaining).
      """
  
      if self.bias:
          _logger.info("[%s] fitting bias model", self.timer)
          self.bias.fit(ratings)
  
      current, uctx, ictx = self._initial_model(ratings)
  
      _logger.info(
          "[%s] training biased MF model with ALS for %d features",
          self.timer,
          self.features,
      )
      for epoch, model in enumerate(
          self._train_iters(current, uctx, ictx)
      ):
          self._save_params(model)
          yield self
  
imports: import logging
  from collections import namedtuple
  import numpy
  from numba import njit, prange
  from csr import CSR
  from seedbank import numpy_rng
  from .bias import Bias
  from .mf_common import MFPredictor
  from ..data import sparse_ratings
  from ..None import util
  from ..math.solve import _dposv
label_desc: Use image node_id 3 for calling the BiasedMF obj's underlying member method code with example usage: obj.fit_iters(ratings) without return types