NumPy allowed · plain Python earns 10 bonus points
Implement k-nearest neighbors classification with majority voting from scratch.
Implement knn_classify(X_train, y_train, X_test, k): for each test sample, compute Euclidean distance to all training samples, find the k nearest neighbors, and return the majority label.
knn_classify(X_train: list[list[float]], y_train: list[int], X_test: list[list[float]], k: int) -> list[int]