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

Function accuracy

08 Perceptron/perceptron.py:51–53  ·  view source on GitHub ↗
(y_true, y_pred)

Source from the content-addressed store, hash-verified

49 from sklearn import datasets
50
51 def accuracy(y_true, y_pred):
52 accuracy = np.sum(y_true == y_pred) / len(y_true)
53 return accuracy
54
55 X, y = datasets.make_blobs(
56 n_samples=150, n_features=2, centers=2, cluster_std=1.05, random_state=2

Callers 1

perceptron.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected