Update dataset_utils.py
Browse files- dataset_utils.py +4 -2
dataset_utils.py
CHANGED
@@ -227,7 +227,7 @@ def concat_data(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds,feat
|
|
227 |
|
228 |
|
229 |
|
230 |
-
def generate_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds,feat_lab
|
231 |
stat_df = torch.zeros(size=(1,0))
|
232 |
demo_df = torch.zeros(size=(1,0))
|
233 |
meds = torch.zeros(size=(0,0))
|
@@ -239,7 +239,7 @@ def generate_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds,fe
|
|
239 |
demo_df = torch.zeros(size=(1,0))
|
240 |
|
241 |
size_cond, size_proc, size_meds, size_out, size_chart, size_lab, eth_vocab,gender_vocab,age_vocab,ins_vocab=vocab(task.replace(" ","_"),feat_cond,feat_proc,feat_out,feat_chart,feat_meds,False)
|
242 |
-
dyn,cond_df,demo=concat_data(data,task.replace(" ","_"),feat_cond,feat_proc,feat_out,feat_chart,feat_meds,feat_lab
|
243 |
if feat_chart:
|
244 |
charts = dyn['CHART']
|
245 |
charts=charts.to_numpy()
|
@@ -315,6 +315,7 @@ def generate_ml(dyn,stat,demo,concat_cols,concat):
|
|
315 |
dyna=np.nan_to_num(dyna, copy=False)
|
316 |
dyna=dyna.reshape(1,-1)
|
317 |
dyn_df=pd.DataFrame(data=dyna,columns=concat_cols)
|
|
|
318 |
else:
|
319 |
dyn_df=pd.DataFrame()
|
320 |
for key in dyn.columns.levels[0]:
|
@@ -333,6 +334,7 @@ def generate_ml(dyn,stat,demo,concat_cols,concat):
|
|
333 |
dyn_df=dyn_df.T
|
334 |
dyn_df.columns = dyn_df.iloc[0]
|
335 |
dyn_df=dyn_df.iloc[1:,:]
|
|
|
336 |
|
337 |
X_df=pd.concat([dyn_df,stat],axis=1)
|
338 |
X_df=pd.concat([X_df,demo],axis=1)
|
|
|
227 |
|
228 |
|
229 |
|
230 |
+
def generate_deep(data,task,feat_cond,feat_proc,feat_out,feat_chart,feat_meds,feat_lab):
|
231 |
stat_df = torch.zeros(size=(1,0))
|
232 |
demo_df = torch.zeros(size=(1,0))
|
233 |
meds = torch.zeros(size=(0,0))
|
|
|
239 |
demo_df = torch.zeros(size=(1,0))
|
240 |
|
241 |
size_cond, size_proc, size_meds, size_out, size_chart, size_lab, eth_vocab,gender_vocab,age_vocab,ins_vocab=vocab(task.replace(" ","_"),feat_cond,feat_proc,feat_out,feat_chart,feat_meds,False)
|
242 |
+
dyn,cond_df,demo=concat_data(data,task.replace(" ","_"),feat_cond,feat_proc,feat_out,feat_chart,feat_meds,feat_lab)
|
243 |
if feat_chart:
|
244 |
charts = dyn['CHART']
|
245 |
charts=charts.to_numpy()
|
|
|
315 |
dyna=np.nan_to_num(dyna, copy=False)
|
316 |
dyna=dyna.reshape(1,-1)
|
317 |
dyn_df=pd.DataFrame(data=dyna,columns=concat_cols)
|
318 |
+
print('AVANT :',dyn_df)
|
319 |
else:
|
320 |
dyn_df=pd.DataFrame()
|
321 |
for key in dyn.columns.levels[0]:
|
|
|
334 |
dyn_df=dyn_df.T
|
335 |
dyn_df.columns = dyn_df.iloc[0]
|
336 |
dyn_df=dyn_df.iloc[1:,:]
|
337 |
+
print('APRES: ',dyn_df)
|
338 |
|
339 |
X_df=pd.concat([dyn_df,stat],axis=1)
|
340 |
X_df=pd.concat([X_df,demo],axis=1)
|