Exemplo n.º 1
0
 def run(self, instances=None, cv_monitoring=False):
     Experiment.run(self)
     datasets = self._gen_datasets(instances)
     if self.test_conf.method in ['cv', 'temporal_cv', 'sliding_window']:
         self._run_cv(datasets, cv_monitoring)
     else:
         self._run_one_fold(datasets, cv_monitoring)
Exemplo n.º 2
0
 def run(self, instances=None, drop_annotated_instances=False, quick=False):
     Experiment.run(self)
     instances = self.get_instances()
     core_conf = self.exp_conf.core_conf
     clustering = core_conf.algo(instances, core_conf)
     clustering.fit()
     clustering.generate(drop_annotated_instances=drop_annotated_instances)
     clustering.export(self.output_dir(), quick=quick)
Exemplo n.º 3
0
 def run(self, train_instances, cv_monitoring=False):
     Experiment.run(self)
     self._train(train_instances)
     if cv_monitoring:
         self._cv_monitoring(train_instances)
     else:
         self.cv_monitoring = None
     self._export()
Exemplo n.º 4
0
 def set_clusters(self, instances, assigned_clusters, centroids,
                  drop_annotated_instances, cluster_labels):
     Experiment.run(self)
     clustering = Clusters(instances, assigned_clusters)
     clustering.generate(centroids,
                         drop_annotated_instances=drop_annotated_instances,
                         cluster_labels=cluster_labels)
     clustering.export(self.output_dir(),
                       drop_annotated_instances=drop_annotated_instances)
Exemplo n.º 5
0
 def run(self):
     Experiment.run(self)
     instances = self.get_instances()
     with_density = instances.num_instances() < 150000
     if not with_density:
         self.exp_conf.logger.warning('There are more than 150.000, so '
                                      'the density plots are not '
                                      'displayed. ')
     stats = FeaturesAnalysis(instances,
                              self.exp_conf.multiclass,
                              self.exp_conf.logger,
                              with_density=with_density)
     stats.gen_plots(self.output_dir())
     stats.gen_scoring(self.output_dir())
Exemplo n.º 6
0
 def run(self, instances=None, export=True):
     Experiment.run(self)
     instances = self.get_instances()
     core_conf = self.exp_conf.core_conf
     dimension_reduction = core_conf.algo(core_conf)
     # Fit
     dimension_reduction.fit(instances)
     if export:
         dimension_reduction.export_fit(self.output_dir(), instances)
     # Transformation
     projected_instances = dimension_reduction.transform(instances)
     if export:
         dimension_reduction.export_transform(self.output_dir(), instances,
                                              projected_instances)
     return projected_instances
Exemplo n.º 7
0
 def run(self):
     Experiment.run(self)
     datasets = Datasets(self.get_instances())
     active_learning = ActiveLearning(self, datasets)
     if not self.exp_conf.core_conf.auto:
         from secuml.exp.celery_app.app import secumlworker
         from secuml.exp.active_learning.celery_tasks import IterationTask
         options = {}
         # bind iterations object to IterationTask class
         active_learning.run_next_iter(output_dir=self.output_dir())
         IterationTask.iteration_object = active_learning
         # Start worker
         secumlworker.enable_config_fromcmdline = False
         secumlworker.run(**options)
     else:
         active_learning.run_iterations(output_dir=self.output_dir())
Exemplo n.º 8
0
 def run(self):
     Experiment.run(self)
     stats = FeaturesAnalysis(self.get_instances())
     stats.compute()
     stats.export(self.output_dir())
Exemplo n.º 9
0
 def run(self, classifier, test_instances):
     Experiment.run(self)
     self.test_instances = self.get_instances(test_instances)
     self.classifier = classifier
     self._test()
     self._export()
Exemplo n.º 10
0
 def run(self, train_instances, cv_monitoring=False):
     Experiment.run(self)
     self._train(train_instances)
     if cv_monitoring:
         self._cv_monitoring(train_instances)
     self.monitoring.display(self.output_dir())
Exemplo n.º 11
0
 def run(self, test_instances):
     Experiment.run(self)
     self.test_instances = self.get_instances(test_instances)
     self._test()
     self._export()