val_lines = [x for x in lines if x[:x.find("_")] in val_patients]
assert len(train_lines) + len(val_lines) == len(lines)
if not os.path.exists("data/%s/" % args.task):
os.makedirs("data/%s/" % args.task)
with open("data/%s/train_listfile.csv" % args.task, "w") as train_listfile:
if has_header:
train_listfile.write(header)
for line in train_lines: