I have this question as an assignment, I am having challenges in interpreting this question.
Q4. Define a function that takes a 1-d numpy array, a parameter k, and a number p. The function returns an estimate equal to the mean of the closest k points to the number p
The challenge I have is, kNN seems to work for multi-dimensional arrays. howver, here this is a single D array.
Am i to write the function from scratch to loop through this single D array to find the closest numbers to the number P (from this singleD array?) In which case I need not use the kNN libraries, but use my own logic.
I am not exactly looking for the answer, but am looking for clarification.
Thank you
RSH