Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -519,30 +519,7 @@ with col3:
|
|
| 519 |
|
| 520 |
st.markdown('<div class="section-header">📊 VISUALIZAÇÕES DO MELHOR MODELO</div>', unsafe_allow_html=True)
|
| 521 |
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
y_pred = modelo_final.predict(X_final)
|
| 525 |
-
|
| 526 |
-
cm = confusion_matrix(y_res, y_pred)
|
| 527 |
-
|
| 528 |
-
disp = ConfusionMatrixDisplay(confusion_matrix=cm)
|
| 529 |
-
disp.plot()
|
| 530 |
-
|
| 531 |
-
plt.title("Matriz de Confusão – Após SMOTE + RFE")
|
| 532 |
-
plt.show()
|
| 533 |
-
|
| 534 |
-
from sklearn.metrics import RocCurveDisplay, roc_auc_score
|
| 535 |
-
|
| 536 |
-
y_prob = modelo_final.predict_proba(X_final)[:, 1]
|
| 537 |
-
|
| 538 |
-
RocCurveDisplay.from_predictions(y_res, y_prob)
|
| 539 |
-
plt.title("Curva ROC – Após SMOTE + RFE")
|
| 540 |
-
plt.show()
|
| 541 |
-
|
| 542 |
-
auc = roc_auc_score(y_res, y_prob)
|
| 543 |
-
print("AUC:", auc)
|
| 544 |
-
|
| 545 |
-
'''col1, col2 = st.columns(2)
|
| 546 |
|
| 547 |
with col1:
|
| 548 |
st.subheader("📈 Curva ROC")
|
|
@@ -639,7 +616,7 @@ with col2:
|
|
| 639 |
# Relatório de classificação
|
| 640 |
with st.expander("📋 Relatório de Classificação Detalhado"):
|
| 641 |
st.text(classification_report(y_test, best_model['y_pred'],
|
| 642 |
-
target_names=['Não Reclamou', 'Reclamou']))
|
| 643 |
|
| 644 |
# =============================================================================
|
| 645 |
# I.d) SENSIBILIDADE AOS HIPERPARÂMETROS
|
|
|
|
| 519 |
|
| 520 |
st.markdown('<div class="section-header">📊 VISUALIZAÇÕES DO MELHOR MODELO</div>', unsafe_allow_html=True)
|
| 521 |
|
| 522 |
+
col1, col2 = st.columns(2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 523 |
|
| 524 |
with col1:
|
| 525 |
st.subheader("📈 Curva ROC")
|
|
|
|
| 616 |
# Relatório de classificação
|
| 617 |
with st.expander("📋 Relatório de Classificação Detalhado"):
|
| 618 |
st.text(classification_report(y_test, best_model['y_pred'],
|
| 619 |
+
target_names=['Não Reclamou', 'Reclamou']))
|
| 620 |
|
| 621 |
# =============================================================================
|
| 622 |
# I.d) SENSIBILIDADE AOS HIPERPARÂMETROS
|