def run(self, dataset, time_limit): """ Run the automatic statistician. """ histories = [ModelHistory.new(model, dataset, self.bo, self.gp, self.perf_sample_std, self.runtime_sample_std) for model in models.list_classification_models()] # do multi-armed bandit for N iterations print ", ".join(["iters", "time_left", "model", "hp", "perf", "runtime"]) try: time_left = time_limit iters = 0 while time_left > 0: selected = self.select(histories, time_left) hp, perf, runtime = selected.run() print ", ".join(str(t) for t in [iters, time_left, selected.model.__name__, float(hp), perf, runtime]) time_left -= runtime iters += 1 except KeyboardInterrupt: print "Caught keyboard interrupt, finishing early..." # plot resulting beliefs for m in histories: m.plot()
def run(self, dataset, time_limit): """ Run the automatic statistician. """ histories = [ ModelHistory.new(model, dataset, self.bo, self.gp, self.perf_sample_std, self.runtime_sample_std) for model in models.list_classification_models() ] # do multi-armed bandit for N iterations print ", ".join(["iters", "time_left", "model", "hp", "perf", "runtime"]) try: time_left = time_limit iters = 0 while time_left > 0: selected = self.select(histories, time_left) hp, perf, runtime = selected.run() print ", ".join(str(t) for t in [iters, time_left, selected.model.__name__, float(hp), perf, runtime]) time_left -= runtime iters += 1 except KeyboardInterrupt: print "Caught keyboard interrupt, finishing early..." # plot resulting beliefs for m in histories: m.plot()
def __init__(self): self.models = models.list_classification_models()