From 2763204aaf2b7a337a771b82ba28ecb6fc88722f Mon Sep 17 00:00:00 2001 From: abhirockraj Date: Mon, 22 May 2023 12:21:28 +0530 Subject: [PATCH] Update KNN.py Changed the spelling of vote from voye --- 01 KNN/KNN.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01 KNN/KNN.py b/01 KNN/KNN.py index d3063e0..69ae8d8 100644 --- a/01 KNN/KNN.py +++ b/01 KNN/KNN.py @@ -25,6 +25,6 @@ def _predict(self, x): k_indices = np.argsort(distances)[:self.k] k_nearest_labels = [self.y_train[i] for i in k_indices] - # majority voye + # majority vote most_common = Counter(k_nearest_labels).most_common() - return most_common[0][0] \ No newline at end of file + return most_common[0][0]