Not understanding of concepts ..........?

which dataset is used here??
and moreover please explain this line of code
index = new_vals[1].argmax()
pred = new_vals[0][index]

Hi Kushal,
You can find this dataset in the GitHub repository. Under the KNN folder.

Coming to your second question,
index = new_vals[1].argmax()
pred = new_vals[0][index]

Here, new_vals is a list containing two tuples which was obtained after we ran the np.unique command on the k nearest neighbours list, the first tuple in that list contains the unique values which the function returned and the second tuple contains the number of times each unique value occured.

Here index = new_vals[1].argmax() extracts the index of the element which occurs the most of number of times out of the unique classed. Now, pred = new_vals[0][index] extracts the unique element out of the first tuple by using that ‘index’ which we obtained before.

Thus, with these statements we obtain the class in which most of the neighbouring elements of our test point belongs too.