thbndi commited on
Commit
c819f7e
·
1 Parent(s): 9fd8cd1

Update Mimic4Dataset.py

Browse files
Files changed (1) hide show
  1. 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
- train_dic.to_pickle(csv_dir+'/train_data.pkl')
413
- val_dic.to_pickle(csv_dir+'/val_data.pkl')
414
- test_dic.to_pickle(csv_dir+'/test_data.pkl')
 
 
 
 
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