class_docstr: Low dimensional projection of a term-document matrix.
  
  This is the class taking care of the 'core math': interfacing with corpora, splitting large corpora into chunks
  and merging them etc. This done through the higher-level :class:`~gensim.models.lsimodel.LsiModel` class.
  
  Notes
  -----
  The projection can be later updated by merging it with another :class:`~gensim.models.lsimodel.Projection`
  via  :meth:`~gensim.models.lsimodel.Projection.merge`. This is how incremental training actually happens.
class_docstr_tok: ["Low","dimensional","projection","of","a","term-document","matrix",".","This","is","the","class","taking","care","of","the","'core","math","'",":","interfacing","with","corpora",",","splitting","large","corpora","into","chunks","and","merging","them","etc",".","This","done","through","the","higher-level",":","class",":","`","~gensim.models.lsimodel.LsiModel","`","class",".","Notes","--","--","-","The","projection","can","be","later","updated","by","merging","it","with","another",":","class",":","`","~gensim.models.lsimodel.Projection","`","via",":","meth",":","`","~gensim.models.lsimodel.Projection.merge","`",".","This","is","how","incremental","training","actually","happens","."]
docstr: Construct the (U, S) projection from a corpus.
  
  Parameters
  ----------
  m : int
      Number of features (terms) in the corpus.
  k : int
      Desired rank of the decomposed matrix.
  docs : {iterable of list of (int, float), scipy.sparse.csc}
      Corpus in BoW format or as sparse matrix.
  use_svdlibc : bool, optional
      If True - will use `sparsesvd library <https://pypi.org/project/sparsesvd/>`_,
      otherwise - our own version will be used.
  power_iters: int, optional
      Number of power iteration steps to be used. Tune to improve accuracy.
  extra_dims : int, optional
      Extra samples to be used besides the rank `k`. Tune to improve accuracy.
  dtype : numpy.dtype, optional
      Enforces a type for elements of the decomposed matrix.
  random_seed: {None, int}, optional
      Random seed used to initialize the pseudo-random number generator,
      a local instance of numpy.random.RandomState instance.
docstr_tok: ["Construct","the","(","U",",","S",")","projection","from","a","corpus",".","Parameters","--","--","--","--","--","m",":","int","Number","of","features","(","terms",")","in","the","corpus",".","k",":","int","Desired","rank","of","the","decomposed","matrix",".","docs",":","{","iterable","of","list","of","(","int",",","float",")",",","scipy.sparse.csc","}","Corpus","in","BoW","format","or","as","sparse","matrix",".","use_svdlibc",":","bool",",","optional","If","True","-","will","use","`","sparsesvd","library","<","https",":","\/\/pypi.org\/project\/sparsesvd\/",">","`","_",",","otherwise","-","our","own","version","will","be","used",".","power_iters",":","int",",","optional","Number","of","power","iteration","steps","to","be","used",".","Tune","to","improve","accuracy",".","extra_dims",":","int",",","optional","Extra","samples","to","be","used","besides","the","rank","`","k","`",".","Tune","to","improve","accuracy",".","dtype",":","numpy.dtype",",","optional","Enforces","a","type","for","elements","of","the","decomposed","matrix",".","random_seed",":","{","None",",","int","}",",","optional","Random","seed","used","to","initialize","the","pseudo-random","number","generator",",","a","local","instance","of","numpy.random.RandomState","instance","."]
code: def __init__(
      self,
      m,
      k,
      docs=None,
      use_svdlibc=False,
      power_iters=P2_EXTRA_ITERS,
      extra_dims=P2_EXTRA_DIMS,
      dtype=np.float64,
      random_seed=None,
  ):
      """Construct the (U, S) projection from a corpus.
  
      Parameters
      ----------
      m : int
          Number of features (terms) in the corpus.
      k : int
          Desired rank of the decomposed matrix.
      docs : {iterable of list of (int, float), scipy.sparse.csc}
          Corpus in BoW format or as sparse matrix.
      use_svdlibc : bool, optional
          If True - will use `sparsesvd library <https://pypi.org/project/sparsesvd/>`_,
          otherwise - our own version will be used.
      power_iters: int, optional
          Number of power iteration steps to be used. Tune to improve accuracy.
      extra_dims : int, optional
          Extra samples to be used besides the rank `k`. Tune to improve accuracy.
      dtype : numpy.dtype, optional
          Enforces a type for elements of the decomposed matrix.
      random_seed: {None, int}, optional
          Random seed used to initialize the pseudo-random number generator,
          a local instance of numpy.random.RandomState instance.
  
      """
      self.m, self.k = m, k
      self.power_iters = power_iters
      self.extra_dims = extra_dims
      self.random_seed = random_seed
      if docs is not None:
          # base case decomposition: given a job `docs`, compute its decomposition,
          # *in-core*.
          if not use_svdlibc:
              u, s = stochastic_svd(
                  docs,
                  k,
                  chunksize=sys.maxsize,
                  num_terms=m,
                  power_iters=self.power_iters,
                  extra_dims=self.extra_dims,
                  dtype=dtype,
                  random_seed=self.random_seed,
              )
          else:
              try:
                  import sparsesvd
              except ImportError:
                  raise ImportError(
                      "`sparsesvd` module requested but not found; run `easy_install sparsesvd`"
                  )
              logger.info(
                  "computing sparse SVD of %s matrix", str(docs.shape)
              )
              if not scipy.sparse.issparse(docs):
                  docs = matutils.corpus2csc(docs)
              # ask for extra factors, because for some reason SVDLIBC sometimes returns fewer factors than requested
              ut, s, vt = sparsesvd.sparsesvd(docs, k + 30)
              u = ut.T
              del ut, vt
              k = clip_spectrum(s**2, self.k)
          self.u = u[:, :k].copy()
          self.s = s[:k].copy()
      else:
          self.u, self.s = None, None
  
imports: import logging
  import sys
  import time
  import numpy
  import scipy.linalg
  import scipy.sparse
  from scipy.sparse import sparsetools
  from gensim import interfaces, matutils, utils
  from gensim.models import basemodel
  from gensim.utils import is_empty
label_desc: Use image node_id 1 to create a new Projection object from inherited base classes: utils with example: obj = Projection(m, k, docs, use_svdlibc, power_iters, extra_dims, dtype, random_seed)