Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. def calc_accuracy(confusion_matrix1,class_num):
  2. print(confusion_matrix1)
  3. TP = confusion_matrix1[class_num,class_num]
  4. TN = 0.0
  5. print(Total)
  6. for line in confusion_matrix1:
  7. for elem in line:
  8. Total += elem
  9.  
  10. aux_cm = np.delete(confusion_matrix1, class_num, 0)
  11.  
  12. for line in aux_cm:
  13. for elem in line:
  14. TN += elem
  15. print(TN)
  16. print(((TP + TN)/ Total)*100)
  17. return ((TP + TN)/ Total)*100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement