thbndi commited on
Commit
955dea1
1 Parent(s): 84842cb

Update Mimic4Dataset.py

Browse files
Files changed (1) hide show
  1. Mimic4Dataset.py +18 -3
Mimic4Dataset.py CHANGED
@@ -12,9 +12,6 @@ import yaml
12
  from datasets import hf
13
  from .dataset_utils import create_vocab,gender_vocab,vocab, concat_data, generate_deep, generate_ml
14
  from .task_cohort import create_cohort, check_config_file
15
- hf.download("day_intervals_cohort_v22.py", save_path="./")
16
-
17
-
18
 
19
 
20
 
@@ -31,6 +28,10 @@ _HOMEPAGE = "https://huggingface.co/datasets/thbndi/Mimic4Dataset"
31
 
32
  _CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
33
  _GIT_URL = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline"
 
 
 
 
34
  _CONFIG_URLS = {'los' : f"{_BASE_URL}/config/los.config",
35
  'mortality' : f"{_BASE_URL}/config/mortality.config",
36
  'phenotype' : f"{_BASE_URL}/config/phenotype.config",
@@ -158,6 +159,20 @@ class Mimic4Dataset(datasets.GeneratorBasedBuilder):
158
  self.feat_cond, self.feat_lab, self.feat_proc, self.feat_meds, self.feat_chart, self.out = config['diagnosis'], config['lab'], config['proc'], config['meds'], False, False
159
  self.feat_out = False
160
  self.feat_chart = False
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  data_dir = "./data/dict/"+self.config.name.replace(" ","_")+"/dataDic"
163
  sys.path.append(path_bench)
 
12
  from datasets import hf
13
  from .dataset_utils import create_vocab,gender_vocab,vocab, concat_data, generate_deep, generate_ml
14
  from .task_cohort import create_cohort, check_config_file
 
 
 
15
 
16
 
17
 
 
28
 
29
  _CITATION = "https://proceedings.mlr.press/v193/gupta22a.html"
30
  _GIT_URL = "https://github.com/healthylaife/MIMIC-IV-Data-Pipeline"
31
+
32
+ _DATA_GEN = f"{_BASE_URL}/data_generation_icu_modify.py"
33
+ _DATA_GEN_HOSP= f"{_BASE_URL}/data_generation_modify.py"
34
+ _DAY_INT= f"{_BASE_URL}/day_intervals_cohort_v22.py"
35
  _CONFIG_URLS = {'los' : f"{_BASE_URL}/config/los.config",
36
  'mortality' : f"{_BASE_URL}/config/mortality.config",
37
  'phenotype' : f"{_BASE_URL}/config/phenotype.config",
 
159
  self.feat_cond, self.feat_lab, self.feat_proc, self.feat_meds, self.feat_chart, self.out = config['diagnosis'], config['lab'], config['proc'], config['meds'], False, False
160
  self.feat_out = False
161
  self.feat_chart = False
162
+
163
+
164
+ #####################downloads modules from hub
165
+ if not os.path.exists('./model/data_generation_icu_modify.py'):
166
+ file_path, head = urlretrieve(_DATA_GEN, "data_generation_icu_modify.py")
167
+ shutil.move(file_path, './model')
168
+
169
+ if not os.path.exists('./model/data_generation_modify.py'):
170
+ file_path, head = urlretrieve(_DATA_GEN_HOSP, "data_generation_modify.py")
171
+ shutil.move(file_path, './model')
172
+
173
+ if not os.path.exists('./preprocessing/day_intervals_preproc/day_intervals_cohort_v22.py'):
174
+ file_path, head = urlretrieve(_DAY_INT, "day_intervals_cohort_v22.py")
175
+ shutil.move(file_path, './preprocessing/day_intervals_preproc')
176
 
177
  data_dir = "./data/dict/"+self.config.name.replace(" ","_")+"/dataDic"
178
  sys.path.append(path_bench)