(expt_dir, best_val, best_job, expt_grid)
Write out the best_job_and_result.txt file containing the top results.
Write out the best_job_and_result.txt file containing the top results.
Write out the best_job_and_result . txt file containing the top results .
def write_best_job(expt_dir, best_val, best_job, expt_grid):
    '''Write out the best_job_and_result.txt file containing the top results.'''

    best_job_fh = open(os.path.join(expt_dir, 'best_job_and_result.txt'), 'w')
    best_job_fh.write("Best result: %f\nJob-id: %d\nParameters: \n" %
                      (best_val, best_job))
    for best_params in expt_grid.get_params(best_job):
        best_job_fh.write(str(best_params))
    best_job_fh.close()
def write_best_job ( expt_dir , best_val , best_job , expt_grid ) : best_job_fh = open ( os . path . join ( expt_dir , 'best_job_and_result.txt' ) , 'w' ) best_job_fh . write ( "Best result: %f\nJob-id: %d\nParameters: \n" % ( best_val , best_job ) ) for best_params in expt_grid . get_params ( best_job ) : best_job_fh . write ( str ( best_params ) ) best_job_fh . close ( )