Exemplo n.º 1
0
 def getOutputDirectories(self, al_dir, iteration_dir):
     monitoring_dir = path.join(iteration_dir, 'labels_monitoring')
     dir_tools.createDirectory(monitoring_dir)
     evolution_dir = path.join(al_dir, 'labels_monitoring')
     if self.monitoring.iteration_number == 1:
         dir_tools.createDirectory(evolution_dir)
     return monitoring_dir, evolution_dir
Exemplo n.º 2
0
 def display(self, directory):
     testing_dir = path.join(directory, self.monitoring_type)
     dir_tools.createDirectory(testing_dir)
     self.finalComputations()
     self.predictions_monitoring.display(testing_dir)
     if self.has_ground_truth:
         self.performance_monitoring.display(testing_dir)
Exemplo n.º 3
0
 def display(self, directory):
     training_dir = path.join(directory, self.monitoring_type)
     dir_tools.createDirectory(training_dir)
     self.finalComputations()
     self.performance_monitoring.display(training_dir)
     if not self.conf.families_supervision:
         self.predictions_monitoring.display(training_dir)
         self.coefficients.display(training_dir)
Exemplo n.º 4
0
 def export(self, output_dir):
     output_dir = path.join(output_dir, str(self.feature_id))
     dir_tools.createDirectory(output_dir)
     if self.feature_type == FeatureType.binary:
         with open(path.join(output_dir, 'binary_histogram.json'), 'w') as f:
             self.barplot.export_json(f)
     elif self.feature_type == FeatureType.numeric:
         self.boxplot.display(path.join(output_dir, 'boxplot.png'))
         with open(path.join(output_dir, 'histogram.json'), 'w') as f:
             self.barplot.export_json(f)
         self.density.display(path.join(output_dir, 'density.png'))
Exemplo n.º 5
0
    def export(self, output_dir):
        output_dir = path.join(output_dir, str(self.feature_id))
        dir_tools.createDirectory(output_dir)

        ## TODO: remove when numpy issue #8627 is solved.
        if self.barplot is None:
            return

        if self.feature_type == FeatureType.binary:
            with open(path.join(output_dir, 'binary_histogram.json'),
                      'w') as f:
                self.barplot.export_json(f)
        elif self.feature_type == FeatureType.numeric:
            self.boxplot.display(path.join(output_dir, 'boxplot.png'))
            with open(path.join(output_dir, 'histogram.json'), 'w') as f:
                self.barplot.export_json(f)
            self.density.display(path.join(output_dir, 'density.png'))
Exemplo n.º 6
0
def create_dataset(secuml_conf, project, dataset):
    dataset_dir = path.join(secuml_conf.input_data_dir, project, dataset)
    dir_tools.createDirectory(dataset_dir)
    features_dir = path.join(dataset_dir, 'features')
    dir_tools.createDirectory(features_dir)
    annotations_dir = path.join(dataset_dir, 'annotations')
    dir_tools.createDirectory(annotations_dir)
    return dataset_dir, features_dir, annotations_dir
 def setOutputDirectory(self):
     self.output_directory = path.join(self.monitoring.iteration_dir,
                                       'clustering_evaluation')
     dir_tools.createDirectory(self.output_directory)
Exemplo n.º 8
0
 def export(self):
     experiment_dir = self.output_dir()
     dir_tools.createDirectory(experiment_dir)
     conf_filename = path.join(experiment_dir, 'conf.json')
     with open(conf_filename, 'w') as f:
         json.dump(self.to_json(), f, indent=2)
Exemplo n.º 9
0
 def dumpModel(self):
     # check added for Sssvdd that has no dump model function
     if self.classifier.pipeline is not None:
         model_dir = path.join(self.output_dir, 'model')
         dir_tools.createDirectory(model_dir)
         self.classifier.dumpModel(path.join(model_dir, 'model.out'))
Exemplo n.º 10
0
 def exportAlerts(self):
     if self.exp.alerts is None:
         return
     alerts_directory = path.join(self.output_dir, 'alerts')
     dir_tools.createDirectory(alerts_directory)
     self.exp.alerts.export(alerts_directory)
Exemplo n.º 11
0
 def initComputations(self):
     Iteration.initComputations(self)
     dir_tools.createDirectory(self.iteration_dir)
     self.monitoring.exportStartMonitoring(self.al_dir, self.iteration_dir)
Exemplo n.º 12
0
 def getEvolutionDir(self, al_dir):
     evolution_dir = path.join(al_dir, 'models_performance')
     if self.monitoring.iteration_number == 1:
         dir_tools.createDirectory(evolution_dir)
     return evolution_dir
Exemplo n.º 13
0
 def getMonitoringDir(self, iteration_dir):
     monitoring_dir = path.join(iteration_dir, 'models_performance')
     dir_tools.createDirectory(monitoring_dir)
     return monitoring_dir