4
$\begingroup$

I think I understand completely the concept of cross validation, but there is one aspect I've never seen detailed. Let's assume I have a logistic regression model with four parameters I want to train. I perform k-fold cross validation with k, let's say, 5, over my training data, and it yields 5 different sets of four values with 5 different associated error values. How should I then select which model to use? A weighted combination of the five models? The best one? What is the standard approach to do so and (if there is any) what are its mathematical foundations?

Thank you very much in advance.

$\endgroup$
4
$\begingroup$

Cross-validation just gives you an estimate of your out-of-sample risk. It doesn't produce a better model. To get the most precise estimate of your coefficients, you should use all of your data.

$\endgroup$
1
$\begingroup$

Actually, I've already understood how to do so. Just in case someone stumbles upon this question: cross validation can serve as a parameter tuning tool.To tune a model's parameters using K-fold cross validation you train and test each model K times against the K possible data combinations and average their out-of-sample error. The one that gets the best result will be the model that (probably) generalizes better.

$\endgroup$

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.