Answers.Body: <p>Yes. Usually you would use <a href="https://en.wikipedia.org/wiki/Cross-validation_(statistics)" rel="nofollow noreferrer">cross validation</a> to avoid overfitting during parameter tuning. If your dataset is large enough, and you don't try <em>too</em> many parameter combinations, this will work well, because to "get lucky" and overfit, a parameter combination will need to work very well on <em>many</em> variations of the problem, which is less likely than working well on just one set of data.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-23T15:09:05.503Z
Answers.LastActivityDate: 2019-10-23T15:09:05.503Z
Answers.UserDisplayName: John Doucette
Body: <p>I very often applied a grid search to tune the parameters of my supervised model. I have the feeling that parameter tuning will eventually (very often) lead to overfitting? Is this crazy to say?</p>
  
  <p>Is there a way that we can apply grid search in such a way that it will not overfit?</p>
  
Tags: <machine-learning><overfitting><hyperparameter-optimization>
Title: How can I avoid overfitting when doing parameter tuning?
UserDisplayName: jennifer ruurs
ThreadText: # How can I avoid overfitting when doing parameter tuning?
  
  (Asked by: username_0 on 2019-10-23)
  
  I very often applied a grid search to tune the parameters of my supervised model. I have the feeling that parameter tuning will eventually (very often) lead to overfitting? Is this crazy to say?
  
  Is there a way that we can apply grid search in such a way that it will not overfit?
  
  **Tags:** machine-learning, overfitting, hyperparameter-optimization
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-10-23. Score: 4 | Accepted answer
  
  Yes. Usually you would use [cross validation](https://en.wikipedia.org/wiki/Cross-validation_(statistics)) to avoid overfitting during parameter tuning. If your dataset is large enough, and you don't try *too* many parameter combinations, this will work well, because to "get lucky" and overfit, a parameter combination will need to work very well on *many* variations of the problem, which is less likely than working well on just one set of data.
  
  
  ---
  
  