def fromArgs(args): secuml_conf = ExpConf.common_from_args(args) dataset_conf = DatasetConf.fromArgs(args, secuml_conf.logger) features_conf = FeaturesConf.fromArgs(args, secuml_conf.logger) annotations_conf = AnnotationsConf(args.annotations_file, None, secuml_conf.logger) return FeaturesAnalysisConf(secuml_conf, dataset_conf, features_conf, annotations_conf, None, experiment_name=args.exp_name)
def fromArgs(args): secuml_conf = ExpConf.common_from_args(args) dataset_conf = DatasetConf.fromArgs(args, secuml_conf.logger) features_conf = FeaturesConf.fromArgs(args, secuml_conf.logger) annotations_conf = AnnotationsConf(args.annotations_file, None, secuml_conf.logger) factory = ActiveLearningConfFactory.getFactory() core_conf = factory.fromArgs(args.strategy, args, secuml_conf.logger) return ActiveLearningConf(secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=args.exp_name)
def fromArgs(args): secuml_conf = ExpConf.common_from_args(args) dataset_conf = DatasetConf.fromArgs(args, secuml_conf.logger) features_conf = FeaturesConf.fromArgs(args, secuml_conf.logger) annotations_conf = AnnotationsConf(args.annotations_file, None, secuml_conf.logger) factory = ClusteringConfFactory.getFactory() core_conf = factory.fromArgs(args.algo, args, secuml_conf.logger) conf = ClusteringConf(secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=args.exp_name, label=args.label) return conf
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) exp_conf = ValidationConf(secuml_conf, dataset_conf, features_conf, annotations_conf, None, experiment_name=conf_json['experiment_name'], parent=conf_json['parent']) exp_conf.experiment_id = conf_json['experiment_id'] return exp_conf
def createTestExperiment(self): self.test_exp = None test_conf = self.exp_conf.core_conf.validation_conf if test_conf is not None: logger = self.exp_conf.secuml_conf.logger annotations_conf = AnnotationsConf('ground_truth.csv', None, logger) dataset_conf = DatasetConf(self.exp_conf.dataset_conf.project, test_conf.test_dataset, logger) features_conf = FeaturesConf( self.exp_conf.features_conf.input_features, logger) validation_conf = ValidationConf(self.exp_conf.secuml_conf, dataset_conf, features_conf, annotations_conf, None) self.test_exp = ValidationExperiment(validation_conf, session=self.session) self.test_exp.run() self.exp_conf.test_exp_conf = validation_conf
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) factory = ActiveLearningConfFactory.getFactory() core_conf = factory.from_json(conf_json['core_conf'], secuml_conf.logger) conf = ActiveLearningConf(secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=conf_json['experiment_name'], parent=conf_json['parent']) conf.experiment_id = conf_json['experiment_id'] return conf
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 = CoreClassificationConf.from_json(conf_json['core_conf'], secuml_conf.logger) exp_conf = ClassificationConf( secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=conf_json['experiment_name'], parent=conf_json['parent'], already_trained=conf_json['already_trained']) exp_conf.experiment_id = conf_json['experiment_id'] return exp_conf
def createClusteringExp(self, core_clustering_conf): exp_conf = self.diadem_exp.exp_conf features_conf = FeaturesConf(exp_conf.features_conf.input_features, exp_conf.secuml_conf.logger) if self.diadem_exp.test_exp is not None: dataset_conf = exp_conf.test_exp_conf.dataset_conf annotations_conf = exp_conf.test_exp_conf.annotations_conf else: dataset_conf = exp_conf.dataset_conf annotations_conf = exp_conf.annotations_conf clustering_exp_conf = ClusteringConf( exp_conf.secuml_conf, dataset_conf, features_conf, annotations_conf, core_clustering_conf, experiment_name=None, parent=self.diadem_exp.experiment_id) return ClusteringExperiment(clustering_exp_conf, create=True, session=self.diadem_exp.session)
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) factory = ClusteringConfFactory.getFactory() core_conf = None if conf_json['core_conf'] is not None: core_conf = factory.from_json(conf_json['core_conf'], secuml_conf.logger) exp_conf = ClusteringConf(secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=conf_json['experiment_name'], parent=conf_json['parent'], label=conf_json['label']) exp_conf.experiment_id = conf_json['experiment_id'] return exp_conf
def fromArgs(args): secuml_conf = ExpConf.common_from_args(args) already_trained = None if args.model_class != 'AlreadyTrained': core_conf = CoreClassificationConf.fromArgs( args, True, secuml_conf.logger) annotations_conf = AnnotationsConf(args.annotations_file, None, secuml_conf.logger) else: already_trained = args.model_exp_id core_conf = CoreClassificationConf.fromArgs( args, False, secuml_conf.logger) annotations_conf = AnnotationsConf(None, None, secuml_conf.logger) dataset_conf = DatasetConf.fromArgs(args, secuml_conf.logger) features_conf = FeaturesConf.fromArgs(args, secuml_conf.logger) return ClassificationConf(secuml_conf, dataset_conf, features_conf, annotations_conf, core_conf, experiment_name=args.exp_name, already_trained=already_trained)
def create_exp(self): Experiment.create_exp(self) # create projection experiment self.projection_exp = None if self.exp_conf.core_conf is None: return projection_core_conf = self.exp_conf.core_conf.projection_conf if projection_core_conf is not None: features_conf = FeaturesConf( self.exp_conf.features_conf.input_features, self.exp_conf.secuml_conf.logger) projection_conf = ProjectionConf(self.exp_conf.secuml_conf, self.exp_conf.dataset_conf, features_conf, self.exp_conf.annotations_conf, projection_core_conf, experiment_name='-'.join([ self.exp_conf.experiment_name, 'projection' ]), parent=self.experiment_id) self.projection_exp = ProjectionExperiment(projection_conf, session=self.session)