thbndi commited on
Commit
e12ca57
·
1 Parent(s): d44d7bd

Update Mimic4Dataset.py

Browse files
Files changed (1) hide show
  1. Mimic4Dataset.py +7 -9
Mimic4Dataset.py CHANGED
@@ -357,9 +357,7 @@ def getXY_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds):
357
  charts = torch.tensor(charts)
358
  charts = charts.unsqueeze(0)
359
  charts = torch.tensor(charts)
360
- print('convert')
361
  charts = charts.type(torch.LongTensor)
362
- print('charts ok')
363
  if feat_meds:
364
  meds = dyn['MEDS']
365
  meds=meds.to_numpy()
@@ -402,10 +400,10 @@ def getXY_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds):
402
  stat_df = torch.cat((stat_df,stat),0)
403
  else:
404
  stat_df = stat
405
- print('stat ok')
406
 
 
407
  y = int(demo['label'])
408
-
409
  demo["gender"].replace(gender_vocab, inplace=True)
410
  demo["ethnicity"].replace(eth_vocab, inplace=True)
411
  demo["insurance"].replace(ins_vocab, inplace=True)
@@ -413,21 +411,21 @@ def getXY_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds):
413
  demo=demo[["gender","ethnicity","insurance","Age"]]
414
  demo = demo.values
415
  demo = torch.tensor(demo)
416
-
417
  if demo_df[0].nelement():
418
  demo_df = torch.cat((demo_df,demo),0)
419
  else:
420
  demo_df = demo
421
-
422
  stat_df = torch.tensor(stat_df)
423
  stat_df = stat_df.type(torch.LongTensor)
424
-
425
  demo_df = torch.tensor(demo_df)
426
  demo_df = demo_df.type(torch.LongTensor)
427
-
428
  y_df = torch.tensor(y)
429
  y_df = y_df.type(torch.LongTensor)
430
-
431
  return stat_df, demo_df, meds, charts, out, proc, lab, y_df
432
 
433
  def getXY(dyn,stat,demo,concat_cols,concat):
 
357
  charts = torch.tensor(charts)
358
  charts = charts.unsqueeze(0)
359
  charts = torch.tensor(charts)
 
360
  charts = charts.type(torch.LongTensor)
 
361
  if feat_meds:
362
  meds = dyn['MEDS']
363
  meds=meds.to_numpy()
 
400
  stat_df = torch.cat((stat_df,stat),0)
401
  else:
402
  stat_df = stat
 
403
 
404
+ print('label')
405
  y = int(demo['label'])
406
+ print('demo')
407
  demo["gender"].replace(gender_vocab, inplace=True)
408
  demo["ethnicity"].replace(eth_vocab, inplace=True)
409
  demo["insurance"].replace(ins_vocab, inplace=True)
 
411
  demo=demo[["gender","ethnicity","insurance","Age"]]
412
  demo = demo.values
413
  demo = torch.tensor(demo)
414
+ print('concat demo')
415
  if demo_df[0].nelement():
416
  demo_df = torch.cat((demo_df,demo),0)
417
  else:
418
  demo_df = demo
419
+ print('stat2')
420
  stat_df = torch.tensor(stat_df)
421
  stat_df = stat_df.type(torch.LongTensor)
422
+ print('demo2')
423
  demo_df = torch.tensor(demo_df)
424
  demo_df = demo_df.type(torch.LongTensor)
425
+ print('label2')
426
  y_df = torch.tensor(y)
427
  y_df = y_df.type(torch.LongTensor)
428
+ print("end")
429
  return stat_df, demo_df, meds, charts, out, proc, lab, y_df
430
 
431
  def getXY(dyn,stat,demo,concat_cols,concat):