pantdipendra commited on
Commit
6db7f5e
·
verified ·
1 Parent(s): 54cc11a

plot, ok and bad mental status label

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -320,7 +320,7 @@ def predict(
320
  # 'probs' is a list of arrays; each array is the prob for class=2 from each model.
321
  sum_prob_2 = sum(prob[0] for prob in probs if not np.isnan(prob[0]))
322
  sum_prob_1 = sum((1 - prob[0]) for prob in probs if not np.isnan(prob[0]))
323
- severity_msg = f"{severity_base} (Sum of Prob=1={sum_prob_1:.2f}, Prob=2={sum_prob_2:.2f})"
324
 
325
  # 4) Summarize predictions (with probabilities)
326
  label_prediction_info = {}
@@ -358,11 +358,11 @@ def predict(
358
  else:
359
  if pred_val == 2:
360
  # Probability of class=2
361
- text_prob = f"(Prob= {prob_val_for_2:.2f} for predicted class=2)"
362
  else:
363
  # Probability of class=1
364
  prob_of_1 = 1 - prob_val_for_2
365
- text_prob = f"(Prob= {prob_of_1:.2f} for predicted class=1)"
366
 
367
  # If pred_val is 1 or 2, we have a mapping
368
  if lbl in predictor.prediction_map and pred_val in [1, 2]:
 
320
  # 'probs' is a list of arrays; each array is the prob for class=2 from each model.
321
  sum_prob_2 = sum(prob[0] for prob in probs if not np.isnan(prob[0]))
322
  sum_prob_1 = sum((1 - prob[0]) for prob in probs if not np.isnan(prob[0]))
323
+ severity_msg = f"{severity_base} (Sum of Prob (Bad Mental Status)={sum_prob_1:.2f}, Prob (Ok Mental Status)={sum_prob_2:.2f})"
324
 
325
  # 4) Summarize predictions (with probabilities)
326
  label_prediction_info = {}
 
358
  else:
359
  if pred_val == 2:
360
  # Probability of class=2
361
+ text_prob = f"(Prob= {prob_val_for_2:.2f} for predicted class = Ok Mental Status)"
362
  else:
363
  # Probability of class=1
364
  prob_of_1 = 1 - prob_val_for_2
365
+ text_prob = f"(Prob= {prob_of_1:.2f} for predicted class = Bad Mental Status)"
366
 
367
  # If pred_val is 1 or 2, we have a mapping
368
  if lbl in predictor.prediction_map and pred_val in [1, 2]: