Chapter 4 - Genetic Algorithms
Chapter 4 - Genetic Algorithms
Chapter 4 - Genetic Algorithms
Genetic Algorithm
• Learning as searching
• Analogy to biological evolution
• The best hypothesis is searched through several generations of hypotheses.
• Next generation hypotheses are produced by mutating and recombining parts of the best
current generation hypotheses
• It is not recommended to search from general-to-specific or from simple-to-complex
hypotheses.
Step 1: initial
• Selection
• Crossover
• Mutation
Select:
• Selection:
F itness(hi )
P r(hi ) = P
h∈P F itness(h)
• Crossover:
• Probabilistically select (r/2)p pairs of hypotheses from P according to P r(h)
• For each pair (h1 , h2 ), produce two offsprings by applying a Crossover operator.
• Add all offspring to the new generation.
• Mutation:
• Choose m percent of the added hypotheses with uniform distribution.
• For each, invert one randomly selected bit in its representation.
• Example:
⇓
1 1 1 1 0 1 0
1 1 1 1 0 1 0 1 0 0 0 1 0 1
• Single-point
• Two-point
• Uniform
• Single-point
• Two-point
• Uniform
• Example:
F itness(h) = (correct(h))2
correct(h) = percent of all training examples correctly classified by hypothesis h