Spaces:
Sleeping
Sleeping
Update pages/4_Model Creation and Evaluation.py
Browse files
pages/4_Model Creation and Evaluation.py
CHANGED
|
@@ -278,10 +278,16 @@ svc_accuracy = accuracy_score(y_test, y_pred_svc)
|
|
| 278 |
# Display accuracy
|
| 279 |
st.write(f"Accuracy for SVC: {svc_accuracy:.2f}")
|
| 280 |
|
| 281 |
-
#
|
| 282 |
-
|
| 283 |
-
|
|
|
|
|
|
|
| 284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 285 |
# Compute confusion matrix
|
| 286 |
conf_matrix_svc = confusion_matrix(y_test, y_pred_svc)
|
| 287 |
st.write("Confusion Matrix for SVC:")
|
|
|
|
| 278 |
# Display accuracy
|
| 279 |
st.write(f"Accuracy for SVC: {svc_accuracy:.2f}")
|
| 280 |
|
| 281 |
+
# Generate classification report as a dictionary
|
| 282 |
+
report_dict = classification_report(y_test, y_pred_svc, output_dict=True)
|
| 283 |
+
|
| 284 |
+
# Convert to DataFrame
|
| 285 |
+
report_df = pd.DataFrame(report_dict).transpose()
|
| 286 |
|
| 287 |
+
# Display the classification report as a table
|
| 288 |
+
st.write("Classification Report for SVC:")
|
| 289 |
+
st.dataframe(report_df)
|
| 290 |
+
|
| 291 |
# Compute confusion matrix
|
| 292 |
conf_matrix_svc = confusion_matrix(y_test, y_pred_svc)
|
| 293 |
st.write("Confusion Matrix for SVC:")
|