class_docstr: Latent Dirichlet Allocation with online variational Bayes algorithm
  
  .. versionadded:: 0.17
  
  Read more in the :ref:`User Guide <LatentDirichletAllocation>`.
  
  Parameters
  ----------
  n_topics : int, optional (default=10)
      Number of topics.
  
  doc_topic_prior : float, optional (default=None)
      Prior of document topic distribution `theta`. If the value is None,
      defaults to `1 / n_topics`.
      In the literature, this is called `alpha`.
  
  topic_word_prior : float, optional (default=None)
      Prior of topic word distribution `beta`. If the value is None, defaults
      to `1 / n_topics`.
      In the literature, this is called `eta`.
  
  learning_method : 'batch' | 'online', default='online'
      Method used to update `_component`. Only used in `fit` method.
      In general, if the data size is large, the online update will be much
      faster than the batch update.
      The default learning method is going to be changed to 'batch' in the 0.20 release.
      Valid options::
  
          'batch': Batch variational Bayes method. Use all training data in
              each EM update.
              Old `components_` will be overwritten in each iteration.
          'online': Online variational Bayes method. In each EM update, use
              mini-batch of training data to update the ``components_``
              variable incrementally. The learning rate is controlled by the
              ``learning_decay`` and the ``learning_offset`` parameters.
  
  learning_decay : float, optional (default=0.7)
      It is a parameter that control learning rate in the online learning
      method. The value should be set between (0.5, 1.0] to guarantee
      asymptotic convergence. When the value is 0.0 and batch_size is
      ``n_samples``, the update method is same as batch learning. In the
      literature, this is called kappa.
  
  learning_offset : float, optional (default=10.)
      A (positive) parameter that downweights early iterations in online
      learning.  It should be greater than 1.0. In the literature, this is
      called tau_0.
  
  max_iter : integer, optional (default=10)
      The maximum number of iterations.
  
  total_samples : int, optional (default=1e6)
      Total number of documents. Only used in the `partial_fit` method.
  
  batch_size : int, optional (default=128)
      Number of documents to use in each EM iteration. Only used in online
      learning.
  
  evaluate_every : int optional (default=0)
      How often to evaluate perplexity. Only used in `fit` method.
      set it to 0 or negative number to not evalute perplexity in
      training at all. Evaluating perplexity can help you check convergence
      in training process, but it will also increase total training time.
      Evaluating perplexity in every iteration might increase training time
      up to two-fold.
  
  perp_tol : float, optional (default=1e-1)
      Perplexity tolerance in batch learning. Only used when
      ``evaluate_every`` is greater than 0.
  
  mean_change_tol : float, optional (default=1e-3)
      Stopping tolerance for updating document topic distribution in E-step.
  
  max_doc_update_iter : int (default=100)
      Max number of iterations for updating document topic distribution in
      the E-step.
  
  n_jobs : int, optional (default=1)
      The number of jobs to use in the E-step. If -1, all CPUs are used. For
      ``n_jobs`` below -1, (n_cpus + 1 + n_jobs) are used.
  
  verbose : int, optional (default=0)
      Verbosity level.
  
  random_state : int or RandomState instance or None, optional (default=None)
      Pseudo-random number generator seed control.
  
  Attributes
  ----------
  components_ : array, [n_topics, n_features]
      Topic word distribution. ``components_[i, j]`` represents word j in
      topic `i`.
  
  n_batch_iter_ : int
      Number of iterations of the EM step.
  
  n_iter_ : int
      Number of passes over the dataset.
  
  References
  ----------
  [1] "Online Learning for Latent Dirichlet Allocation", Matthew D. Hoffman,
      David M. Blei, Francis Bach, 2010
  
  [2] "Stochastic Variational Inference", Matthew D. Hoffman, David M. Blei,
      Chong Wang, John Paisley, 2013
  
  [3] Matthew D. Hoffman's onlineldavb code. Link:
      http://matthewdhoffman.com//code/onlineldavb.tar
class_docstr_tok: ["Latent","Dirichlet","Allocation","with","online","variational","Bayes","algorithm","..","versionadded",":",":","0.17","Read","more","in","the",":","ref",":","`","User","Guide","<","LatentDirichletAllocation",">","`",".","Parameters","--","--","--","--","--","n_topics",":","int",",","optional","(","default=10",")","Number","of","topics",".","doc_topic_prior",":","float",",","optional","(","default=None",")","Prior","of","document","topic","distribution","`","theta","`",".","If","the","value","is","None",",","defaults","to","`","1","\/","n_topics","`",".","In","the","literature",",","this","is","called","`","alpha","`",".","topic_word_prior",":","float",",","optional","(","default=None",")","Prior","of","topic","word","distribution","`","beta","`",".","If","the","value","is","None",",","defaults","to","`","1","\/","n_topics","`",".","In","the","literature",",","this","is","called","`","eta","`",".","learning_method",":","'batch","'","|","'online","'",",","default='online'","Method","used","to","update","`","_component","`",".","Only","used","in","`","fit","`","method",".","In","general",",","if","the","data","size","is","large",",","the","online","update","will","be","much","faster","than","the","batch","update",".","The","default","learning","method","is","going","to","be","changed","to","'batch","'","in","the","0.20","release",".","Valid","options",":",":","'batch","'",":","Batch","variational","Bayes","method",".","Use","all","training","data","in","each","EM","update",".","Old","`","components_","`","will","be","overwritten","in","each","iteration",".","'online","'",":","Online","variational","Bayes","method",".","In","each","EM","update",",","use","mini-batch","of","training","data","to","update","the","``","components_","``","variable","incrementally",".","The","learning","rate","is","controlled","by","the","``","learning_decay","``","and","the","``","learning_offset","``","parameters",".","learning_decay",":","float",",","optional","(","default=0.7",")","It","is","a","parameter","that","control","learning","rate","in","the","online","learning","method",".","The","value","should","be","set","between","(","0.5",",","1.0","]","to","guarantee","asymptotic","convergence",".","When","the","value","is","0.0","and","batch_size","is","``","n_samples","``",",","the","update","method","is","same","as","batch","learning",".","In","the","literature",",","this","is","called","kappa",".","learning_offset",":","float",",","optional","(","default=10",".",")","A","(","positive",")","parameter","that","downweights","early","iterations","in","online","learning",".","It","should","be","greater","than","1.0",".","In","the","literature",",","this","is","called","tau_0",".","max_iter",":","integer",",","optional","(","default=10",")","The","maximum","number","of","iterations",".","total_samples",":","int",",","optional","(","default=1e6",")","Total","number","of","documents",".","Only","used","in","the","`","partial_fit","`","method",".","batch_size",":","int",",","optional","(","default=128",")","Number","of","documents","to","use","in","each","EM","iteration",".","Only","used","in","online","learning",".","evaluate_every",":","int","optional","(","default=0",")","How","often","to","evaluate","perplexity",".","Only","used","in","`","fit","`","method",".","set","it","to","0","or","negative","number","to","not","evalute","perplexity","in","training","at","all",".","Evaluating","perplexity","can","help","you","check","convergence","in","training","process",",","but","it","will","also","increase","total","training","time",".","Evaluating","perplexity","in","every","iteration","might","increase","training","time","up","to","two-fold",".","perp_tol",":","float",",","optional","(","default=1e-1",")","Perplexity","tolerance","in","batch","learning",".","Only","used","when","``","evaluate_every","``","is","greater","than","0.","mean_change_tol",":","float",",","optional","(","default=1e-3",")","Stopping","tolerance","for","updating","document","topic","distribution","in","E-step",".","max_doc_update_iter",":","int","(","default=100",")","Max","number","of","iterations","for","updating","document","topic","distribution","in","the","E-step",".","n_jobs",":","int",",","optional","(","default=1",")","The","number","of","jobs","to","use","in","the","E-step",".","If","-1",",","all","CPUs","are","used",".","For","``","n_jobs","``","below","-1",",","(","n_cpus","+","1","+","n_jobs",")","are","used",".","verbose",":","int",",","optional","(","default=0",")","Verbosity","level",".","random_state",":","int","or","RandomState","instance","or","None",",","optional","(","default=None",")","Pseudo-random","number","generator","seed","control",".","Attributes","--","--","--","--","--","components_",":","array",",","[","n_topics",",","n_features","]","Topic","word","distribution",".","``","components_","[","i",",","j","]","``","represents","word","j","in","topic","`","i","`",".","n_batch_iter_",":","int","Number","of","iterations","of","the","EM","step",".","n_iter_",":","int","Number","of","passes","over","the","dataset",".","References","--","--","--","--","--","[","1","]","``","Online","Learning","for","Latent","Dirichlet","Allocation","''",",","Matthew","D.","Hoffman",",","David","M.","Blei",",","Francis","Bach",",","2010","[","2","]","``","Stochastic","Variational","Inference","''",",","Matthew","D.","Hoffman",",","David","M.","Blei",",","Chong","Wang",",","John","Paisley",",","2013","[","3","]","Matthew","D.","Hoffman","'s","onlineldavb","code",".","Link",":","http",":","\/\/matthewdhoffman.com\/\/code\/onlineldavb.tar"]
docstr: Transform data X according to the fitted model.
  
  Parameters
  ----------
  X : array-like or sparse matrix, shape=(n_samples, n_features)
      Document word matrix.
  
  Returns
  -------
  doc_topic_distr : shape=(n_samples, n_topics)
      Document topic distribution for X.
docstr_tok: ["Transform","data","X","according","to","the","fitted","model",".","Parameters","--","--","--","--","--","X",":","array-like","or","sparse","matrix",",","shape=","(","n_samples",",","n_features",")","Document","word","matrix",".","Returns","--","--","--","-","doc_topic_distr",":","shape=","(","n_samples",",","n_topics",")","Document","topic","distribution","for","X","."]
code: def transform(self, X):
      """Transform data X according to the fitted model.
  
      Parameters
      ----------
      X : array-like or sparse matrix, shape=(n_samples, n_features)
          Document word matrix.
  
      Returns
      -------
      doc_topic_distr : shape=(n_samples, n_topics)
          Document topic distribution for X.
      """
  
      if not hasattr(self, "components_"):
          raise NotFittedError(
              "no 'components_' attribute in model."
              " Please fit model first."
          )
  
      # make sure feature size is the same in fitted model and in X
      X = self._check_non_neg_array(
          X, "LatentDirichletAllocation.transform"
      )
      n_samples, n_features = X.shape
      if n_features != self.components_.shape[1]:
          raise ValueError(
              "The provided data has %d dimensions while "
              "the model was trained with feature size %d."
              % (n_features, self.components_.shape[1])
          )
  
      doc_topic_distr, _ = self._e_step(
          X, cal_sstats=False, random_init=False
      )
      # normalize doc_topic_distr
      doc_topic_distr /= doc_topic_distr.sum(axis=1)[:, np.newaxis]
      return doc_topic_distr
  
imports: import numpy
  import scipy.sparse
  from scipy.special import gammaln
  import warnings
  from ..base import BaseEstimator, TransformerMixin
  from ..utils import check_random_state, check_array, gen_batches, gen_even_slices, _get_n_jobs
  from ..utils.validation import check_non_negative
  from ..utils.extmath import logsumexp
  from ..externals.joblib import Parallel, delayed
  from ..externals.six.moves import xrange
  from ..exceptions import NotFittedError
  from ._online_lda import mean_change, _dirichlet_expectation_1d, _dirichlet_expectation_2d
label_desc: Use image node_id 9 for calling the LatentDirichletAllocation obj's underlying member method code with example usage: obj.transform(X) and returns: doc_topic_distr