def compute_distances_no_loops(self, X):
    '\n        Compute the distance between each test point in X and each training point\n        in self.X_train using no explicit loops.\n\n        Input / Output: Same as compute_distances_two_loops\n        '
    num_test = X.shape[0]
    num_train = self.X_train.shape[0]
    dists = np.zeros((num_test, num_train))
    dists = np.sqrt(np.sum(((self.X_train[np.newaxis, :] - X[np.newaxis, :].reshape((num_test, 1, X.shape[1]))) ** 2), 2))
    pass
    return dists
Compute the distance between each test point in X and each training point
in self.X_train using no explicit loops.

Input / Output: Same as compute_distances_two_loops
def compute_distances_no_loops(self, X):
    '\n        Compute the distance between each test point in X and each training point\n        in self.X_train using no explicit loops.\n\n        Input / Output: Same as compute_distances_two_loops\n        '
    num_test = X.shape[0]
    num_train = self.X_train.shape[0]
    dists = np.zeros((num_test, num_train))
    dists = np.sqrt(np.sum(((self.X_train[np.newaxis, :] - X[np.newaxis, :].reshape((num_test, 1, X.shape[1]))) ** 2), 2))
    pass
    return dists