def compare_all(waldo_df, experiment_settings=DEFAULT_EXPERIMENT_SETTINGS):
    opt_problem = WaldoOpt(waldo_df)
    domain = opt_problem.domain
    start = time.time()
    rhc = hillclimb(domain=domain,
                    costf=opt_problem.compute_fitness,
                    max_evaluations=experiment_settings['rhc']['evaluations'])
    rhc['time'] = time.time() - start
    rhc.set_index('evaluations', inplace=True)
    start = time.time()
    sa = simulated_annealing(domain=domain,
                             costf=opt_problem.compute_fitness,
                             T=experiment_settings['sa']['T'])
    sa['time'] = time.time() - start
    sa.set_index('temperature', inplace=True)
    start = time.time()
    ga = genetic_optimize(domain=domain,
                          costf=opt_problem.compute_fitness,
                          maxiter=experiment_settings['ga']['generations'])
    ga['time'] = time.time() - start
    ga.set_index('generations', inplace=True)
    start = time.time()
    mm = mimic.run_mimic(domain=domain,
                         fitness_function=opt_problem.compute_fitness,
                         evaluations=experiment_settings['mm']['evaluations'])
    mm['time'] = time.time() - start
    return rhc, sa, ga, mm
def compare_all(waldo_df, experiment_settings=DEFAULT_EXPERIMENT_SETTINGS):
    opt_problem = WaldoOpt(waldo_df)
    domain = opt_problem.domain
    start = time.time()
    rhc = hillclimb(domain=domain,
                    costf=opt_problem.compute_fitness,
                    max_evaluations=experiment_settings['rhc']['evaluations'])
    rhc['time'] = time.time() - start
    rhc.set_index('evaluations', inplace=True)
    start = time.time()
    sa = simulated_annealing(domain=domain,
                             costf=opt_problem.compute_fitness,
                             T=experiment_settings['sa']['T'])
    sa['time'] = time.time() - start
    sa.set_index('temperature', inplace=True)
    start = time.time()
    ga = genetic_optimize(domain=domain,
                          costf=opt_problem.compute_fitness,
                          maxiter=experiment_settings['ga']['generations'])
    ga['time'] = time.time() - start
    ga.set_index('generations', inplace=True)
    start = time.time()
    mm = mimic.run_mimic(domain=domain,
                         fitness_function=opt_problem.compute_fitness,
                         evaluations=experiment_settings['mm']['evaluations'])
    mm['time'] = time.time() - start
    return rhc, sa, ga, mm
Beispiel #3
0
def compare_all(data, experiment_settings=DEFAULT_EXPERIMENT_SETTINGS):
    opt_problem = ClassifierOptimization(data)
    domain = opt_problem.domain
    start = time.time()
    rhc = hillclimb(domain=domain,
                    costf=opt_problem.compute_classification_error,
                    max_evaluations=experiment_settings['rhc']['evaluations'])
    rhc['optimal_value'] += 1
    rhc['time'] = time.time() - start
    rhc.set_index('evaluations', inplace=True)
    start = time.time()
    sa = simulated_annealing(domain=domain,
                             costf=opt_problem.compute_classification_error,
                             T=experiment_settings['sa']['T'])
    sa.set_index('temperature', inplace=True)
    sa['optimal_value'] += 1
    sa['time'] = time.time() - start
    start = time.time()
    ga = genetic_optimize(domain=domain,
                          costf=opt_problem.compute_classification_error,
                          maxiter=experiment_settings['ga']['generations'])
    ga.set_index('generations', inplace=True)
    ga['optimal_value'] += 1
    ga['time'] = time.time() - start
    start = time.time()
    mm = mimic.run_mimic(domain=domain,
                         fitness_function=opt_problem.compute_classification_error,
                         evaluations=experiment_settings['mm']['evaluations'])
    mm['optimal_value'] += 1
    mm['time'] = time.time() - start
    return rhc, sa, ga, mm
def evaluate_ga():
    domain = [(0, 8)] * len(people) * 2
    df = genetic_optimize(domain, schedulecost)
    df['optimal_value'] = 1 / df['cost']
    return df
def evaluate_ga():
    domain = [(0,8)] * len(people) *2
    df = genetic_optimize(domain, schedulecost)
    df['optimal_value'] = 1 / df['cost']
    return df