My partner and I were doing a basic least squares regression line on some dataset. We got an intercept and coefficient that were different, but our MSE on the test dataset was the same. Is this a thing? For some reason I had always thought there was only one regression line that minimized MSE, but I guess I was wrong?


Are you certain you both performed your regression and testing on the same subsets of data?

Linear regression with least squares is a convex optimisation problem, so you should get the same line.

An exception would be performing regression on a single data point (two parameters, slope and intercept, but only one observation). In this case any line that passes through the point would be optimal.

See here and here also.

| cite | improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.