https://github.com/giuse/simple_ga
Simple Genetic Algorithm for demonstration purposes
https://github.com/giuse/simple_ga
demo evolutionary-algorithm evolutionary-algorithms evolutionary-computation example genetic-algorithm rubyml tutorial
Last synced: 6 days ago
JSON representation
Simple Genetic Algorithm for demonstration purposes
- Host: GitHub
- URL: https://github.com/giuse/simple_ga
- Owner: giuse
- License: mit
- Created: 2016-10-26T15:15:09.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-26T15:24:50.000Z (over 9 years ago)
- Last Synced: 2025-10-10T08:37:41.141Z (10 months ago)
- Topics: demo, evolutionary-algorithm, evolutionary-algorithms, evolutionary-computation, example, genetic-algorithm, rubyml, tutorial
- Language: Ruby
- Size: 1.95 KB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- machine-learning-with-ruby - simple_ga - (Machine Learning Libraries / Evolutionary algorithms)
README
# 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.