Created
October 20, 2022 13:32
-
-
Save alexcpn/bb2992532b09fce4186f37165b954914 to your computer and use it in GitHub Desktop.
List out wrongly and irightly classified classes
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
#--------------------------------------------------------------------------------------------- | |
# Populate the Confusion Matrix | |
#--------------------------------------------------------------------------------------------- | |
for key,val in wrong_per_class.items(): # Key is category and val is a list of wrong classes | |
summed_wrong_classes =Counter(val).most_common() | |
print(f"**To Predict {categories[key]}") | |
for ele in summed_wrong_classes: | |
print(f" --Predicted {categories[ele[0]]} count={ele[1]}") | |
confusion_matrix[key][ele[0]]=ele[1] | |
for key,val in right_per_class.items(): # Key is category and val is a list of wrong classes | |
summed_right_classes =Counter(val).most_common() | |
print(f"**To Predict {categories[key]}") | |
for ele in summed_right_classes: | |
print(f" --Predicted {categories[ele[0]]} count={ele[1]}") | |
confusion_matrix[key][ele[0]]=ele[1] | |
print("Confusion Matrix2 =\n",confusion_matrix) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment