@@ -254,7 +254,7 @@ def display_config_item(label, value):
254254 c5 .metric ("Avg Flips (Stability)" , f"{ np .mean (flips ):.1f} " )
255255
256256 with col2 :
257- # We recalculate to ensure valid_kpis is available for the plots
257+ # We recalculate to ensure valid_kpis_plot is available for the plots
258258 new_results = recalculate_all_kpis (mc_data , detection_threshold = threshold , fpr_offset_percent = fpr_offset )
259259 valid_kpis_plot : List [Dict [str , Any ]] = [k for k in new_results if k is not None ]
260260
@@ -288,8 +288,8 @@ def display_config_item(label, value):
288288
289289 with col_p1 :
290290 # Reliability Scatter
291- recalls = [k .get ("recall" , 0 ) for k in valid_kpis ]
292- precisions = [k .get ("precision" , 0 ) for k in valid_kpis ]
291+ recalls = [k .get ("recall" , 0 ) for k in valid_kpis_plot ]
292+ precisions = [k .get ("precision" , 0 ) for k in valid_kpis_plot ]
293293
294294 fig_rel = px .scatter (x = recalls , y = precisions , labels = {'x' : 'Recall (%)' , 'y' : 'Precision (%)' },
295295 title = "Reliability (Recall vs Precision)" , range_x = [- 5 , 105 ], range_y = [- 5 , 105 ])
@@ -299,7 +299,7 @@ def display_config_item(label, value):
299299
300300 with col_p2 :
301301 # TTD Histogram
302- ttds_flat = [k .get ("avg_ttd" ) for k in valid_kpis if k .get ("avg_ttd" ) is not None ]
302+ ttds_flat = [k .get ("avg_ttd" ) for k in valid_kpis_plot if k .get ("avg_ttd" ) is not None ]
303303 if ttds_flat :
304304 fig_ttd = px .histogram (x = ttds_flat , nbins = 15 , labels = {'x' : 'Steps' }, title = "Time to Detection Distribution" )
305305 st .plotly_chart (fig_ttd , width = 'stretch' )
@@ -308,7 +308,7 @@ def display_config_item(label, value):
308308
309309 with col_p3 :
310310 # FPR Histogram
311- fprs_flat = [k .get ("fpr" , 0 ) for k in valid_kpis ]
311+ fprs_flat = [k .get ("fpr" , 0 ) for k in valid_kpis_plot ]
312312 fig_fpr = px .histogram (x = fprs_flat , nbins = 15 , labels = {'x' : 'FPR (%)' }, title = "False Positive Rate Distribution" , color_discrete_sequence = ['salmon' ])
313313 st .plotly_chart (fig_fpr , width = 'stretch' )
314314
0 commit comments