Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num = len(X_train) # Compute the number of points in X_train
- distance = np.zeros(num) # Initialize a numpy arrays of zeros
- for i in range(num):
- distance[i] = dist(X_train[i], X_test) # Compute distance from X_train[i] to X_test
- print(distance)
- [ 3.60555128 1.80277564 2.8 3.39705755 5.83095189 4.47213595]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement