コード例 #1
0
ファイル: rcd_conf.py プロジェクト: textSolver34761/SecuML
 def from_json(conf_json, secuml_conf):
     logger = secuml_conf.logger
     dataset_conf = DatasetConf.from_json(conf_json['dataset_conf'], logger)
     features_conf = FeaturesConf.from_json(conf_json['features_conf'],
                                            logger)
     annotations_conf = AnnotationsConf.from_json(
         conf_json['annotations_conf'], logger)
     factory = strategies_conf.get_factory()
     core_conf = factory.from_json(conf_json['core_conf'], logger)
     conf = RcdConf(secuml_conf,
                    dataset_conf,
                    features_conf,
                    annotations_conf,
                    core_conf,
                    name=conf_json['name'],
                    parent=conf_json['parent'])
     conf.exp_id = conf_json['exp_id']
     return conf
コード例 #2
0
ファイル: diadem.py プロジェクト: ryanbekabe/SecuML
 def from_json(conf_json, secuml_conf):
     dataset_conf = DatasetConf.from_json(conf_json['dataset_conf'],
                                          secuml_conf.logger)
     features_conf = FeaturesConf.from_json(conf_json['features_conf'],
                                            secuml_conf.logger)
     annotations_conf = AnnotationsConf.from_json(
         conf_json['annotations_conf'], secuml_conf.logger)
     core_conf = ClassificationConf.from_json(conf_json['core_conf'],
                                              secuml_conf.logger)
     exp_conf = DiademConf(secuml_conf,
                           dataset_conf,
                           features_conf,
                           annotations_conf,
                           core_conf,
                           name=conf_json['name'],
                           parent=conf_json['parent'],
                           already_trained=conf_json['already_trained'])
     exp_conf.exp_id = conf_json['exp_id']
     return exp_conf
コード例 #3
0
 def from_json(conf_json, secuml_conf):
     logger = secuml_conf.logger
     dataset_conf = DatasetConf.from_json(conf_json['dataset_conf'], logger)
     features_conf = FeaturesConf.from_json(conf_json['features_conf'],
                                            logger)
     annotations_conf = AnnotationsConf.from_json(
         conf_json['annotations_conf'], logger)
     factory = classifiers.get_factory()
     core_conf = factory.from_json(conf_json['core_conf'], logger)
     exp_conf = TrainConf(secuml_conf,
                          dataset_conf,
                          features_conf,
                          annotations_conf,
                          core_conf,
                          name=conf_json['name'],
                          parent=conf_json['parent'],
                          fold_id=conf_json['fold_id'])
     exp_conf.exp_id = conf_json['exp_id']
     return exp_conf
コード例 #4
0
 def from_json(conf_json, secuml_conf):
     logger = secuml_conf.logger
     dataset_conf = DatasetConf.from_json(conf_json['dataset_conf'], logger)
     features_conf = FeaturesConf.from_json(conf_json['features_conf'],
                                            logger)
     annotations_conf = AnnotationsConf.from_json(
                                              conf_json['annotations_conf'],
                                              logger)
     if conf_json['core_conf'] is not None:
         alerts_conf = AlertsConf.from_json(conf_json['core_conf'], logger)
     else:
         alerts_conf = None
     exp_conf = DetectionConf(secuml_conf, dataset_conf, features_conf,
                              annotations_conf, alerts_conf,
                              name=conf_json['name'],
                              parent=conf_json['parent'],
                              fold_id=conf_json['fold_id'],
                              kind=conf_json['kind'])
     exp_conf.exp_id = conf_json['exp_id']
     return exp_conf
コード例 #5
0
 def from_json(conf_json, secuml_conf):
     dataset_conf = DatasetConf.from_json(conf_json['dataset_conf'],
                                          secuml_conf.logger)
     features_conf = FeaturesConf.from_json(conf_json['features_conf'],
                                            secuml_conf.logger)
     annotations_conf = AnnotationsConf.from_json(
         conf_json['annotations_conf'], secuml_conf.logger)
     core_conf = None
     if conf_json['core_conf'] is not None:
         core_conf = clustering_conf.get_factory().from_json(
             conf_json['core_conf'], secuml_conf.logger)
     exp_conf = ClusteringConf(secuml_conf,
                               dataset_conf,
                               features_conf,
                               annotations_conf,
                               core_conf,
                               name=conf_json['name'],
                               parent=conf_json['parent'],
                               label=conf_json['label'])
     exp_conf.exp_id = conf_json['exp_id']
     return exp_conf