Skip to content

Simple Genetic Algorithm for demonstration purposes

License

Notifications You must be signed in to change notification settings

giuse/simple_ga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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.