tapios / risk-networks

Code for risk networks: a blend of compartmental models, graphs, data assimilation and semi-supervised learning
Other
2 stars 2 forks source link

Expt: choose Classifier thresholds for Infectious test , [Also fixes prevalence calculation] #167

Closed odunbar closed 3 years ago

odunbar commented 4 years ago

[Also fixes calculation of prevalence] We setup the test required to plot ROCs over a given experiment series for testing multiple % per day of infected. The idea is to generate the data once, then we can try different classifiers, metrics on the saved data easily. The plot tools I have written are to be used in conjunction with the way the outputs are stored in the batch script runs.

We have 4 files:

  1. Generating and saving relevant data in backward_forward_assimilation.py (and all subsidiary _*.py files)

  2. The batch script run_infectious_test_expt.sh runs backward_forward_assimilation.py for different infectious test configurations (different % per day)

  3. The tool roc_from_savedata.py plots all ROC curves from the saved data. . Easily modifiable for different classifiers, taken at different times in the series (currently at the end times)

  4. The tool tprplot_from_savedata.py plots all True Positive Rate vs Predicted Positive Fraction graphs from the save data. Same interface as with 3.

Output ROCs for an experiment (30 day run, 1000 nodes, 12 day spinup, 5 day DA sweep, 99% sensitivity, 99% specificity (noisy_measurement=True)) the graph markers indicate different threshold values (though many threshold values may take the same value) sum_randitest_Ionly

Output TPR vs PPF plots for the experiment tprplot_or_randitestIonly

odunbar commented 3 years ago

OK - So I have also incorporated Dima's latest PR with some spring cleaning:

The workhorse file is called:

There are 2 experiments with sbatch / script files, to call the above with in a job array with different parameters

I haven't changed the internals of the scripts so these should work as they did prior to the merging.

There are 3 postprocess files, which will run exactly on the stored outputs from a run_infectious_test_expt.sh

These are all useful for assessing the efficacy of our methods.