Update Mimic4Dataset.py
Browse files- Mimic4Dataset.py +6 -6
Mimic4Dataset.py
CHANGED
@@ -246,14 +246,14 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
|
|
246 |
self.config_path = kwargs.pop("config_path",None)
|
247 |
self.test_size = kwargs.pop("test_size",0.2)
|
248 |
self.val_size = kwargs.pop("val_size",0.1)
|
249 |
-
|
250 |
-
|
251 |
-
self.feat_cond, self.feat_chart, self.feat_proc, self.feat_meds, self.feat_out,self.path = self.create_cohort()
|
252 |
super().__init__(**kwargs)
|
|
|
|
|
|
|
253 |
if self.encoding:
|
254 |
-
X_train_encoded=generate_split(
|
255 |
-
X_test_encoded=generate_split(
|
256 |
-
X_val_encoded=generate_split(
|
257 |
|
258 |
X_train_encoded.to_csv(self.path+"/X_train_encoded.csv", index=False)
|
259 |
X_test_encoded.to_csv(self.path+"/X_test_encoded.csv", index=False)
|
|
|
246 |
self.config_path = kwargs.pop("config_path",None)
|
247 |
self.test_size = kwargs.pop("test_size",0.2)
|
248 |
self.val_size = kwargs.pop("val_size",0.1)
|
|
|
|
|
|
|
249 |
super().__init__(**kwargs)
|
250 |
+
|
251 |
+
self.feat_cond, self.feat_chart, self.feat_proc, self.feat_meds, self.feat_out,path = self.create_cohort()
|
252 |
+
|
253 |
if self.encoding:
|
254 |
+
X_train_encoded=generate_split(path+'/train_data.pkl',self.config.name,True,self.feat_cond, self.feat_chart, self.feat_proc, self.feat_meds, self.feat_out)
|
255 |
+
X_test_encoded=generate_split(path+'/test_data.pkl',self.config.name,True,self.feat_cond, self.feat_chart, self.feat_proc, self.feat_meds, self.feat_out)
|
256 |
+
X_val_encoded=generate_split(path+'/val_data.pkl',self.config.name,True,self.feat_cond, self.feat_chart, self.feat_proc, self.feat_meds, self.feat_out)
|
257 |
|
258 |
X_train_encoded.to_csv(self.path+"/X_train_encoded.csv", index=False)
|
259 |
X_test_encoded.to_csv(self.path+"/X_test_encoded.csv", index=False)
|