Having difficulty doing something very basic: create a random dataset taking on values between -1,1, plot them, and also fit a KNN model to the data and fit it over the data. Using numpy to create the dataset.
The KNN fitted line looks like a spider web. Unsure where I went wrong in the code. K=2 in the image, but the problem is identical even if I set K = 80. https://github.com/PortWhisperer/MachineLearningStudies/blob/master/crappy-KNN.py