MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / accuracy

Function accuracy

nlp_class2/pos_hmm.py:24–31  ·  view source on GitHub ↗
(T, Y)

Source from the content-addressed store, hash-verified

22
23
24def accuracy(T, Y):
25 # inputs are lists of lists
26 n_correct = 0
27 n_total = 0
28 for t, y in zip(T, Y):
29 n_correct += np.sum(t == y)
30 n_total += len(y)
31 return float(n_correct) / n_total
32
33
34def total_f1_score(T, Y):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected