Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +2 -7
Mimic4Dataset.py
CHANGED
@@ -401,9 +401,7 @@ def getXY_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds):
|
|
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,21 +409,18 @@ def getXY_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds):
|
|
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 |
-
|
|
|
429 |
return stat_df, demo_df, meds, charts, out, proc, lab, y_df
|
430 |
|
431 |
def getXY(dyn,stat,demo,concat_cols,concat):
|
|
|
401 |
else:
|
402 |
stat_df = stat
|
403 |
|
|
|
404 |
y = int(demo['label'])
|
|
|
405 |
demo["gender"].replace(gender_vocab, inplace=True)
|
406 |
demo["ethnicity"].replace(eth_vocab, inplace=True)
|
407 |
demo["insurance"].replace(ins_vocab, inplace=True)
|
|
|
409 |
demo=demo[["gender","ethnicity","insurance","Age"]]
|
410 |
demo = demo.values
|
411 |
demo = torch.tensor(demo)
|
|
|
412 |
if demo_df[0].nelement():
|
413 |
demo_df = torch.cat((demo_df,demo),0)
|
414 |
else:
|
415 |
demo_df = demo
|
|
|
416 |
stat_df = torch.tensor(stat_df)
|
417 |
stat_df = stat_df.type(torch.LongTensor)
|
|
|
418 |
demo_df = torch.tensor(demo_df)
|
419 |
demo_df = demo_df.type(torch.LongTensor)
|
|
|
420 |
y_df = torch.tensor(y)
|
421 |
y_df = y_df.type(torch.LongTensor)
|
422 |
+
|
423 |
+
print(demo_df)
|
424 |
return stat_df, demo_df, meds, charts, out, proc, lab, y_df
|
425 |
|
426 |
def getXY(dyn,stat,demo,concat_cols,concat):
|