Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +8 -4
Mimic4Dataset.py
CHANGED
@@ -408,10 +408,14 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
408 |
train_dic = train_data.to_dict('index')
|
409 |
test_dic = test_data.to_dict('index')
|
410 |
val_dic = val_data.to_dict('index')
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
|
|
|
|
|
|
|
|
415 |
|
416 |
return feat_cond, feat_chart, feat_proc, feat_meds, feat_out
|
417 |
|
|
|
408 |
train_dic = train_data.to_dict('index')
|
409 |
test_dic = test_data.to_dict('index')
|
410 |
val_dic = val_data.to_dict('index')
|
411 |
+
|
412 |
+
with open(csv_dir+'/train_data.pkl', 'wb') as f:
|
413 |
+
pickle.dump(train_dic, f)
|
414 |
+
with open(csv_dir+'/val_data.pkl', 'wb') as f:
|
415 |
+
pickle.dump(val_dic, f)
|
416 |
+
with open(csv_dir+'/test_data.pkl', 'wb') as f:
|
417 |
+
pickle.dump(test_dic, f)
|
418 |
+
|
419 |
|
420 |
return feat_cond, feat_chart, feat_proc, feat_meds, feat_out
|
421 |
|