I am trying to implement leave-one-out cross-validation from scratch.
I have a logistic regression model which I have already implemented. I have trained this model for 10,000 epochs. I am trying to update this to use LOOCV.
From what I understood, the LOOCV works by splitting the dataset into two sets:
- one with n-1 examples in it. (training set)
- and the other group with one example in it. And we use this one to test our model(validation set)
And we repeat this process n times.
Now, my questions are:
- For each of those n loops, we train our data. And like I said I did the initial training for 10,000. So are we going to train each of the n-models for 10,000 epochs? Does this mean we are looping over (10,000 * n) times during this whole process?
- Since we ran this process for n times. Does this mean we have n-different weights and bias? What weights and bias do I use for final testing? Do I use the best one from those n-models, or do I average over all the different weights and bias?
Thanks