thbndi commited on
Commit
0e0e235
1 Parent(s): 939032c

Update Mimic4Dataset.py

Browse files
Files changed (1) hide show
  1. Mimic4Dataset.py +3 -6
Mimic4Dataset.py CHANGED
@@ -435,15 +435,12 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
435
 
436
  df = pd.DataFrame.from_dict(dico, orient='index')
437
  for i, data in df.iterrows():
438
- concat_cols=[]
439
  dyn_df,cond_df,demo=concat_data(data,self.config.name.replace(" ","_"),self.feat_cond,self.feat_proc,self.feat_out, self.feat_chart, self.feat_meds,self.feat_lab)
440
  dyn=dyn_df.copy()
441
  dyn.columns=dyn.columns.droplevel(0)
442
- cols=dyn.columns
443
- time=dyn.shape[0]
444
- for t in range(time):
445
- cols_t = [str(x) + "_"+str(t) for x in cols]
446
- concat_cols.extend(cols_t)
447
  demo['gender']=gen_encoder.transform(demo['gender'])
448
  demo['ethnicity']=eth_encoder.transform(demo['ethnicity'])
449
  demo['insurance']=ins_encoder.transform(demo['insurance'])
 
435
 
436
  df = pd.DataFrame.from_dict(dico, orient='index')
437
  for i, data in df.iterrows():
 
438
  dyn_df,cond_df,demo=concat_data(data,self.config.name.replace(" ","_"),self.feat_cond,self.feat_proc,self.feat_out, self.feat_chart, self.feat_meds,self.feat_lab)
439
  dyn=dyn_df.copy()
440
  dyn.columns=dyn.columns.droplevel(0)
441
+ #cols=dyn.columns
442
+ #time=dyn.shape[0]
443
+ concat_cols = [f"{col}_{t}" for t in range(dyn.shape[0]) for col in dyn.columns]
 
 
444
  demo['gender']=gen_encoder.transform(demo['gender'])
445
  demo['ethnicity']=eth_encoder.transform(demo['ethnicity'])
446
  demo['insurance']=ins_encoder.transform(demo['insurance'])