def accuracy(conf_matrix):
total, correct = <NUM_LIT:0.0>, <NUM_LIT:0.0><EOL>for true_response, guess_dict in list(conf_matrix.items()):<EOL><INDENT>for guess, count in list(guess_dict.items()):<EOL><INDENT>if true_response == guess:<EOL><INDENT>correct += count<EOL><DEDENT>total += count<EOL><DEDENT><DEDENT>return correct/total<EOL>
Given a confusion matrix, returns the accuracy.
Accuracy Definition: http://research.ics.aalto.fi/events/eyechallenge2005/evaluation.shtml