class_docstr: Online Non-Negative Matrix Factorization.
  
  `Renbo Zhao et al :"Online Nonnegative Matrix Factorization with Outliers" <https://arxiv.org/abs/1604.02634>`_
class_docstr_tok: ["Online","Non-Negative","Matrix","Factorization",".","`","Renbo","Zhao","et","al",":","''","Online","Nonnegative","Matrix","Factorization","with","Outliers","''","<","https",":","\/\/arxiv.org\/abs\/1604.02634",">","`","_"]
docstr: Parameters
  ----------
  corpus : iterable of list of (int, float) or `csc_matrix` with the shape (n_tokens, n_documents), optional
      Training corpus.
      Can be either iterable of documents, which are lists of `(word_id, word_count)`,
      or a sparse csc matrix of BOWs for each document.
      If not specified, the model is left uninitialized (presumably, to be trained later with `self.train()`).
  num_topics : int, optional
      Number of topics to extract.
  id2word: {dict of (int, str), :class:`gensim.corpora.dictionary.Dictionary`}
      Mapping from word IDs to words. It is used to determine the vocabulary size, as well as for
      debugging and topic printing.
  chunksize: int, optional
      Number of documents to be used in each training chunk.
  passes: int, optional
      Number of full passes over the training corpus.
      Leave at default `passes=1` if your input is an iterator.
  kappa : float, optional
      Gradient descent step size.
      Larger value makes the model train faster, but could lead to non-convergence if set too large.
  minimum_probability:
      If `normalize` is True, topics with smaller probabilities are filtered out.
      If `normalize` is False, topics with smaller factors are filtered out.
      If set to None, a value of 1e-8 is used to prevent 0s.
  w_max_iter: int, optional
      Maximum number of iterations to train W per each batch.
  w_stop_condition: float, optional
      If error difference gets less than that, training of ``W`` stops for the current batch.
  h_max_iter: int, optional
      Maximum number of iterations to train h per each batch.
  h_stop_condition: float
      If error difference gets less than that, training of ``h`` stops for the current batch.
  eval_every: int, optional
      Number of batches after which l2 norm of (v - Wh) is computed. Decreases performance if set too low.
  normalize: bool or None, optional
      Whether to normalize the result. Allows for estimation of perplexity, coherence, e.t.c.
  random_state: {np.random.RandomState, int}, optional
      Seed for random generator. Needed for reproducibility.
docstr_tok: ["Parameters","--","--","--","--","--","corpus",":","iterable","of","list","of","(","int",",","float",")","or","`","csc_matrix","`","with","the","shape","(","n_tokens",",","n_documents",")",",","optional","Training","corpus",".","Can","be","either","iterable","of","documents",",","which","are","lists","of","`","(","word_id",",","word_count",")","`",",","or","a","sparse","csc","matrix","of","BOWs","for","each","document",".","If","not","specified",",","the","model","is","left","uninitialized","(","presumably",",","to","be","trained","later","with","`","self.train","(",")","`",")",".","num_topics",":","int",",","optional","Number","of","topics","to","extract",".","id2word",":","{","dict","of","(","int",",","str",")",",",":","class",":","`","gensim.corpora.dictionary.Dictionary","`","}","Mapping","from","word","IDs","to","words",".","It","is","used","to","determine","the","vocabulary","size",",","as","well","as","for","debugging","and","topic","printing",".","chunksize",":","int",",","optional","Number","of","documents","to","be","used","in","each","training","chunk",".","passes",":","int",",","optional","Number","of","full","passes","over","the","training","corpus",".","Leave","at","default","`","passes=1","`","if","your","input","is","an","iterator",".","kappa",":","float",",","optional","Gradient","descent","step","size",".","Larger","value","makes","the","model","train","faster",",","but","could","lead","to","non-convergence","if","set","too","large",".","minimum_probability",":","If","`","normalize","`","is","True",",","topics","with","smaller","probabilities","are","filtered","out",".","If","`","normalize","`","is","False",",","topics","with","smaller","factors","are","filtered","out",".","If","set","to","None",",","a","value","of","1e-8","is","used","to","prevent","0s",".","w_max_iter",":","int",",","optional","Maximum","number","of","iterations","to","train","W","per","each","batch",".","w_stop_condition",":","float",",","optional","If","error","difference","gets","less","than","that",",","training","of","``","W","``","stops","for","the","current","batch",".","h_max_iter",":","int",",","optional","Maximum","number","of","iterations","to","train","h","per","each","batch",".","h_stop_condition",":","float","If","error","difference","gets","less","than","that",",","training","of","``","h","``","stops","for","the","current","batch",".","eval_every",":","int",",","optional","Number","of","batches","after","which","l2","norm","of","(","v","-","Wh",")","is","computed",".","Decreases","performance","if","set","too","low",".","normalize",":","bool","or","None",",","optional","Whether","to","normalize","the","result",".","Allows","for","estimation","of","perplexity",",","coherence",",","e.t.c",".","random_state",":","{","np.random.RandomState",",","int","}",",","optional","Seed","for","random","generator",".","Needed","for","reproducibility","."]
code: def __init__(
      self,
      corpus=None,
      num_topics=100,
      id2word=None,
      chunksize=2000,
      passes=1,
      kappa=1.0,
      minimum_probability=0.01,
      w_max_iter=200,
      w_stop_condition=1e-4,
      h_max_iter=50,
      h_stop_condition=1e-3,
      eval_every=10,
      normalize=True,
      random_state=None,
  ):
      r"""
  
      Parameters
      ----------
      corpus : iterable of list of (int, float) or `csc_matrix` with the shape (n_tokens, n_documents), optional
          Training corpus.
          Can be either iterable of documents, which are lists of `(word_id, word_count)`,
          or a sparse csc matrix of BOWs for each document.
          If not specified, the model is left uninitialized (presumably, to be trained later with `self.train()`).
      num_topics : int, optional
          Number of topics to extract.
      id2word: {dict of (int, str), :class:`gensim.corpora.dictionary.Dictionary`}
          Mapping from word IDs to words. It is used to determine the vocabulary size, as well as for
          debugging and topic printing.
      chunksize: int, optional
          Number of documents to be used in each training chunk.
      passes: int, optional
          Number of full passes over the training corpus.
          Leave at default `passes=1` if your input is an iterator.
      kappa : float, optional
          Gradient descent step size.
          Larger value makes the model train faster, but could lead to non-convergence if set too large.
      minimum_probability:
          If `normalize` is True, topics with smaller probabilities are filtered out.
          If `normalize` is False, topics with smaller factors are filtered out.
          If set to None, a value of 1e-8 is used to prevent 0s.
      w_max_iter: int, optional
          Maximum number of iterations to train W per each batch.
      w_stop_condition: float, optional
          If error difference gets less than that, training of ``W`` stops for the current batch.
      h_max_iter: int, optional
          Maximum number of iterations to train h per each batch.
      h_stop_condition: float
          If error difference gets less than that, training of ``h`` stops for the current batch.
      eval_every: int, optional
          Number of batches after which l2 norm of (v - Wh) is computed. Decreases performance if set too low.
      normalize: bool or None, optional
          Whether to normalize the result. Allows for estimation of perplexity, coherence, e.t.c.
      random_state: {np.random.RandomState, int}, optional
          Seed for random generator. Needed for reproducibility.
  
      """
      self.num_topics = num_topics
      self.id2word = id2word
      self.chunksize = chunksize
      self.passes = passes
      self._kappa = kappa
      self.minimum_probability = minimum_probability
      self._w_max_iter = w_max_iter
      self._w_stop_condition = w_stop_condition
      self._h_max_iter = h_max_iter
      self._h_stop_condition = h_stop_condition
      self.eval_every = eval_every
      self.normalize = normalize
      self.random_state = utils.get_random_state(random_state)
  
      self.v_max = None
  
      if self.id2word is None:
          self.id2word = utils.dict_from_corpus(corpus)
  
      self.num_tokens = len(self.id2word)
  
      self.A = None
      self.B = None
  
      self._W = None
      self.w_std = None
      self._w_error = np.inf
  
      self._h = None
  
      if corpus is not None:
          self.update(corpus)
  
imports: import collections.abc
  import logging
  import numpy
  import scipy.sparse
  from scipy.stats import halfnorm
  from gensim import interfaces
  from gensim import matutils
  from gensim import utils
  from gensim.interfaces import TransformedCorpus
  from gensim.models import basemodel, CoherenceModel
  from gensim.models.nmf_pgd import solve_h
label_desc: Use image node_id 1 to create a new Nmf object from inherited base classes: interfaces, basemodel with example: obj = Nmf(corpus, num_topics, id2word, chunksize, passes, kappa, minimum_probability, w_max_iter, w_stop_condition, h_max_iter, h_stop_condition, eval_every, normalize, random_state)