def prepare_and_run(deltaconf): """ Prepare the configuration and run experiments """ conf = Configuration() conf.update(deltaconf) if conf['expr.city.id'] is None: conf['expr.city.id'] = CITY[conf['expr.city.name']] experiment(conf)
def experimentPredictingTimeMajority(poicol, resdir, city_idx=None): """docstring for experimentColfilter """ conf = Configuration() conf['expr.target'] = poicol conf['expr.model'] = 'PredictingTimeMajority' if city_idx is None: cityloop(conf, resdir, 'ptm') else: run_experiment(conf, resdir, 'ptm', city_idx)
def experimentMarkovModel(poicol, resdir, city_idx=None): """docstring for experimentColfilter """ conf = Configuration() conf['expr.target'] = poicol conf['expr.model'] = 'MarkovChainModel' if city_idx is None: cityloop(conf, resdir, 'mm') else: run_experiment(conf, resdir, 'mm', city_idx)
def mockTrainTextExport(poicol, resdir, city_idx=None): """ export the training trails and testing instance for inspection """ conf = Configuration() conf['expr.target'] = poicol conf['expr.model'] = 'mockTrainTextExport' if city_idx is None: cityloop(conf, resdir, 'tt') else: run_experiment(conf, resdir, 'tt', city_idx)
def __init__(self, master): super(AnexprGui, self).__init__() self.frame = tk.Frame(master) self.frame.pack() #TODO use eval for correct setting types # Save button btnSave = tk.Button(self.frame, text='Save') btnSave.grid(row=0, column=0, columnspan=2, sticky=tk.E) btnSave.bind('<Button-1>', lambda e: self.save()) self.doexpansion = tk.IntVar(self.frame) self.doexpansion.set(1) ckExpand = tk.Checkbutton(self.frame, text='Expand', onvalue=1, offvalue=0, variable=self.doexpansion) ckExpand.grid(row=1, column=0, columnspan=2, sticky=tk.E) self.scripttype = tk.IntVar(self.frame) self.scripttype.set(1) rbHadoop = tk.Radiobutton(self.frame, text='Hadoop', variable=self.scripttype, val=0) rbHadoop.grid(row=2, column=0, columnspan=2, sticky=tk.E) rbMultiproc = tk.Radiobutton(self.frame, text='Multiproc', variable=self.scripttype, val=1) rbMultiproc.grid(row=3, column=0, columnspan=2, sticky=tk.E) self.scriptconf = dict() self.addEntry('NAME', '', self.scriptconf, 4, True) self.addEntry('OUTDIR', '', self.scriptconf, 5, True) self.addEntry('HOUTDIR', '', self.scriptconf, 6, True) self.conf = Configuration() self.confvar = dict() for idx, (k, v) in enumerate(sorted(self.conf, key=lambda (x, y): x), 7): self.addEntry(k, str(v), self.confvar, idx)
def experimentColfilter(poicol, resdir, city_idx=None): """docstring for experimentColfilter """ conf = Configuration() conf['expr.target'] = poicol conf['expr.model'] = 'ColfilterModel' conf['cf.similarity'] = 'SparseCosineSimilarity' conf['vec.isaccum'] = True conf['vec.normalized'] = False sigmahours = [1., 4., 0.25, 12., 24.] for simnum in [100, 50, 5]: conf['cf.simnum'] = simnum for sigma, sigmahour in zip(map(lambda x: x * 3600., sigmahours), sigmahours): conf['vec.kernel.params'] = (sigma, ) if city_idx is None: cityloop(conf, resdir, 'n%03d_s%6.2gh' % (simnum, sigmahour)) else: run_experiment(conf, resdir, 'n%03d_s%6.2gh' % (simnum, sigmahour), city_idx)