Advertisement
lessientelrunya

training

Jun 28th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. num = len(X_train) # Compute the number of points in X_train
  2. distance = np.zeros(num) # Initialize a numpy arrays of zeros
  3. for i in range(num):
  4.     distance[i] = dist(X_train[i], X_test) # Compute distance from X_train[i] to X_test
  5. print(distance)
  6. [ 3.60555128  1.80277564  2.8         3.39705755  5.83095189  4.47213595]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement