class_docstr: K Nearest Neighbors classifier.
  
  Parameters:
  -----------
  k: int
      The number of closest neighbors that will determine the class of the 
      sample that we wish to predict.
code: def predict(self, X_test, X_train, y_train):
      y_pred = np.empty(X_test.shape[0])
      # Determine the class of each sample
      for i, test_sample in enumerate(X_test):
          # Sort the training samples by their distance to the test sample and get the K nearest
          idx = np.argsort(
              [euclidean_distance(test_sample, x) for x in X_train]
          )[: self.k]
          # Extract the labels of the K nearest neighboring training samples
          k_nearest_neighbors = np.array([y_train[i] for i in idx])
          # Label sample as the most common class label
          y_pred[i] = self._vote(k_nearest_neighbors)
  
      return y_pred
  
imports: from __future__ import print_function, division
  import numpy
  from mlfromscratch.utils import euclidean_distance
label_desc: Use image node_id 3 for calling the KNN obj's underlying member method code with example usage: obj.predict(X_test, X_train, y_train) and returns: y_pred