original_docstring:  Add a new sample with associated label to the training set.
  
              In case of neither incremental learning nor the
              restriction of training samples is used,
              add the samples to the training set.
              Otherwise check whether the classifier is already trained and if so
              select an appropriate training set and retrain the classifier.
              If the classifier is not trained, train it when there are enough
              samples available.
  
              :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: Add a new sample with associated label to the training set.
  In case of neither incremental learning nor the
  restriction of training samples is used,
  add the samples to the training set.
  Otherwise check whether the classifier is already trained and if so
  select an appropriate training set and retrain the classifier.
  If the classifier is not trained, train it when there are enough
  samples available.
docstring_tokens: Add a new sample with associated label to the training set . In case of neither incremental learning nor the restriction of training samples is used add the samples to the training set . Otherwise check whether the classifier is already trained and if so select an appropriate training set and retrain the classifier . If the classifier is not trained train it when there are enough samples available .
code: def _train(self, data, class_label):
          """ Add a new sample with associated label to the training set.
  
              In case of neither incremental learning nor the
              restriction of training samples is used,
              add the samples to the training set.
              Otherwise check whether the classifier is already trained and if so
              select an appropriate training set and retrain the classifier.
              If the classifier is not trained, train it when there are enough
              samples available.
  
              :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 not self.is_retrainable() and self.basket_size == numpy.inf:
              self._train_sample(data, class_label)
          else:
              # should not be relevant because first the classifier will be
              # trained if the basket size is reached but after the first training
              # only inc_train should adapt the classifier no matter how many
              # samples are in the training set
              if self.samples is not None and self.is_trained:
                  self.adapt_training_set(data, class_label)
              else:
                  self._train_sample(data, class_label)
                  if self.show_plot or self.save_plot:
                      plt.clf()
                  if len(self.samples) >= self.basket_size:
                      if not self.is_trained:
                          self._complete_training()
                          if self.discard_type == "CDT":
                              self.learn_CDT()
                          self.is_trained = True
code_tokens: def _train ( self , data , class_label ) : if not self . is_retrainable ( ) and self . basket_size == numpy . inf : self . _train_sample ( data , class_label ) else : if self . samples is not None and self . is_trained : self . adapt_training_set ( data , class_label ) else : self . _train_sample ( data , class_label ) if self . show_plot or self . save_plot : plt . clf ( ) if len ( self . samples ) >= self . basket_size : if not self . is_trained : self . _complete_training ( ) if self . discard_type == "CDT" : self . learn_CDT ( ) self . is_trained = True
short_docstring: Add a new sample with associated label to the training set.
short_docstring_tokens: Add a new sample with associated label to the training set .
comment: """ Add a new sample with associated label to the training set.
  
              In case of neither incremental learning nor the
              restriction of training samples is used,
              add the samples to the training set.
              Otherwise check whether the classifier is already trained and if so
              select an appropriate training set and retrain the classifier.
              If the classifier is not trained, train it when there are enough
              samples available.
  
              :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$# should not be relevant because first the classifier will be$SEP$# trained if the basket size is reached but after the first training$SEP$# only inc_train should adapt the classifier no matter how many$SEP$# samples are in the training set