Commit 0ab3ddee authored by owenwoodberry's avatar owenwoodberry

updates to progression models

parent 2c99816f
......@@ -370,7 +370,7 @@ def chkerr():
env = g.NewNeticaEnviron_ns(license, None, None)
g.LimitMemoryUsage_ns(70000000, env)
g.LimitMemoryUsage_ns(7000000000, env)
mesg = msgBuf()
g.InitNetica2_bn(env, mesg)
ErrorCheckingOn = True
......
......@@ -137,7 +137,7 @@ def appendDayPhase(casefile, outFn = None, sepType = ','):
with open(outfn, mode='w', newline ='') as out_file:
fieldnames = reader.fieldnames#'bl_admission bl_ucstartday bl_costartday bl_crstartday bl_restartday bl_lastknownstatus bl_duration_inpatientstay'.split(' ') # bl_duration_icustay bl_duration_ventilation bl_observationalperiod
writer = csv.DictWriter(out_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL, fieldnames=fieldnames+'ci_d0 ci_d1 ci_d5 ci_d10 ci_death'.split(' '))
writer = csv.DictWriter(out_file, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL, fieldnames=fieldnames+'ci_d10 ci_d20 ci_death'.split(' '))
writer.writeheader()
for row in reader:
......@@ -150,10 +150,11 @@ def appendDayPhase(casefile, outFn = None, sepType = ','):
if not is_digit(row[ele]) or row[ele] == '-99' or row[ele] == '-66':
row[ele] = ''
out['ci_d0'] = getPhase(row, 0)
out['ci_d1'] = getPhase(row, 1)
out['ci_d5'] = getPhase(row, 5)
#out['ci_d0'] = getPhase(row, 0)
#out['ci_d1'] = getPhase(row, 1)
#out['ci_d5'] = getPhase(row, 5)
out['ci_d10'] = getPhase(row, 10)
out['ci_d20'] = getPhase(row, 20)
out['ci_death'] = getDeath(row)
writer.writerow(out)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -91,8 +91,8 @@
<cpt id="ci_end_organ_perf_bl">
<state id="low" />
<state id="normal" />
<parents>func_vas_bl</parents>
<probabilities>0.1341681574239714 0.8658318425760286 0.1341681574239714 0.8658318425760286 0.5 0.5</probabilities>
<parents>func_vas_bl ci_coagulation_bl</parents>
<probabilities>0.1341681574239714 0.8658318425760286 0.1341681574239714 0.8658318425760286 0.1341681574239714 0.8658318425760286 0.1341681574239714 0.8658318425760286 0.5 0.5 0.5 0.5</probabilities>
</cpt>
<cpt id="func_pul_bl">
<state id="State0" />
......@@ -110,8 +110,8 @@
<state id="verylow" />
<state id="low" />
<state id="normal" />
<parents>func_pul_bl ci_ventilator_bl</parents>
<probabilities>0 0.5511945392491467 0.4488054607508533 0 0.5511945392491467 0.4488054607508533 0 0.5511945392491467 0.4488054607508533 0 0.5511945392491467 0.4488054607508533 0 0.5 0.5 0 0.5 0.5</probabilities>
<parents>func_pul_bl</parents>
<probabilities>0 0.5511945392491467 0.4488054607508533 0 0.5511945392491467 0.4488054607508533 0 0.5 0.5</probabilities>
</cpt>
<cpt id="ci_intravas_volume_bl">
<state id="low" />
......@@ -182,7 +182,7 @@
<state id="verylow" />
<state id="low" />
<state id="normal" />
<parents>func_pul_day10 ci_ventilator_day10</parents>
<parents>func_pul_day10 ci_ventilator_bl</parents>
<probabilities>0 0.7142857142857142 0.2857142857142858 0 0.7142857142857142 0.2857142857142858 0 0.7142857142857142 0.2857142857142858 0 0.7142857142857142 0.2857142857142858 0 0.5 0.5 0 0.5 0.5</probabilities>
</cpt>
<cpt id="ci_intravas_volume_day10">
......@@ -201,8 +201,8 @@
<cpt id="ci_death_day10">
<state id="FALSE" />
<state id="TRUE" />
<parents>func_car_day10 func_pul_day10 func_vas_day10</parents>
<probabilities>0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5</probabilities>
<parents>func_car_day10 func_pul_day10 func_vas_day10 ci_sys_immune_resp_day10</parents>
<probabilities>0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.8112522686025408 0.1887477313974592 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5</probabilities>
</cpt>
<cpt id="ci_cardiac_output_day10">
<state id="high" />
......@@ -281,7 +281,7 @@
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>511 211 612 274</position>
<position>510 211 611 274</position>
</node>
<node id="ci_anticoag_treat_day10">
<name>anticoag day10</name>
......@@ -421,7 +421,7 @@
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>433 393 534 456</position>
<position>435 333 536 396</position>
</node>
<node id="ci_sys_immune_resp_day10">
<name>immune resp day10</name>
......@@ -456,7 +456,7 @@
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>487 359 588 422</position>
<position>487 363 588 426</position>
</node>
<node id="ci_intravas_volume_bl">
<name>intravas volume bl</name>
......@@ -477,21 +477,21 @@
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>283 359 384 422</position>
<position>283 363 384 426</position>
</node>
<node id="func_vas_bl">
<name>organ function bl</name>
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>190 169 291 232</position>
<position>244 169 345 232</position>
</node>
<node id="func_vas_day10">
<name>organ function day10</name>
<interior color="e5f6f7" />
<outline color="000080" />
<font color="000000" name="Arial" size="8" />
<position>394 169 495 232</position>
<position>448 169 549 232</position>
</node>
</submodel>
</genie>
......
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
{"clean": 16.265784978866577, "validations.py": 671.5823709964752, "doMakeBnSafe": 29.64663553237915, "make_nb.py": 77.91760206222534, "['make_progression.py', 'uc']": 363.57457184791565, "['make_progression.py', '5day']": 2255.9283072948456}
\ No newline at end of file
{"clean": 14.085067510604858, "validations.py": 671.5823709964752, "doMakeBnSafe": 38.70867991447449, "make_nb.py": 77.91760206222534, "['make_progression.py', 'uc']": 363.57457184791565, "['make_progression.py', '5day']": 2255.9283072948456}
\ No newline at end of file
......@@ -20,8 +20,5 @@ def trainProgression(netFn, dataFn):
toc = time.process_time()
print('time= '+str(toc - tic))
#trainProgression('bns/progression/progression_uc.xdsl', 'data/LEOSS_encoded_data_clean_trim.csv')
trainProgression('bns/progression/progression_day5.xdsl', 'data/LEOSS_encoded_data_clean_trim.csv')
trainProgression('bns/progression/progression_day10.xdsl', 'data/LEOSS_encoded_data_clean_trim.csv')
trainProgression('bns/progression/progression_latent_day5.xdsl', 'data/LEOSS_encoded_data_clean_trim.csv')
trainProgression('bns/progression/progression_latent_day10.xdsl', 'data/LEOSS_encoded_data_clean_trim.csv')
......@@ -220,54 +220,42 @@ def addCalculatedFields(row):
# row['ci_death_symp_uc'] = '*'
phase1 = row[f'ci_d1']
phase5 = row[f'ci_d5']
phase10 = row[f'ci_d5']
phase10 = row[f'ci_d10']
phase20 = row[f'ci_d20']
row[f'ci_death_day1'] = row['ci_death'] == row['ci_d1'] if row['ci_death'] != '*' else '*'
row[f'ci_death_day5'] = row['ci_death'] == row['ci_d5'] if row['ci_death'] != '*' else '*'
row[f'ci_death_day10'] = row['ci_death'] == row['ci_d10'] if row['ci_death'] != '*' else '*'
row[f'ci_death_day20'] = row['ci_death'] == row['ci_d20'] if row['ci_death'] != '*' else '*'
row[f'ci_hypoxaemia_day1'] = row[f'ci_hypoxaemia_{phase1}']
row[f'ci_hypoxaemia_day5'] = row[f'ci_hypoxaemia_{phase5}']
row[f'ci_hypoxaemia_day10'] = row[f'ci_hypoxaemia_{phase10}']
row[f'ci_hypoxaemia_day20'] = row[f'ci_hypoxaemia_{phase20}']
row[f'ci_cardiac_output_day1'] = row[f'ci_cardiac_output_{phase1}']
row[f'ci_cardiac_output_day5'] = row[f'ci_cardiac_output_{phase5}']
row[f'ci_cardiac_output_day10'] = row[f'ci_cardiac_output_{phase10}']
row[f'ci_cardiac_output_day20'] = row[f'ci_cardiac_output_{phase20}']
row[f'ci_coagulation_day1'] = row[f'ci_coagulation_{phase1}']
row[f'ci_coagulation_day5'] = row[f'ci_coagulation_{phase5}']
row[f'ci_coagulation_day10'] = row[f'ci_coagulation_{phase10}']
row[f'ci_coagulation_day20'] = row[f'ci_coagulation_{phase20}']
row[f'ci_intravas_volume_day1'] = row[f'ci_intravas_volume_{phase1}']
row[f'ci_intravas_volume_day5'] = row[f'ci_intravas_volume_{phase5}']
row[f'ci_intravas_volume_day10'] = row[f'ci_intravas_volume_{phase10}']
row[f'ci_intravas_volume_day20'] = row[f'ci_intravas_volume_{phase20}']
row[f'ci_end_organ_perf_day1'] = row[f'ci_end_organ_perf_{phase1}']
row[f'ci_end_organ_perf_day5'] = row[f'ci_end_organ_perf_{phase5}']
row[f'ci_end_organ_perf_day10'] = row[f'ci_end_organ_perf_{phase10}']
row[f'ci_end_organ_perf_day20'] = row[f'ci_end_organ_perf_{phase20}']
row[f'ci_sys_immune_resp_day1'] = row[f'ci_sys_immune_resp_{phase1}']
row[f'ci_sys_immune_resp_day5'] = row[f'ci_sys_immune_resp_{phase5}']
row[f'ci_sys_immune_resp_day10'] = row[f'ci_sys_immune_resp_{phase10}']
row[f'ci_sys_immune_resp_day20'] = row[f'ci_sys_immune_resp_{phase20}']
row[f'ci_ventilator_day1'] = row[f'ci_ventilator_{phase1}']
row[f'ci_ventilator_day5'] = row[f'ci_ventilator_{phase5}']
row[f'ci_ventilator_day10'] = row[f'ci_ventilator_{phase10}']
row[f'ci_ventilator_day20'] = row[f'ci_ventilator_{phase20}']
row[f'ci_antiviral_treat_day1'] = row[f'ci_antiviral_treat_{phase1}']
row[f'ci_antiviral_treat_day5'] = row[f'ci_antiviral_treat_{phase5}']
row[f'ci_antiviral_treat_day10'] = row[f'ci_antiviral_treat_{phase10}']
row[f'ci_antiviral_treat_day20'] = row[f'ci_antiviral_treat_{phase20}']
row[f'ci_anticoag_treat_day1'] = row[f'ci_anticoag_treat_{phase1}']
row[f'ci_anticoag_treat_day5'] = row[f'ci_anticoag_treat_{phase5}']
row[f'ci_anticoag_treat_day10'] = row[f'ci_anticoag_treat_{phase10}']
row[f'ci_anticoag_treat_day20'] = row[f'ci_anticoag_treat_{phase20}']
row[f'ci_antiinflam_treat_day1'] = row[f'ci_antiinflam_treat_{phase1}']
row[f'ci_antiinflam_treat_day5'] = row[f'ci_antiinflam_treat_{phase5}']
row[f'ci_antiinflam_treat_day10'] = row[f'ci_antiinflam_treat_{phase10}']
row[f'ci_antiinflam_treat_day20'] = row[f'ci_antiinflam_treat_{phase20}']
# Clean data
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment