Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -241,7 +241,7 @@ def visualize_ROC(set_threshold,set_input):
|
|
| 241 |
x = np.linspace(0, 1, 500)
|
| 242 |
|
| 243 |
plt.plot(thres_list, f1_score_list, label = 'F1-score', c='black', linestyle='-')
|
| 244 |
-
plt.plot(thres_list, g_mean_list, label = 'G-mean', c='
|
| 245 |
|
| 246 |
plt.xlim(0, 1)
|
| 247 |
plt.ylim(0, 1)
|
|
@@ -259,8 +259,9 @@ def visualize_ROC(set_threshold,set_input):
|
|
| 259 |
ax.spines['bottom'].set_color('black')
|
| 260 |
ax.spines['top'].set_color('black')
|
| 261 |
ax.spines['right'].set_color('black')
|
| 262 |
-
plt.xlabel('
|
| 263 |
-
plt.ylabel('
|
|
|
|
| 264 |
plt.text(set_threshold, f1_score_cur, 'F1-score:%s, G-mean:%s' % (round(f1_score_cur,2),round(g_mean_cur,2)))
|
| 265 |
plt.title("Threshold tuning curves (F1-score & G-mean)", fontsize=20)
|
| 266 |
plt.tight_layout()
|
|
|
|
| 241 |
x = np.linspace(0, 1, 500)
|
| 242 |
|
| 243 |
plt.plot(thres_list, f1_score_list, label = 'F1-score', c='black', linestyle='-')
|
| 244 |
+
plt.plot(thres_list, g_mean_list, label = 'G-mean', c='red', linestyle='-')
|
| 245 |
|
| 246 |
plt.xlim(0, 1)
|
| 247 |
plt.ylim(0, 1)
|
|
|
|
| 259 |
ax.spines['bottom'].set_color('black')
|
| 260 |
ax.spines['top'].set_color('black')
|
| 261 |
ax.spines['right'].set_color('black')
|
| 262 |
+
plt.xlabel('Threshold cut-off')
|
| 263 |
+
plt.ylabel('F1-score & G-mean')
|
| 264 |
+
plt.legend()
|
| 265 |
plt.text(set_threshold, f1_score_cur, 'F1-score:%s, G-mean:%s' % (round(f1_score_cur,2),round(g_mean_cur,2)))
|
| 266 |
plt.title("Threshold tuning curves (F1-score & G-mean)", fontsize=20)
|
| 267 |
plt.tight_layout()
|