35 lines
1.9 KiB
Python
Executable File
35 lines
1.9 KiB
Python
Executable File
from umcglib.froc import calculate_froc, plot_froc, plot_multiple_roc, partial_auc, plot_multiple_froc
|
|
from sfransen.utils_quintin import *
|
|
import numpy as np
|
|
|
|
experiment_path1 = './train_output/calc_exp_t2_b1400calc_adccalc_4/umcglib_stats_overlap_0.01.yml'
|
|
experiment_path2 = './train_output/calc_exp_t2_b1400calc2_adccalc2_4/umcglib_stats_overlap_0.01.yml'
|
|
experiment_path3 = './train_output/calc_exp_t2_b1400calc3_adccalc3_4/umcglib_stats_overlap_0.01.yml'
|
|
|
|
## !!!!!!!!!!!!!!!!!!
|
|
stats2 = read_yaml_to_dict(experiment_path1)
|
|
stats1 = read_yaml_to_dict(experiment_path2)
|
|
stats3 = read_yaml_to_dict(experiment_path3)
|
|
|
|
plot_multiple_froc(
|
|
sensitivities=[np.array(stats1['sensitivity']),np.array(stats2['sensitivity']),np.array(stats3['sensitivity'])],
|
|
fp_per_patient=[np.array(stats1["fp_per_patient"]),np.array(stats2["fp_per_patient"]),np.array(stats3["fp_per_patient"])],
|
|
ci_low=[np.array(stats1['sens_95_boot_ci_low']),np.array(stats2['sens_95_boot_ci_low']),np.array(stats3['sens_95_boot_ci_low'])],
|
|
ci_high=[np.array(stats1["sens_95_boot_ci_high"]),np.array(stats2["sens_95_boot_ci_high"]),np.array(stats3["sens_95_boot_ci_high"])],
|
|
model_names=["b50-400","b50-800","b50-400-800"],
|
|
title="fROC plot",
|
|
height=12, width=15,
|
|
xlims=(0.1, 5.0),
|
|
save_as="fROC_overlap_0.01.png")
|
|
|
|
plot_multiple_roc(
|
|
tpr=[np.array(stats1['roc_tpr']),np.array(stats2['roc_tpr']),np.array(stats3['roc_tpr'])],
|
|
fpr=[np.array(stats1["roc_fpr"]),np.array(stats2["roc_fpr"]),np.array(stats3["roc_fpr"])],
|
|
ci_low=[np.array(stats1['sens_95_boot_ci_low_roc']),np.array(stats2['sens_95_boot_ci_low_roc']),np.array(stats3['sens_95_boot_ci_low_roc'])],
|
|
ci_high=[np.array(stats1["sens_95_boot_ci_high_roc"]),np.array(stats2["sens_95_boot_ci_high_roc"]),np.array(stats3["sens_95_boot_ci_high_roc"])],
|
|
model_names=["b50_400","b50_800","b50-400-800"],
|
|
title="ROC plot",
|
|
height=12, width=15,
|
|
save_as="ROC_overlap_0.01.png")
|
|
|