All problems
Error Bucket Analysis
Problem
Bucket errors by their gold label: count the misclassified examples per gold label.
Return only labels that have at least one error, and an empty dictionary when there are none.
Hint
Key the buckets by the gold label, not the prediction.
Test cases
case 1
in: [["a","b","c","a"],["a","c","c","b"]]
expected: {"b":1,"a":1}
case 2
in: [["a","b"],["a","b"]]
expected: {}
case 3
in: [[],[]]
expected: {}
case 4
in: [["x","y"],["y","x"]]
expected: {"x":1,"y":1}
Starter codePython
def error_bucket_analysis(gold_labels, predicted_labels):
# Your code here
pass4 test cases · run your code against them in the editor