@@ -357,9 +357,10 @@ def update_output_div(index, pos_label):
357357 preds_df = self .explainer .prediction_result_df (index , round = self .round , logodds = True )
358358 preds_df .probability = np .round (100 * preds_df .probability .values , self .round ).astype (str )
359359 preds_df .probability = preds_df .probability + ' %'
360- preds_df .logodds = np .round (preds_df .logodds .values , self .round ).astype (str )
360+ if 'logodds' in preds_df .columns :
361+ preds_df .logodds = np .round (preds_df .logodds .values , self .round ).astype (str )
361362
362- if self .explainer .model_output != 'logodds' :
363+ if self .explainer .model_output != 'logodds' :
363364 preds_df = preds_df [['label' , 'probability' ]]
364365
365366 preds_table = dbc .Table .from_dataframe (preds_df ,
@@ -379,7 +380,8 @@ def update_output_div(pos_label, *inputs):
379380 preds_df = self .explainer .prediction_result_df (X_row = X_row , round = self .round , logodds = True )
380381 preds_df .probability = np .round (100 * preds_df .probability .values , self .round ).astype (str )
381382 preds_df .probability = preds_df .probability + ' %'
382- preds_df .logodds = np .round (preds_df .logodds .values , self .round ).astype (str )
383+ if 'logodds' in preds_df .columns :
384+ preds_df .logodds = np .round (preds_df .logodds .values , self .round ).astype (str )
383385
384386 if self .explainer .model_output != 'logodds' :
385387 preds_df = preds_df [['label' , 'probability' ]]
@@ -527,7 +529,8 @@ def layout(self):
527529 marks = {0.01 : '0.01' , 0.25 : '0.25' , 0.50 : '0.50' ,
528530 0.75 : '0.75' , 0.99 : '0.99' },
529531 included = False ,
530- tooltip = {'always_visible' : False }),
532+ tooltip = {'always_visible' : False },
533+ updatemode = 'drag' ),
531534 ], id = 'precision-cutoff-div-' + self .name ),
532535 dbc .Tooltip (f"Scores above this cutoff will be labeled positive" ,
533536 target = 'precision-cutoff-div-' + self .name ,
0 commit comments