diff --git a/machine_learning/k_nearest_neighbours.py b/machine_learning/k_nearest_neighbours.py index 2a90cfe59..c5e0e767b 100644 --- a/machine_learning/k_nearest_neighbours.py +++ b/machine_learning/k_nearest_neighbours.py @@ -10,7 +10,8 @@ X = np.array(data["data"]) y = np.array(data["target"]) classes = data["target_names"] -X_train, X_test, y_train, y_test = train_test_split(X, y) +X_train, X_test, y_train, y_test = train_test_split(X, ym,random_state=42) +'''Random state = 42 is set so that the training and test set remains same after 1st run for all def euclidean_distance(a, b):