Commit d49636a3 authored by lintangsutawika's avatar lintangsutawika
Browse files

brier score is working for N-sized class

parent a76754ff
......@@ -109,12 +109,10 @@ def ter(items):
@register_aggregation("brier_score")
def brier_score(items): # This is a passthrough function
gold = list(zip(*items))[0]
gold_one_hot = np.eye(max(gold)+1)[gold]
gold, predictions = list(zip(*items))
gold = list(gold)
gold_one_hot = np.eye(np.max(gold)+1)[gold]
predictions = list(zip(*items))[1]
print("predictions", prediction)
print("gold_one_hot", gold_one_hot)
import sys; sys.exit()
return np.mean(np.sum((predictions - gold_one_hot)**2, axis=1))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment