Utility Tools for Processing Bootstrap Results
The bootstrap output file can contain a lot of numbers and be scatter across different files. We need a tool to visualize, compare and rearrange the results in a desired format. Sometimes we want to visulize it as a graph.
Formatting Bootstrap Results as Tables
You can use the bootstrap_format.py script to convert bootstrap result files into well-formatted tables (Excel-like). This script is available in the MR_SCRIPTS repository and should be accessible in your PATH under the Python-scripts directory of MR_Scripts.
Basic usage:
Key options:
- Specify one or more bootstrap result files and assign each a name.
- Filter cohorts using the
--cohorts_listregex (use.to include all). - Select which measurements to extract with
--measure_regex(e.g.,AUC|SENS@FPR). - Control table layout with
--table_format. There are three dimensions:r: report (the result file, e.g., baseline or MES_Full)c: cohort (multiple cohorts per file)m: measurement (e.g., AUC, SENS@FPR_05) Specify the three characters, separated by a comma, to map dimensions to rows and columns. One token will have two characters, expanding all combinations (Cartesian product) and using$as a delimiter. For example,cm,rmeans rows are cohort × measurement, columns are reports.
Additional arguments:
--break_cols: Splits cohort filters into separate columns (default behavior).--break_mes: Splits measurement values (e.g.,8.4[7.8 - 9.2]) into three columns: Mean, Min, Max.--output_path: Save the results as a CSV file.
Example output (without --break_cols):
With --break_cols (default):
Plotting Graphs from Bootstrap Results
To generate graphs (such as ROC curves) from bootstrap result files, use the plt_bt.py script:
SENS@FPR as the measure.