# How can one use a validation set to reduce overfitting Naive Bayes?

What is the correct procedure for using a validation set to reduce overfitting?

Say I split the data 80:10:10 (training: validation:test). I train on the training set then get 90% accuracy. I apply this model to the validation set then get 20%. What do I do then?

How can the validation set be used to reduce overfitting especially with reference to Naïve Bayes?

• it's not as much about the validation set itself as the model tuning. but anyway, look for cross validation. might help a little. – Reza Keshavarz Jul 2 '20 at 4:54

It is not much about the algorithm you use. It is about the fact that you learned so much details from your training set so just tune the parameter inside a loop in which training and validation errors are calculated each time. In NB case, you do not have many parameters in that sense. Probably the features can be inspected instead of parameter. Then see the famous point at which the validation error is the minimum.

Do not use fixed splits. For each calculation in loop do $$n$$ times splitting + evaluation and take the mean and std of errors. Gives you better impression about the stability of the results and effectiveness of your algorithm.

• Is there some literature that j can read about your last point? – Vykta Wakandigara Nov 7 '18 at 13:00
• This is a general rule in statistical model selection. You either use k-fold cross validation which does it internally or you try your algorithm several times by random sampling just to be sure that the result is not "special" by taking the mean of all errors. see these two stat.cmu.edu/~ryantibs/datamining/lectures/18-val1.pdf and math.canterbury.ac.nz/~r.vale/Crossvalidation.pdf – Kasra Manshaei Nov 7 '18 at 13:04
• You can use scikit-learn's GridSearchCV. It'll do the k-fold cross validation for you and help you in tuning the hyperparameters. – Yash Jakhotiya Jul 7 '19 at 19:34