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

Function accuracy

05 Random Forests/train.py:15–17  ·  view source on GitHub ↗
(y_true, y_pred)

Source from the content-addressed store, hash-verified

13)
14
15def accuracy(y_true, y_pred):
16 accuracy = np.sum(y_true == y_pred) / len(y_true)
17 return accuracy
18
19clf = RandomForest(n_trees=20)
20clf.fit(X_train, y_train)

Callers 1

train.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected