Closed walkerjohn97 closed 4 years ago
You should have 3 model statements (instead of having poly vary with k, you should just have 3 separate lines in there) check out the code in #49 along with my response there.
If I change the k in that line to K, i get 3 mse's. Does that work?
Using this code I get different MSE's, but i do not have 3 model statements. Is this wrong?
You should have 3 different MSEs (1 for each model) yes, but the code above is wrong. You are using K 2 times in that code, once to determine the fold of data that is left out of the training model (and then used to calculate the MSE) this is correct! and once to pick the polynomial term this is not correct! You should have 3 separate model statements, 3 separate predicted values, and 3 separate MSEs
Hey Dr. McGowan,
I'm having problems with exercise 6. I based my codes off the code in the slides and the code runs without any errors, but the MSE is the same for all 3 models, so something is wrong. I paste code below