Every line of 'accuracy_score python' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
52 def test_accuracy(clf, X_test, y_test): 53 X_test = np.array([item for sublist in X_test for item in sublist]) 54 y_test = np.array([item for sublist in y_test for item in sublist]) 55 return clf.score(X_test, y_test)
114 def accuracy(y_test, y_pred): 115 """Computes the accuracy score. 116 117 Args: 118 y_test: np.array 1-D array of true class labels 119 y_pred: np.array 1-D array of predicted class labels 120 121 Returns: 122 accuracy: float 123 accuracy score 124 """ 125 return metrics.accuracy_score(y_test, y_pred)
29 def testAccuracy(data_test, label_test, kNN): 30 return kNN.score(data_test, label_test)