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)
After Change
"phenotyping", "multitask"]
val_patients = set()
with open("mimic3models/valset.csv", "r") as valset_file:
for line in valset_file:
x, y = line.split(",")
if int(y) == 1: