コード例 #1
0
 def fromJson(obj, session):
     experiment = DescriptiveStatisticsExperiment(obj['project'],
                                                  obj['dataset'],
                                                  session,
                                                  create=False)
     Experiment.expParamFromJson(experiment, obj, None)
     return experiment
コード例 #2
0
 def fromJson(obj, secuml_conf):
     conf = ClassifierConfFactory.getFactory().fromJson(
         obj['classification_conf'])
     experiment = ClassificationExperiment(secuml_conf)
     experiment.initExperiment(obj['project'], obj['dataset'], create=False)
     Experiment.expParamFromJson(experiment, obj, conf)
     return experiment
コード例 #3
0
 def fromJson(obj, session):
     experiment = ValidationExperiment(obj['project'],
                                       obj['dataset'],
                                       session,
                                       create=False)
     Experiment.expParamFromJson(experiment, obj, Configuration())
     return experiment
コード例 #4
0
 def setConf(self, conf, features_file, annotations_filename=None,
             annotations_id=None):
     self.query_strategy = conf.query_strategy
     Experiment.setConf(self, conf, features_file,
                        annotations_filename=annotations_filename,
                        annotations_id=annotations_id)
     if self.conf.validation_conf is not None:
         self.test_exp = self.createValidationExperiment()
コード例 #5
0
 def export(self):
     Experiment.export(self)
     if self.conf.test_conf.method == 'dataset':
         self.test_exp.export()
         filename = path.join(self.getOutputDirectory(),
                              'test_experiment.txt')
         with open(filename, 'w') as f:
             f.write(str(self.test_exp.experiment_id) + '\n')
コード例 #6
0
 def fromJson(obj, session):
     conf = ClusteringConfFactory.getFactory().fromJson(obj['conf'])
     experiment = ClusteringExperiment(obj['project'],
                                       obj['dataset'],
                                       session,
                                       create=False)
     Experiment.expParamFromJson(experiment, obj, conf)
     return experiment
コード例 #7
0
 def fromJson(obj, secuml_conf):
     experiment = ActiveLearningExperiment(secuml_conf)
     experiment.initExperiment(obj['project'], obj['dataset'],
                               create=False)
     conf = ActiveLearningConfFactory.getFactory().fromJson(obj['conf'])
     Experiment.expParamFromJson(experiment, obj, conf)
     experiment.query_strategy = obj['query_strategy']
     return experiment
コード例 #8
0
 def export(self):
     Experiment.export(self)
     if self.conf.validation_conf is not None:
         self.test_exp.export()
         filename = path.join(self.getOutputDirectory(),
                              'test_experiment.txt')
         with open(filename, 'w') as f:
             f.write(str(self.test_exp.experiment_id) + '\n')
コード例 #9
0
 def __init__(self,
              project,
              dataset,
              session,
              experiment_name=None,
              parent=None,
              logger=None,
              create=True):
     Experiment.__init__(self, project, dataset, session, experiment_name,
                         parent, logger, create)
     self.already_trained = None
コード例 #10
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Clustering of the data for data exploration.')
     Experiment.projectDatasetFeturesParser(parser)
     algos = ['Kmeans', 'GaussianMixture']
     subparsers = parser.add_subparsers(dest='algo')
     factory = ClusteringConfFactory.getFactory()
     for algo in algos:
         algo_parser = subparsers.add_parser(algo)
         factory.generateParser(algo, algo_parser)
     return parser
コード例 #11
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Clustering of the data for data exploration.')
     Experiment.projectDatasetFeturesParser(parser)
     subparsers = parser.add_subparsers(dest='algo')
     subparsers.required = True
     factory = ClusteringConfFactory.getFactory()
     algos = factory.getAlgorithms()
     for algo in algos:
         algo_parser = subparsers.add_parser(algo)
         factory.generateParser(algo, algo_parser)
     return parser
コード例 #12
0
 def setConf(self,
             conf,
             features_file,
             annotations_filename=None,
             annotations_id=None):
     Experiment.setConf(self,
                        conf,
                        features_file,
                        annotations_filename=annotations_filename,
                        annotations_id=annotations_id)
     if self.conf.test_conf.method == 'dataset':
         self.test_exp = self.createTestExperiment()
コード例 #13
0
 def generateParser():
     parser = argparse.ArgumentParser(
             description='Active Learning',
             formatter_class=argparse.RawTextHelpFormatter)
     Experiment.projectDatasetFeturesParser(parser)
     subparsers = parser.add_subparsers(dest='strategy')
     subparsers.required = True
     factory = ActiveLearningConfFactory.getFactory()
     strategies = factory.getStrategies()
     for strategy in strategies:
         strategy_parser = subparsers.add_parser(strategy)
         factory.generateParser(strategy, strategy_parser)
     return parser
コード例 #14
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Active Learning',
         formatter_class=argparse.RawTextHelpFormatter)
     Experiment.projectDatasetFeturesParser(parser)
     strategies = [
         'Ilab', 'RandomSampling', 'UncertaintySampling', 'CesaBianchi',
         'Aladin', 'Gornitz'
     ]
     subparsers = parser.add_subparsers(dest='strategy')
     factory = ActiveLearningConfFactory.getFactory()
     for strategy in strategies:
         strategy_parser = subparsers.add_parser(strategy)
         factory.generateParser(strategy, strategy_parser)
     return parser
コード例 #15
0
 def __init__(self,
              project,
              dataset,
              session,
              experiment_name=None,
              logger=None,
              create=True):
     Experiment.__init__(self,
                         project,
                         dataset,
                         session,
                         experiment_name=experiment_name,
                         logger=logger,
                         create=create)
     # query_strategy: vraiment utile  ?
     self.query_strategy = None
コード例 #16
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Learn a detection model. ' +
         'The ground-truth must be stored in annotations/ground_truth.csv.')
     Experiment.projectDatasetFeturesParser(parser)
     models = [
         'LogisticRegression', 'Svc', 'GaussianNaiveBayes', 'DecisionTree',
         'RandomForest', 'GradientBoosting'
     ]
     subparsers = parser.add_subparsers(dest='model')
     factory = ClassifierConfFactory.getFactory()
     for model in models:
         model_parser = subparsers.add_parser(model)
         factory.generateParser(model, model_parser)
     ## Add subparser for already trained model
     already_trained = subparsers.add_parser('AlreadyTrained')
     factory.generateParser('AlreadyTrained', already_trained)
     return parser
コード例 #17
0
 def toJson(self):
     conf = Experiment.toJson(self)
     conf['__type__'] = 'ActiveLearningExperiment'
     conf['query_strategy'] = self.query_strategy
     conf['conf'] = self.conf.toJson()
     return conf
コード例 #18
0
 def toJson(self):
     conf = Experiment.toJson(self)
     conf['__type__'] = 'ClusteringExperiment'
     conf['conf'] = self.conf.toJson()
     return conf
コード例 #19
0
 def __init__(self, secuml_conf, session=None):
     Experiment.__init__(self, secuml_conf, session=session)
     self.already_trained = None
コード例 #20
0
 def toJson(self):
     conf = Experiment.toJson(self)
     conf['__type__'] = 'ClassificationExperiment'
     conf['classification_conf'] = self.conf.toJson()
     return conf
コード例 #21
0
 def toJson(self):
     conf = Experiment.toJson(self)
     conf['__type__'] = 'DescriptiveStatisticsExperiment'
     return conf
コード例 #22
0
 def generateParser():
     parser = argparse.ArgumentParser(
         description='Descriptive Statistics of the Dataset')
     Experiment.projectDatasetFeturesParser(parser)
     return parser
コード例 #23
0
 def __init__(self, secuml_conf, session=None):
     Experiment.__init__(self, secuml_conf, session=session)
     self.query_strategy = None
コード例 #24
0
ファイル: ValidationExperiment.py プロジェクト: wtbsw/SecuML
 def toJson(self):
     conf = Experiment.toJson(self)
     conf['__type__'] = 'ValidationExperiment'
     return conf
コード例 #25
0
ファイル: ValidationExperiment.py プロジェクト: wtbsw/SecuML
 def fromJson(obj, secuml_conf):
     experiment = ValidationExperiment(secuml_conf)
     experiment.initExperiment(obj['project'], obj['dataset'], create=False)
     Experiment.expParamFromJson(experiment, obj, Configuration())
     return experiment
コード例 #26
0
 def fromJson(obj, secuml_conf):
     experiment = DescriptiveStatisticsExperiment(secuml_conf)
     experiment.initExperiment(obj['project'], obj['dataset'], create=False)
     Experiment.expParamFromJson(experiment, obj, None)
     return experiment