code
stringlengths
3
6.57k
os.path.join(base_output_path, "input_data")
print('CMD: {}'.format(cmd_fold_validation)
subprocess.call(cmd_fold_validation, shell=True)
print('RC: {}'.format(rc)
exit(1)
print('# Read configuration for this instance...')
int(round(n * l)
os.path.join(DATA_FOLDER, "parameters", "{}.params.json".format(instance_name)
open(parameters_path)
json.load(json_data)
print('[ERROR] Could not retrieve parameters. Use default parameters.')
print(e)
default_params.iteritems()
print('# - Add {}={} as parameter because value not found'.format(key, v)
print('# Configuration: {}'.format(parameters)
print('# Start validation runs...')
range(0, k)
print('\n#########################')
print('# - Run {}'.format(i)
print('#########################')
format(i)
os.path.join("../experiments", base_output_path, "input_data", "{}_casebase.fold_{}.txt".format(instance_name, i)
os.path.join("../experiments", base_output_path, "input_data", "{}_outcomes.fold_{}.txt".format(instance_name, i)
os.path.join("../experiments", base_output_path, run_nb)
os.path.join(DATA_FOLDER, "parameters", "{}.params.json".format(instance_name)
open(parameters_path)
json.load(json_data)
print('[ERROR] Could not retrieve parameters. Use default parameters.')
print(e)
shutil.rmtree(fold_output_path)
os.makedirs(fold_output_path)
print('[ERROR] Could not create output path for {}'.format(run_nb)
if(nested_CV)
print('# Start Meta-optimization for Model Selection')
print('# Preliminary run')
os.path.join(fold_output_path, 'params_{}.init.json'.format(run_nb)
open(fold_param_file, 'w')
f.write(json.dumps(parameters, indent=4)
print('# Initial configuration: {}'.format(parameters)
os.path.join(fold_output_path, 'output_{}.init.txt'.format(run_nb)
os.path.join(fold_output_path, 'log_{}.init.txt'.format(run_nb)
int(parameters['online'])
int(parameters['heuristic'])
os.path.join(fold_output_path, 'output_{}.txt'.format(run_nb)
os.path.join(fold_output_path, 'log_{}.txt'.format(run_nb)
print('# CMD: {}'.format(cmd)
subprocess.call(cmd, shell=True)
Popen(['tail', '-n', '1', os.path.join(fold_output_path, 'output_{}.init.txt'.format(run_nb)
p.communicate()
float(output.split()
print('# Preliminary run accuracy: {}'.format(prun_accuracy)
format(METAOPTIMIZATION, fold_outcomes)
print('# CMD: {}'.format(cmd)
Popen(cmd.split()
p.communicate()
os.path.join(DATA_FOLDER, "parameters", "{}.optimized.params.json".format(instance_name)
json.load(open(parameters_path)
os.path.join(fold_output_path, 'params_{}.json'.format(run_nb)
open(fold_param_file, 'w')
f.write(json.dumps(parameters, indent=4)
print('# Final configuration: {}'.format(parameters)
os.path.join(fold_output_path, 'output_{}.txt'.format(run_nb)
os.path.join(fold_output_path, 'log_{}.txt'.format(run_nb)
print('# CMD: {}'.format(cmd)
subprocess.call(cmd, shell=True)
shutil.move("training.run_{}.log.csv".format(i)
os.path.join(base_output_path, "run_{}".format(i)
format(i)
shutil.move("prediction.run_{}.log.csv".format(i)
os.path.join(base_output_path, "run_{}".format(i)
format(i)
shutil.move("overlap.run_{}.log.csv".format(i)
os.path.join(base_output_path, "run_{}".format(i)
format(i)
shutil.move("strength.run_{}.log.csv".format(i)
os.path.join(base_output_path, "run_{}".format(i)
format(i)
Popen(['tail', '-n', '1', os.path.join(fold_output_path, 'output_{}.txt'.format(run_nb)
p.communicate()
float(output.split()
print("# Accuracy: {}".format(run_accuracy)
print('# Analyze the results...')
format(os.path.join(fold_output_path, 'output_{}.txt'.format(run_nb)
format('output_{}_confusion_matrix.gp'.format(run_nb)
subprocess.call(cmd_confusion_matrix, shell=True)
subprocess.call(cmd_cm_gp, shell=True)
shutil.move('output_{}_confusion_matrix.gp'.format(run_nb)
os.path.join(base_output_path, "run_{}".format(i)
format(run_nb)
shutil.move('output_{}_confusion_matrix.txt'.format(run_nb)
os.path.join(base_output_path, "run_{}".format(i)
format(run_nb)
shutil.move('output_{}_confusion_matrix_0.png'.format(run_nb)
os.path.join(base_output_path, "run_{}".format(i)
format(run_nb)
shutil.move('output_{}_confusion_matrix_1.png'.format(run_nb)
os.path.join(base_output_path, "run_{}".format(i)
format(run_nb)
shutil.move('output_{}_confusion_matrix_2.png'.format(run_nb)
os.path.join(base_output_path, "run_{}".format(i)