MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / process_results

Method process_results

test/general/lm_eval/tasks/mutual.py:86–92  ·  view source on GitHub ↗
(self, doc, results)

Source from the content-addressed store, hash-verified

84 return text
85
86 def process_results(self, doc, results):
87 gold = self.CHOICES.index(doc["answers"])
88 r4_1 = np.argmax(results) == gold # r4_1 = accuracy
89 ranks = sorted(results, reverse=True)
90 r4_2 = (ranks.index(results[gold]) == 1) + r4_1
91 mrr = 1.0 / (ranks.index(results[gold]) + 1) # `+ 1` for index offset
92 return {"r@1": r4_1, "r@2": r4_2, "mrr": mrr}
93
94 def aggregation(self):
95 return {"r@1": mean, "r@2": mean, "mrr": mean}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected