# clusterlib_main.py import sys import os from clusterlib.storage import sqlite3_dumps from main import main NOSQL_PATH = os.path.join(os.environ["HOME"], "job.sqlite3") if __name__ == "__main__": main() sqlite3_dumps({" ".join(sys.argv): "JOB DONE"}, NOSQL_PATH)
def save_result0_0_1(exp_name, dictionary, overwrite=True): db = get_resultdb0_0_1(exp_name) sqlite3_dumps(dictionary, db, overwrite=overwrite)
def update_notification0_0_1(exp_name, dictionary): db = get_notifdb0_0_1(exp_name) sqlite3_dumps(dictionary, db, overwrite=True)
def save_experiment0_0_1(experiment, overwrite=True): name = experiment.name db = get_expdb0_0_1() sqlite3_dumps({name: experiment}, db, overwrite=overwrite)
if args["directivity"]: print('Using information about directivity...') y_directivity = make_prediction_directivity(X) # Perform stacking score = 0.997 * y_pca + 0.003 * y_directivity else: score = y_pca # Save data if "output_dir" in args: if not os.path.exists(args["output_dir"]): os.makedirs(args["output_dir"]) outname = os.path.join(args["output_dir"], "%s.csv" % job_hash) # Generate the submission file ## with open(outname, 'w') as fname: fname.write("NET_neuronI_neuronJ,Strength\n") for i, j in product(range(score.shape[0]), range(score.shape[1])): line = "{0}_{1}_{2},{3}\n".format(name, i + 1, j + 1, score[i, j]) fname.write(line) print("Infered connectivity score is saved at %s" % outname) # Indicate the job is finished print("job_hash %s" % job_hash) sqlite3_dumps({job_hash: "JOB DONE"}, get_sqlite3_path())