4 The evolution loop🔗ℹ

(evolve dataset

        #:generations n

        #:population-size size

        #:fitness fitness)

 -> outcome?

(outcome best-tree best-error generation) -> outcome?

(regression-fitness tree dataset) -> real?

  dataset : (listof (cons/c (hash/c symbol? real?) real?))

(make-population #:size size) -> (listof tree?)

The loop sorts by fitness, copies the elite unchanged, fills the rest by tournament selection with crossover and mutation, and stops after #:generations. regression-fitness is the mean absolute error over a dataset of environment/target pairs.

Tuning knobs: current-population-size, current-tournament-size, current-crossover-rate, current-mutation-rate, current-elitism.