I am interested in this course and also new to python. I try the first NN program but it is quite slow (mostly in the following loop).
# loop over all test rows
for i in xrange(num_test):
distances = np.sum(np.abs(self.Xtr - X[i,:]), axis = 1)
min_index = np.argmin(distances)
Ypred[i] = self.ytr[min_index]
Is there way to accelerate it?
Thanks.