thbndi commited on
Commit
b1f407e
·
1 Parent(s): 417795a

Update cohort.py

Browse files
Files changed (1) hide show
  1. cohort.py +3 -16
cohort.py CHANGED
@@ -7,7 +7,7 @@ import shutil
7
  import time
8
  import yaml
9
 
10
- def task_cohort(task,mimic_path,path_benchmark):
11
  root_dir = path_benchmark
12
  sys.path.append(path_benchmark+'/preprocessing/day_intervals_preproc')
13
  sys.path.append(path_benchmark+'/utils')
@@ -21,21 +21,8 @@ def task_cohort(task,mimic_path,path_benchmark):
21
  version = version_path.split('/')[-1][0]
22
  start = time.time()
23
  #----------------------------------------------config----------------------------------------------------
24
- if task=='Mortality':
25
- with open('./config/mortality.config') as f:
26
- config = yaml.safe_load(f)
27
-
28
- elif task == 'Phenotype':
29
- with open('./config/phenotype.config') as f:
30
- config = yaml.safe_load(f)
31
-
32
- elif task == 'Length of Stay':
33
- with open('./config/los.config') as f:
34
- config = yaml.safe_load(f)
35
-
36
- elif task == 'Readmission':
37
- with open('./config/readmission.config') as f:
38
- config = yaml.safe_load(f)
39
 
40
  disease_label = config['disease_label']
41
  tim = config['time']
 
7
  import time
8
  import yaml
9
 
10
+ def task_cohort(task,mimic_path,path_benchmark, config):
11
  root_dir = path_benchmark
12
  sys.path.append(path_benchmark+'/preprocessing/day_intervals_preproc')
13
  sys.path.append(path_benchmark+'/utils')
 
21
  version = version_path.split('/')[-1][0]
22
  start = time.time()
23
  #----------------------------------------------config----------------------------------------------------
24
+ with open(config) as f:
25
+ config = yaml.safe_load(f)
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  disease_label = config['disease_label']
28
  tim = config['time']