Awesome
Genetic Algorithm in Ruby
Solving the 1-max problem with a simple GA, wrote as a quick-hack live machine learning demonstration.
The first commit already has basic features, then I show how simple additions (elitism and more mutation) rapidly increase performance.
I like to use GAs to explain Machine Learning:
- Based on an intuition everybody is familiar with (natural evolution)
- No math is involved (uncommon in ML), hence none is required from the audience
- The execution loop is absolutely straightforward
- The genetic operators provide a natural way to organize the code into small-sized functions
- Once cleaned up there is very little code at all
Code style is uneven because focus was put on teaching/explaining rather than execution.