code: def main():
      data = datasets.load_iris()
      X = normalize(data.data)
      y = data.target
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, test_size=0.33
      )
  
      clf = KNN(k=5)
      y_pred = clf.predict(X_test, X_train, y_train)
  
      accuracy = accuracy_score(y_test, y_pred)
  
      print("Accuracy:", accuracy)
  
      # Reduce dimensions to 2d using pca and plot the results
      Plot().plot_in_2d(
          X_test,
          y_pred,
          title="K Nearest Neighbors",
          accuracy=accuracy,
          legend_labels=data.target_names,
      )
  
file_path: ML-From-Scratch/mlfromscratch/examples/k_nearest_neighbors.py
imports: from __future__ import print_function
  import numpy
  import matplotlib.pyplot
  from sklearn import datasets
  from mlfromscratch.utils import train_test_split, normalize, accuracy_score
  from mlfromscratch.utils import euclidean_distance, Plot
  from mlfromscratch.supervised_learning import KNN
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types