MCPcopy Create free account
hub / github.com/THUDM/GLM / accuracy_metric

Function accuracy_metric

tasks/eval_utils.py:34–40  ·  view source on GitHub ↗
(predictions, labels, examples)

Source from the content-addressed store, hash-verified

32
33
34def accuracy_metric(predictions, labels, examples):
35 count = 0
36 num_predictions = max(len(predictions), 1)
37 assert len(predictions) == len(labels)
38 for prediction, label in zip(predictions, labels):
39 count += prediction == label
40 return count * 100.0 / num_predictions
41
42
43def f1_metric(predictions, labels, examples):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected