parameters: (self, batch_vectorizer=None, tau0=1024.0, kappa=0.7, update_every=1,
                     apply_weight=None, decay_weight=None, update_after=None, asynchronous=False)
docstring: :Description: proceeds the learning of topic model in online mode
  
          :param object_reference batch_vectorizer: an instance of BatchVectorizer class
          :param int update_every: the number of batches; model will be updated once per it
          :param float tau0: coefficient (see 'Update formulas' paragraph)
          :param float kappa (float): power for tau0, (see 'Update formulas' paragraph)
          :param update_after: number of batches to be passed for Phi synchronizations
          :type update_after: list of int
          :param apply_weight: weight of applying new counters
          :type apply_weight: list of float
          :param decay_weight: weight of applying old counters
          :type decay_weight: list of float
          :param bool asynchronous: use or not the asynchronous implementation of the EM-algorithm
  
          :Note:
            asynchronous=True leads to impossibility of score extraction via score_tracker.\
            Use get_score() instead.
  
          :Update formulas:
            * The formulas for decay_weight and apply_weight:
            * update_count = current_processed_docs / (batch_size * update_every);
            * rho = pow(tau0 + update_count, -kappa);
            * decay_weight = 1-rho;
            * apply_weight = rho;
            * if apply_weight, decay_weight and update_after are set, they will be used,\
              otherwise the code below will be used (with update_every, tau0 and kappa)
docstring_summary: :Description: proceeds the learning of topic model in online mode
docstring_tokens: : Description : proceeds the learning of topic model in online mode
function: def fit_online(self, batch_vectorizer=None, tau0=1024.0, kappa=0.7, update_every=1,
                     apply_weight=None, decay_weight=None, update_after=None, asynchronous=False):
          """
          :Description: proceeds the learning of topic model in online mode
  
          :param object_reference batch_vectorizer: an instance of BatchVectorizer class
          :param int update_every: the number of batches; model will be updated once per it
          :param float tau0: coefficient (see 'Update formulas' paragraph)
          :param float kappa (float): power for tau0, (see 'Update formulas' paragraph)
          :param update_after: number of batches to be passed for Phi synchronizations
          :type update_after: list of int
          :param apply_weight: weight of applying new counters
          :type apply_weight: list of float
          :param decay_weight: weight of applying old counters
          :type decay_weight: list of float
          :param bool asynchronous: use or not the asynchronous implementation of the EM-algorithm
  
          :Note:
            asynchronous=True leads to impossibility of score extraction via score_tracker.\
            Use get_score() instead.
  
          :Update formulas:
            * The formulas for decay_weight and apply_weight:
            * update_count = current_processed_docs / (batch_size * update_every);
            * rho = pow(tau0 + update_count, -kappa);
            * decay_weight = 1-rho;
            * apply_weight = rho;
            * if apply_weight, decay_weight and update_after are set, they will be used,\
              otherwise the code below will be used (with update_every, tau0 and kappa)
          """
          if batch_vectorizer is None:
              raise IOError('No batches were given for processing')
  
          if not self._initialized:
              raise RuntimeError('The model was not initialized. Use initialize() method')
  
          update_after_final, apply_weight_final, decay_weight_final = [], [], []
          if (update_after is None) or (apply_weight is None) or (decay_weight is None):
              update_after_final = range(update_every, batch_vectorizer.num_batches + 1, update_every)
              if len(update_after_final) == 0 or (update_after_final[-1] != batch_vectorizer.num_batches):
                  update_after_final = list(update_after_final)
                  update_after_final.append(batch_vectorizer.num_batches)
  
              for _ in update_after_final:
                  self._num_online_processed_batches += update_every
                  update_count = self._num_online_processed_batches // update_every
                  rho = pow(tau0 + update_count, -kappa)
                  apply_weight_final.append(rho)
                  decay_weight_final.append(1 - rho)
          else:
              update_after_final = update_after
              apply_weight_final = apply_weight
              decay_weight_final = decay_weight
  
          # temp code for easy using of TopicSelectionThetaRegularizer from Python
          _topic_selection_regularizer_func(self, self._regularizers)
  
          self._wait_for_batches_processed(
              self._pool.apply_async(func=self.master.fit_online,
                                     args=(batch_vectorizer.batches_ids, batch_vectorizer.weights,
                                           update_after_final, apply_weight_final,
                                           decay_weight_final, asynchronous)),
              batch_vectorizer.num_batches)
  
          for name in self.scores.data.keys():
              if name not in self.score_tracker:
                  self.score_tracker[name] =\
                      SCORE_TRACKER[self.scores[name].type](self.scores[name])
  
          self._synchronizations_processed += len(update_after_final)
          self._phi_cached = None
function_tokens: def fit_online ( self , batch_vectorizer = None , tau0 = 1024.0 , kappa = 0.7 , update_every = 1 , apply_weight = None , decay_weight = None , update_after = None , asynchronous = False ) : if batch_vectorizer is None : raise IOError ( 'No batches were given for processing' ) if not self . _initialized : raise RuntimeError ( 'The model was not initialized. Use initialize() method' ) update_after_final , apply_weight_final , decay_weight_final = [ ] , [ ] , [ ] if ( update_after is None ) or ( apply_weight is None ) or ( decay_weight is None ) : update_after_final = range ( update_every , batch_vectorizer . num_batches + 1 , update_every ) if len ( update_after_final ) == 0 or ( update_after_final [ - 1 ] != batch_vectorizer . num_batches ) : update_after_final = list ( update_after_final ) update_after_final . append ( batch_vectorizer . num_batches ) for _ in update_after_final : self . _num_online_processed_batches += update_every update_count = self . _num_online_processed_batches // update_every rho = pow ( tau0 + update_count , - kappa ) apply_weight_final . append ( rho ) decay_weight_final . append ( 1 - rho ) else : update_after_final = update_after apply_weight_final = apply_weight decay_weight_final = decay_weight # temp code for easy using of TopicSelectionThetaRegularizer from Python _topic_selection_regularizer_func ( self , self . _regularizers ) self . _wait_for_batches_processed ( self . _pool . apply_async ( func = self . master . fit_online , args = ( batch_vectorizer . batches_ids , batch_vectorizer . weights , update_after_final , apply_weight_final , decay_weight_final , asynchronous ) ) , batch_vectorizer . num_batches ) for name in self . scores . data . keys ( ) : if name not in self . score_tracker : self . score_tracker [ name ] = SCORE_TRACKER [ self . scores [ name ] . type ] ( self . scores [ name ] ) self . _synchronizations_processed += len ( update_after_final ) self . _phi_cached = None