Answers.Body: <p>As @Oliver Mason says, picking the parameters that control the behavior of a GA (which are sometimes called "hyperparameters") is historically more of an art than a science.</p>
  
  <p>The evolutionary computation literature has many theories about the merits of high vs. low mutation, and high vs. low crossover. Most practitioners I have worked with use either high crossover, low mutation (e.g. Xover = 80%, mutation = 5%), or moderate crossover, moderate mutation (e.g. Xover = 40%, mutation = 40%). </p>
  
  <p>In more recent years, the field of <a href="https://en.wikipedia.org/wiki/Hyperparameter_optimization" rel="nofollow noreferrer">hyperparameter optimization</a> has emerged and focuses on developing automatic approaches to picking these parameters. A very simple example of hyperparameter optimization is the <a href="https://scikit-learn.org/stable/modules/grid_search.html" rel="nofollow noreferrer">GridSearchCV function</a> in ScikitLearn. This systematically tries every combination of, say, 10 crossover values with evey one of 10 mutation values, and reports on which one works best. It uses <a href="https://machinelearningmastery.com/k-fold-cross-validation/" rel="nofollow noreferrer">Cross Validation</a> to prevent overfitting during this process. A more complex approach is <a href="https://towardsdatascience.com/a-conceptual-explanation-of-bayesian-model-based-hyperparameter-optimization-for-machine-learning-b8172278050f" rel="nofollow noreferrer">Bayesian Hyperparameter Optimization</a>, which performs a sort of optimal experiment design to uncover the best values using as few tests as possible. This approach has been quite successful in tuning the hyperparamters of deep neural networks, for example.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-26T21:08:50.317Z
Answers.LastActivityDate: 2019-04-26T21:08:50.317Z
Answers.UserDisplayName: John Doucette
Body: <p>I have a genetic algorithm that maximizes a fitness function with two variables f(X,Y).</p>
  
  <p>I have been running the algorithm with various parameters in mutation and crossover probability (0.1, 0.2, ...)</p>
  
  <p>Since I dont have much theoretical knowledge of GA, how could I proceed in order to find the optimal values for mutation and crossover probability, and if necessary the optimal population size ?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-04-26T10:23:18.087Z
Comments.Text: Trial and error. One possible approach would be to start off with high probabilities, and gradually reduce them; that way you cover a larger amount of the search space at the beginning, and then hopefully converge on the better solutions. Run trials, and measure and plot the outcomes. That way you will quickly see what works and what doesn't.
Comments.UserDisplayName: Oliver Mason
Tags: <algorithm><genetic-algorithms><mutation-operators>
Title: How to find optimal mutation probability and crossover probability?
UserDisplayName: Pedro Martins
ThreadText: # How to find optimal mutation probability and crossover probability?
  
  (Asked by: username_0 on 2019-04-26)
  
  I have a genetic algorithm that maximizes a fitness function with two variables f(X,Y).
  
  I have been running the algorithm with various parameters in mutation and crossover probability (0.1, 0.2, ...)
  
  Since I dont have much theoretical knowledge of GA, how could I proceed in order to find the optimal values for mutation and crossover probability, and if necessary the optimal population size ?
  
  **Tags:** algorithm, genetic-algorithms, mutation-operators
  
  > **Comments:**
  > **username_1**: Trial and error. One possible approach would be to start off with high probabilities, and gradually reduce them; that way you cover a larger amount of the search space at the beginning, and then hopefully converge on the better solutions. Run trials, and measure and plot the outcomes. That way you will quickly see what works and what doesn't.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-04-26. Score: 3 | Accepted answer
  
  As @username_1 says, picking the parameters that control the behavior of a GA (which are sometimes called "hyperparameters") is historically more of an art than a science.
  
  The evolutionary computation literature has many theories about the merits of high vs. low mutation, and high vs. low crossover. Most practitioners I have worked with use either high crossover, low mutation (e.g. Xover = 80%, mutation = 5%), or moderate crossover, moderate mutation (e.g. Xover = 40%, mutation = 40%).
  
  In more recent years, the field of [hyperparameter optimization](https://en.wikipedia.org/wiki/Hyperparameter_optimization) has emerged and focuses on developing automatic approaches to picking these parameters. A very simple example of hyperparameter optimization is the [GridSearchCV function](https://scikit-learn.org/stable/modules/grid_search.html) in ScikitLearn. This systematically tries every combination of, say, 10 crossover values with evey one of 10 mutation values, and reports on which one works best. It uses [Cross Validation](https://machinelearningmastery.com/k-fold-cross-validation/) to prevent overfitting during this process. A more complex approach is [Bayesian Hyperparameter Optimization](https://towardsdatascience.com/a-conceptual-explanation-of-bayesian-model-based-hyperparameter-optimization-for-machine-learning-b8172278050f), which performs a sort of optimal experiment design to uncover the best values using as few tests as possible. This approach has been quite successful in tuning the hyperparamters of deep neural networks, for example.
  
  
  ---
  
  