I am trying out an R exercise where I have to randomly split my data into train/test set 50 times. On each iteration, I use
lm() to train polynomial models up to 6th degree, and then predict the models on test set. I then have to do the following:
- Plot the test predictions of the polynomial models across all 50 iterations separately. (This I have done; see image below).
- Create a plot (either in the same plot or separately) to highlight the best model's test error across all 50 iterations. The error lines of the other models can be shaded in a lighter colour.
Part (2) is the one that confuses me. I am not sure what it is asking for. I thought about highlighting, for each polynomial, the line which returned the lowest test MSE out of the 50 iterations. However, I am quite sure this is wrong as I don't think "test predictions" mean the same as "error lines".