original_docstring:  Select the samples that should belong to the training set and
              retrain the classifier.
  
              For incremental training run through four steps.
  
              1) Add samples to the training set according to some criteria.
              2) Discard samples from the training set according to some criteria.
              3) Retrain the classifier with the current training set.
              4) If used relabel the training set according to the current
                 decision function.
  
              :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
          
docstring: Select the samples that should belong to the training set and
  retrain the classifier.
  
  For incremental training run through four steps.
  
  1) Add samples to the training set according to some criteria.
  2) Discard samples from the training set according to some criteria.
  3) Retrain the classifier with the current training set.
  4) If used relabel the training set according to the current
  decision function.
docstring_tokens: Select the samples that should belong to the training set and retrain the classifier . For incremental training run through four steps . 1 ) Add samples to the training set according to some criteria . 2 ) Discard samples from the training set according to some criteria . 3 ) Retrain the classifier with the current training set . 4 ) If used relabel the training set according to the current decision function .
code: def adapt_training_set(self, data, class_label=None):
          """ Select the samples that should belong to the training set and
              retrain the classifier.
  
              For incremental training run through four steps.
  
              1) Add samples to the training set according to some criteria.
              2) Discard samples from the training set according to some criteria.
              3) Retrain the classifier with the current training set.
              4) If used relabel the training set according to the current
                 decision function.
  
              :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
          """
  
          if (self.show_plot or self.save_plot) and self.is_plot_active == False:
              if self.show_plot:
                  plt.ion()
              plt.grid(True)
              if self.show_plot:
                  plt.show()
              self.is_plot_active = True
  
          # In case initial training is not already performed, train
          # classifier and CDT once.
          if self.is_trained == False and self.discard_type != "INC":
              self._complete_training()
              if self.discard_type == "CDT":
                  self.learn_CDT()
              self.is_trained = True
  
          # specify flag for retraining phase
          self.is_retraining = True
  
          ########################################################################
          # 1) Selection of new data                                             #
          ########################################################################
  
          [new_data_in_training_set, retraining_required, label] =\
              self.select_new_data(data, class_label)
  
          ########################################################################
          # 2) Discard data                                                      #
          ########################################################################
  
          [new_data_in_training_set, retraining_required] =\
              self.discard_data(data, class_label,\
                                new_data_in_training_set, retraining_required,\
                                label)
  
          ########################################################################
          # 3) Retrain                                                           #
          ########################################################################
  
          self.retrain(data, class_label,\
                       new_data_in_training_set, retraining_required)
  
          ########################################################################
          # 4) Relabel training set                                              #
          ########################################################################
  
          self.relabel_training_set()
  
          if self.show_plot or self.save_plot:
              self.num_samples = len(self.samples)
              self.visualize()
code_tokens: def adapt_training_set ( self , data , class_label = None ) : if ( self . show_plot or self . save_plot ) and self . is_plot_active == False : if self . show_plot : plt . ion ( ) plt . grid ( True ) if self . show_plot : plt . show ( ) self . is_plot_active = True if self . is_trained == False and self . discard_type != "INC" : self . _complete_training ( ) if self . discard_type == "CDT" : self . learn_CDT ( ) self . is_trained = True self . is_retraining = True [ new_data_in_training_set , retraining_required , label ] = self . select_new_data ( data , class_label ) [ new_data_in_training_set , retraining_required ] = self . discard_data ( data , class_label , new_data_in_training_set , retraining_required , label ) self . retrain ( data , class_label , new_data_in_training_set , retraining_required ) self . relabel_training_set ( ) if self . show_plot or self . save_plot : self . num_samples = len ( self . samples ) self . visualize ( )
short_docstring: Select the samples that should belong to the training set and
  retrain the classifier.
short_docstring_tokens: Select the samples that should belong to the training set and retrain the classifier .
comment: """ Select the samples that should belong to the training set and
              retrain the classifier.
  
              For incremental training run through four steps.
  
              1) Add samples to the training set according to some criteria.
              2) Discard samples from the training set according to some criteria.
              3) Retrain the classifier with the current training set.
              4) If used relabel the training set according to the current
                 decision function.
  
              :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
          """$SEP$# In case initial training is not already performed, train$SEP$# classifier and CDT once.$SEP$# specify flag for retraining phase$SEP$########################################################################$SEP$# 1) Selection of new data                                             #$SEP$########################################################################$SEP$########################################################################$SEP$# 2) Discard data                                                      #$SEP$########################################################################$SEP$########################################################################$SEP$# 3) Retrain                                                           #$SEP$########################################################################$SEP$########################################################################$SEP$# 4) Relabel training set                                              #$SEP$########################################################################