As far as I know in K-fold cross validation the samples are split into k sets and at round k-1 of these are used for the training of the model and the last one is used for testing the model and estimating the error of the model. Totally k measurements are done and finally is made the mean of the errors.

So, if my description of the k-fold is more or less correct, what's the difference from Leave-One-Out Cross validation?

EDIT: Actually I don't care about the value of k, I simply don't see the difference between LOO and K-fold Cross validation.

  • 1
    $\begingroup$ Possible duplicate of Choice of K in K-fold cross-validation $\endgroup$ Apr 16, 2017 at 23:13
  • $\begingroup$ @tgung I don't think that is a duplicate because it doesn't deal directly with leave-one-out. However there are several other posts that might be duplicates. $\endgroup$ Apr 16, 2017 at 23:16
  • $\begingroup$ @gung I don't see how can be a duplicated of that question, I'm interested to the difference with LOOCV. $\endgroup$
    – Timmy
    Apr 16, 2017 at 23:26
  • $\begingroup$ The answers in that thread explain that LOOCV is just the upper limiting k in k-fold CV, & they discuss the pros & cons of lower or higher k. Thus, they cover the content of this question. $\endgroup$ Apr 17, 2017 at 0:30
  • $\begingroup$ But if people are looking for an answer to this question, they won't look there. $\endgroup$
    – Peter Flom
    Apr 17, 2017 at 13:05

2 Answers 2


Leave-one-out fits the model with k-1 observations and classifies the remaining observation left out. It differs from your description because this process is repeated another k-1 times with a different observation left out. You can learn about this from the original paper by Lachenbruch and Mickey in 1968. In my answer I am treating k as the full sample size. In k-fold cross-validation it has a different meaning.

  • $\begingroup$ So if have an initially have 1000 samples, for each of them I'll create a model (using the other 999 samples) and finally I'll calculate the mean, correct? $\endgroup$
    – Timmy
    Apr 16, 2017 at 23:20
  • $\begingroup$ No cross-validation is done to compute uncertainty in the model and not to estimate a mean. If you have 1000 data point you do the modeling procedure a total of 1000 times each time leaving a different observation out is the case of the leave-one-out method. Lachenbruch and Mickey found a reasonably fast algorithm to do this. Forms of bootstrap were developed starting with Efron 1983 that do better than leave-one-out. $\endgroup$ Apr 16, 2017 at 23:26
  • $\begingroup$ The leave-one-out method was originally used to estimate classification error rates. $\endgroup$ Apr 16, 2017 at 23:35
  • $\begingroup$ So in LOO to create the model I use all the samples except only one and finally I compute the mean error of the model created. Instead in K-Fold I create K sets of samples and I use k-1 sets to create the model and only one set to test. Also here I repeat the computation of the error k times (but this time k is the number of set and not the number of samples) $\endgroup$
    – Timmy
    Apr 16, 2017 at 23:36

In loocv method we divide the dataset as one data point for test data while all the remaining data points as our train data. We then validate our model by using this n-1 train data against 1 test data. We perform n iterations like this with 1 test data being forwarded and remaining n-1 data being our new train data. This is suitable in time series analysis. We then find the average of n rmse values obtained. While in k fold method we divide the entire dataset in mot k folds and one fold will be the test fold and k-1 fold will be the train fold. We then validate our model by training k-1 train fold against 1 test fold. We do such k iterations and average the k rmse values. The test fold here moves backward and forward. Hence it cannot be used in time series analysis since it messes up with time. Please somebody correct me if am wrong somewhere


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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