flattened.extend(s) flattened = DataFrame({ "text": flattened, "group": list(fr.group) * len(columns) }) if local: l = [ leave_one_out(fr.spatial, fr.group, "spatial_loo_svm"), leave_one_out(fr.social, fr.group, "social_loo_svm"), leave_one_out(fr.hypothetical, fr.group, "hypothetical_loo_svm"), leave_one_out(fr.control, fr.group, "control_loo_svm"), leave_one_out(fr.temporal, fr.group, "temporal_loo_svm"), leave_one_out(flattened.text, flattened.group, "all_loo_svm") ] print(l) df = DataFrame(l) df.to_csv("classifier_performance.csv") else: import sbatch sbatch.load("leave_one_out", [fr.temporal, fr.group, "temporal_loo_svm"]) sbatch.load("leave_one_out", [fr.spatial, fr.group, "spatial_loo_svm"]) sbatch.load("leave_one_out", [fr.social, fr.group, "social_loo_svm"]) sbatch.load("leave_one_out", [fr.hypothetical, fr.group, "hypothetical_loo_svm"]) sbatch.load("leave_one_out", [fr.control, fr.group, "control_loo_svm"]) sbatch.load("leave_one_out", [flattened.text, flattened.group, "all_loo_svm"]) sbatch.launch()
fr.control, fr.temporal ] names = [ "spatial", "social", "hypothetical", "control", "temporal" ] get_shared_features(dims, names, fr.group).to_csv("features_for_each_domain.csv") get_shared_features(dims, names, fr.group, across=True).to_csv("shared_features.csv") if local: outs = [] for i1 in range(len(dims)): for i2 in range(len(dims)): outs.append(cross_decode(dims[i1], fr.group, dims[i2], fr.group, names[i1] + "_to_" + names[i2])) df = DataFrame(outs) df.to_csv("cross_encoding_performance.csv") else: import sbatch for i1 in range(len(dims)): for i2 in range(len(dims)): sbatch.load("cross_decode", [dims[i1], fr.group, dims[i2], fr.group, names[i1] + "_to_" + names[i2]]) sbatch.launch() print("jobs submitted to the cluster. Run the collation scripts when they're done!")