Exemple #1
0
    def update_config(self):
        out('update_config')

        self.config = PRACMLNConfig()
        self.config['mln'] = self.mln_container.selected_file.get().strip().lstrip('*')
        self.config["db"] = self.db_container.selected_file.get().strip().lstrip('*')
        self.config["output_filename"] = self.output_filename.get()
        self.config["params"] = self.params.get().strip()
        self.config["method"] = LearningMethods.id(self.selected_method.get().strip())
        self.config["pattern"] = self.pattern.get()
        self.config["use_prior"] = int(self.use_prior.get())
        self.config["prior_mean"] = self.priorMean.get()
        self.config["prior_stdev"] = self.priorStdDev.get()
        self.config["incremental"] = int(self.incremental.get())
        self.config["shuffle"] = int(self.shuffle.get())
        self.config["use_initial_weights"] = int(self.use_initial_weights.get())
        self.config["qpreds"] = self.queryPreds.get().strip()
        self.config["epreds"] = self.evidencePreds.get().strip()
        self.config["discr_preds"] = self.discrPredicates.get()
        self.config['logic'] = self.selected_logic.get()
        self.config['grammar'] = self.selected_grammar.get()
        self.config['multicore'] = self.multicore.get()
        self.config['profile'] = self.profile.get()
        self.config['verbose'] = self.verbose.get()
        self.config['ignore_unknown_preds'] = self.ignore_unknown_preds.get()
        self.config['ignore_zero_weight_formulas'] = self.ignore_zero_weight_formulas.get()
        self.config['save'] = self.save.get()
        self.config["output_filename"] = self.output_filename.get().strip()
        self.project.learnconf = PRACMLNConfig()
        self.project.learnconf.update(self.config.config.copy())
Exemple #2
0
 def set_outputfilename(self):
     if not hasattr(self, "output_filename") or not hasattr(self, "db_filename") or not hasattr(self, "mln_filename"):
         return
     mln = self.mln_container.selected_file.get()
     db = self.db_container.selected_file.get()
     if "" in (mln, db): return
     if self.selected_method.get():
         method = LearningMethods.clazz(self.selected_method.get())
         methodid = LearningMethods.id(method)
         filename = config.learnwts_output_filename(mln, methodid.lower(), db)
         self.output_filename.set(filename)