prakharg24 commited on
Commit
dd765d7
·
verified ·
1 Parent(s): f19a474

Update my_pages/multiverse.py

Browse files
Files changed (1) hide show
  1. my_pages/multiverse.py +9 -3
my_pages/multiverse.py CHANGED
@@ -301,11 +301,17 @@ def render():
301
  all_preds_numpy = np.load("all_predictions.npy")
302
 
303
  prop_ones = np.mean(all_preds_numpy == 1, axis=0)
304
- condition = (y_pred == 0) & (prop_ones > 0.5)
305
- uniq_perc = 100 * np.sum(condition) / len(y_pred)
 
 
 
 
 
306
 
307
  add_red_text(f"""
308
- <b>Multiplicity of your predictions:</b> Your chosen model rejected {uniq_perc}% loans that would have been accepted by more than 80% of the other models.<br><br>
 
309
  You might want higher multiplicity, to avoid competiting for the same loan applicants with others and to give a chance to unique applicants.<br><br>
310
  On the other hand, you might instead want lower multiplicity, to take lower risks and to avoid facing a justification crisis, i.e.,
311
  not able to explain why you rejected certain applicants when they were accepted by everyone else.<br><br>
 
301
  all_preds_numpy = np.load("all_predictions.npy")
302
 
303
  prop_ones = np.mean(all_preds_numpy == 1, axis=0)
304
+ condition_rej = (y_pred == 0) & (prop_ones > 0.5)
305
+ # uniq_perc = 100 * np.sum(condition) / len(y_pred)
306
+ uniq_count_rej = np.sum(condition_rej)
307
+
308
+
309
+ condition_acc = (y_pred == 1) & (prop_ones < 0.5)
310
+ uniq_count_acc = np.sum(condition_acc)
311
 
312
  add_red_text(f"""
313
+ <b>Multiplicity of your predictions:</b> Your chosen model rejected {uniq_count_rej} loans that would have been accepted by the majority of the other models.
314
+ Similariy, your chosen model accepted {uniq_count_acc} loans that would have been rejected by the majority of the other models.<br><br>
315
  You might want higher multiplicity, to avoid competiting for the same loan applicants with others and to give a chance to unique applicants.<br><br>
316
  On the other hand, you might instead want lower multiplicity, to take lower risks and to avoid facing a justification crisis, i.e.,
317
  not able to explain why you rejected certain applicants when they were accepted by everyone else.<br><br>