From e0c31fb378baa0ab2fb1a3f85838329e16ac3ad7 Mon Sep 17 00:00:00 2001 From: Gab-Chung <110821471+Gab-Chung@users.noreply.github.com> Date: Wed, 5 Apr 2023 02:05:45 +0300 Subject: [PATCH] Update k_nearest_neighbor.py --- homeworks/assignment0_01_knn/k_nearest_neighbor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeworks/assignment0_01_knn/k_nearest_neighbor.py b/homeworks/assignment0_01_knn/k_nearest_neighbor.py index 57cc0c6ef..20d74a879 100644 --- a/homeworks/assignment0_01_knn/k_nearest_neighbor.py +++ b/homeworks/assignment0_01_knn/k_nearest_neighbor.py @@ -75,7 +75,7 @@ def compute_distances_two_loops(self, X): # not use a loop over dimension, nor use np.linalg.norm(). # ##################################################################### # *****START OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)***** - + dists = np.sqrt(np.sum(np.square(X[i] - self.X_train[j]), axis=1)) # *****END OF YOUR CODE (DO NOT DELETE/MODIFY THIS LINE)***** return dists