MCPcopy Create free account
hub / github.com/AssemblyAI-Community/Machine-Learning-From-Scratch / accuracy

Function accuracy

04 Decision Trees/train.py:17–18  ·  view source on GitHub ↗
(y_test, y_pred)

Source from the content-addressed store, hash-verified

15predictions = clf.predict(X_test)
16
17def accuracy(y_test, y_pred):
18 return np.sum(y_test == y_pred) / len(y_test)
19
20acc = accuracy(y_test, predictions)
21print(acc)

Callers 1

train.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected