Added the code to find the best k value by spliting the values and
checking for the best k and applying for the prediction