
My K Nearest Neighbor Algorithm...without using SKLearn...
I created a KNN Algorithm by making my own data set with tuples storing the x-value, y-value, and color of 9 points, asking the user for the x and y-values of their data point and how many dots are being taken into account, then determining the distance between the point and the ones in the data set. I stored these distances in a dictionary, with the points being the keys and the distances being the values, and sorted it from the lowest distance to the highest. After, I totaled up the number of points with each color out of the inputted number of nearest points. Finally, I classified the inputted point based on which of the colors was the most prominent out of those points.