Next define the "fit" method that takes the training data(X) and it's corresponding labels(y) and stores them. This is the reason why the computation cost is high as it stores all the training data! And also a method to calculates the euclidean distance between two data points.
Implementing fit Method and Euclidean Distance in KNN
By
–
Leave a Reply