1. Reproduce the data from slide 18 twice, but now instead of \(\pm 1.5\) use an adjustment of \(\pm .5\) and \(\pm 2.5\), respectively

  1. Add a column to the data sets that indicates a Train (25%) and a Test (75%) part.

  1. Fit the K-NN model to both data sets. Use k = 3.

  1. What is the percentage of correct predictions for each model?

  1. Plot the false and correct predictions for both models.

  1. Write a function that determines the optimum k with respect to classification error. Have the function return the following:

  1. Execute your function twice: once for the data set based on the .5 adjustment and once for the data set based on the 2.5 adjustment. Does the previously used k=3 yield the optimal classification prediction?

End of Practical