JERNGOC commited on
Commit
e03dfb5
·
verified ·
1 Parent(s): 751c133

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -91,8 +91,7 @@ if uploaded_file is not None:
91
  st.pyplot(fig)
92
 
93
  # ROC 曲線
94
- # 假設 2 是正標籤
95
- # 將 y_test 標籤轉換為 0 和 1
96
  y_test_binary = (y_test == 2).astype(int) # 假設 2 是正標籤
97
 
98
  # 計算 ROC 曲線
@@ -102,7 +101,6 @@ if uploaded_file is not None:
102
  fpr_vote, tpr_vote, _ = roc_curve(y_test_binary, y_pred_vote_proba)
103
  roc_auc_vote = auc(fpr_vote, tpr_vote)
104
 
105
-
106
  fig, ax = plt.subplots()
107
  ax.plot(fpr_stack, tpr_stack, color='blue', lw=2, label='堆疊分類器 (AUC = %0.2f)' % roc_auc_stack)
108
  ax.plot(fpr_vote, tpr_vote, color='red', lw=2, label='投票分類器 (AUC = %0.2f)' % roc_auc_vote)
@@ -113,4 +111,4 @@ if uploaded_file is not None:
113
  ax.set_ylabel('真陽性率(True Positive Rate)')
114
  ax.set_title('ROC 曲線')
115
  ax.legend(loc="lower right")
116
- st.pyplot(fig)
 
91
  st.pyplot(fig)
92
 
93
  # ROC 曲線
94
+ # y_test 標籤轉換為 0 和 1
 
95
  y_test_binary = (y_test == 2).astype(int) # 假設 2 是正標籤
96
 
97
  # 計算 ROC 曲線
 
101
  fpr_vote, tpr_vote, _ = roc_curve(y_test_binary, y_pred_vote_proba)
102
  roc_auc_vote = auc(fpr_vote, tpr_vote)
103
 
 
104
  fig, ax = plt.subplots()
105
  ax.plot(fpr_stack, tpr_stack, color='blue', lw=2, label='堆疊分類器 (AUC = %0.2f)' % roc_auc_stack)
106
  ax.plot(fpr_vote, tpr_vote, color='red', lw=2, label='投票分類器 (AUC = %0.2f)' % roc_auc_vote)
 
111
  ax.set_ylabel('真陽性率(True Positive Rate)')
112
  ax.set_title('ROC 曲線')
113
  ax.legend(loc="lower right")
114
+ st.pyplot(fig)