Last active
March 2, 2022 17:31
-
-
Save AI-MOO/fea29026428030c5551dcbee749f50cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# استدعاء دوال لقياس أداء النموذج | |
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report | |
# دالة طباعة تقرير أداء نموذج التصنيف | |
def print_score(clf, X_test, y_test): | |
pred = clf.predict(X_test) | |
clf_report = pd.DataFrame(classification_report(y_test, pred, output_dict=True)) | |
print("_______________________________________________") | |
print(f"Accuracy Score: {accuracy_score(y_test, pred) * 100:.2f}%") | |
print("_______________________________________________") | |
print(f"CLASSIFICATION REPORT:\n{clf_report}") | |
print("_______________________________________________") | |
print(f"Confusion Matrix: \n {confusion_matrix(y_test, pred)}\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment