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

Function classification_rate

ann_class/backprop.py:27–34  ·  view source on GitHub ↗
(Y, P)

Source from the content-addressed store, hash-verified

25# determine the classification rate
26# num correct / num total
27def classification_rate(Y, P):
28 n_correct = 0
29 n_total = 0
30 for i in range(len(Y)):
31 n_total += 1
32 if Y[i] == P[i]:
33 n_correct += 1
34 return float(n_correct) / n_total
35
36
37def derivative_w2(Z, T, Y):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected