I am working about elaborate a simple linear regression so I need to evaluate many models. I am asking how I can use leave-one-out cross validation to validate a simple linear regression.


Say you have $n$ training examples. Then to do leave-one-out cross validation, you would first pick a training example to leave out, then perform your linear regression algorithm (gradient descent or another) on the remaining $n-1$ examples. You would then pick a different training example to leave out, perform regression on the remaining $n-1$ examples, and iterate until you've left out all examples exactly once. At the end, you would compare all $n$ coefficient vectors that you generated from your $n$ regressions to see if the coefficient values are approximately the same.

| cite | improve this answer | |
  • $\begingroup$ thank you can you tell me the way or how to do that with SPSS $\endgroup$ – user48331 Jun 13 '14 at 19:16
  • $\begingroup$ I believe that you can use the linear regression function in SPSS to do each regression; but I'm not sure how you would automate the procedure to leave out one example at each step. $\endgroup$ – liangjy Jun 13 '14 at 19:21
  • $\begingroup$ you are right so i will use a fonction of SPSS or i will use a syntaxe, thank you $\endgroup$ – user48331 Jun 13 '14 at 19:24

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.