(y_true, y_pred)
| 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 |