original_docstring:  Start retraining procedure if the training set changed.
  
              :param data:  A new sample for the training set.
              :type  data:  list of float
              :param class_label:    The label of the new sample.
              :type  class_label:    str
              :param new_data_in_training_set: flag if new data is in training set
              :type  new_data_in_training_set: bool
              :param retraining_required: flag if retraining is
                      required (the new point is a potential sv or a removed
                      one was a sv)
          
docstring: Start retraining procedure if the training set changed.
docstring_tokens: Start retraining procedure if the training set changed .
code: def retrain(self, data, class_label,
                  new_data_in_training_set, retraining_required):
          """ Start retraining procedure if the training set changed.
  
              :param data:  A new sample for the training set.
              :type  data:  list of float
              :param class_label:    The label of the new sample.
              :type  class_label:    str
              :param new_data_in_training_set: flag if new data is in training set
              :type  new_data_in_training_set: bool
              :param retraining_required: flag if retraining is
                      required (the new point is a potential sv or a removed
                      one was a sv)
          """
          if self.classifier_information.has_key("Inc_iterations") and\
              self.classifier_information["Inc_iterations"] == 1:
              self.classifier_information["Retrain_counter"] = 0
  
          if self.discard_type == "INC" and new_data_in_training_set is True:
              # Incremental training
              self.incremental_training(data, class_label)
  
              if not self.classifier_information.has_key("Retrain_counter"):
                  self.classifier_information["Retrain_counter"] = 1
              else:
                  self.classifier_information["Retrain_counter"] += 1
          else:
              if retraining_required:
                  # retrain the svm
                  self.retrain_SVM()
  
                  if not self.classifier_information.has_key("Retrain_counter"):
                      self.classifier_information["Retrain_counter"] = 1
                  else:
                      self.classifier_information["Retrain_counter"] += 1
  
                  if (self.keep_only_sv or
                          # approaches, where data is removed later on
                          self.discard_type == "CDT" or
                          self.discard_type == "INC_BATCH"):
                      # only keep the sv to save memory
                      self.remove_non_support_vectors()
code_tokens: def retrain ( self , data , class_label , new_data_in_training_set , retraining_required ) : if self . classifier_information . has_key ( "Inc_iterations" ) and self . classifier_information [ "Inc_iterations" ] == 1 : self . classifier_information [ "Retrain_counter" ] = 0 if self . discard_type == "INC" and new_data_in_training_set is True : self . incremental_training ( data , class_label ) if not self . classifier_information . has_key ( "Retrain_counter" ) : self . classifier_information [ "Retrain_counter" ] = 1 else : self . classifier_information [ "Retrain_counter" ] += 1 else : if retraining_required : self . retrain_SVM ( ) if not self . classifier_information . has_key ( "Retrain_counter" ) : self . classifier_information [ "Retrain_counter" ] = 1 else : self . classifier_information [ "Retrain_counter" ] += 1 if ( self . keep_only_sv or self . discard_type == "CDT" or self . discard_type == "INC_BATCH" ) : self . remove_non_support_vectors ( )
short_docstring: Start retraining procedure if the training set changed.
short_docstring_tokens: Start retraining procedure if the training set changed .
comment: """ Start retraining procedure if the training set changed.
  
              :param data:  A new sample for the training set.
              :type  data:  list of float
              :param class_label:    The label of the new sample.
              :type  class_label:    str
              :param new_data_in_training_set: flag if new data is in training set
              :type  new_data_in_training_set: bool
              :param retraining_required: flag if retraining is
                      required (the new point is a potential sv or a removed
                      one was a sv)
          """$SEP$# Incremental training$SEP$# retrain the svm$SEP$# approaches, where data is removed later on$SEP$# only keep the sv to save memory