Esempio n. 1
0
 def initLabels(self, labels_filename=None, overwrite=True):
     if isinstance(self.conf, SemiSupervisedProjectionConfiguration):
         if labels_filename is None:
             message = 'Semi supervised projections require annotated instances. '
             message += 'labels_filename must be specified.'
             raise ValueError(message)
     Experiment.initLabels(self,
                           labels_filename=labels_filename,
                           overwrite=overwrite)
Esempio n. 2
0
 def loadTrueLabels(self):
     labels_file = dir_tools.getDatasetDirectory(self.project, self.dataset)
     labels_file += 'labels/true_labels.csv'
     # Loads the true labels in the table TrueLabels if the file exists
     # Otherwise the table TrueLabels is not created
     if not dir_tools.checkFileExists(labels_file):
         print >> sys.stderr, 'No ground truth labels for this dataset'
         return
     exp = Experiment(self.project,
                      self.dataset,
                      self.db,
                      self.cursor,
                      experiment_name='true_labels')
     exp.initLabels('true_labels.csv')