Update my_pages/multiverse.py
Browse files- my_pages/multiverse.py +6 -2
my_pages/multiverse.py
CHANGED
|
@@ -297,11 +297,15 @@ def render():
|
|
| 297 |
|
| 298 |
### Main Code Starts Here
|
| 299 |
scaler, feature_sel, arch, seed = selected_path[0], selected_path[1], selected_path[2], int(selected_path[3])
|
|
|
|
| 300 |
all_preds_numpy = np.load("all_predictions.npy")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 301 |
|
| 302 |
-
uniq_perc = 10.5
|
| 303 |
add_red_text(f"""
|
| 304 |
-
<b>Multiplicity of your predictions:</b> Your chosen model rejected {uniq_perc}% loans that would have been accepted by more than
|
| 305 |
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>
|
| 306 |
On the other hand, you might instead want lower multiplicity, to take lower risks and to avoid facing a justification crisis, i.e.,
|
| 307 |
not able to explain why you rejected certain applicants when they were accepted by everyone else.<br><br>
|
|
|
|
| 297 |
|
| 298 |
### Main Code Starts Here
|
| 299 |
scaler, feature_sel, arch, seed = selected_path[0], selected_path[1], selected_path[2], int(selected_path[3])
|
| 300 |
+
y_pred = model_train_and_pred(scaler, feature_sel, arch, seed)
|
| 301 |
all_preds_numpy = np.load("all_predictions.npy")
|
| 302 |
+
|
| 303 |
+
prop_ones = np.mean(all_preds == 1, axis=0)
|
| 304 |
+
condition = (y_pred == 0) & (prop_ones >= 0.8)
|
| 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>
|