Skip to content

Commit 5890a1a

Browse files
author
Julian Kates-Harbeck
committed
script to compare performance of two trained models
1 parent b795753 commit 5890a1a

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

examples/compare_performance.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,20 @@
4343
shots = analyzers[0].shot_list_test
4444

4545
for shot in shots:
46-
types = [analyzers[i].get_prediction_type_for_individual_shot(P_threshs[i],shot,mode='test') for i in range(len(analyzers))]
47-
#if len(set(types)) > 1:
48-
if types == ['TP','FN']:
49-
print(shot.number)
50-
print(types)
51-
for i,analyzer in enumerate(analyzers):
52-
analyzer.save_shot(shot,P_thresh_opt=P_threshs[i],extra_filename=['deep','shallow'][i])
46+
if all([(shot in analyzer.shot_list_test or shot in analyzer.shot_list_train) for analyzer in analyzers]):
47+
types = [analyzers[i].get_prediction_type_for_individual_shot(P_threshs[i],shot,mode='test') for i in range(len(analyzers))]
48+
#if len(set(types)) > 1:
49+
if types == ['TP','late']:
50+
if shot in analyzers[1].shot_list_test:
51+
print("TEST")
52+
else:
53+
print("TRAIN")
54+
print(shot.number)
55+
print(types)
56+
for i,analyzer in enumerate(analyzers):
57+
analyzer.save_shot(shot,P_thresh_opt=P_threshs[i],extra_filename=['1D','0D'][i])
58+
else:
59+
pass
60+
#print("shot {} not in train or test shot list (must be in validation)".format(shot))
5361

5462

0 commit comments

Comments
 (0)