Chapter 10 Visualizing the Results
Genetic Algorithms in Elixir — by Sean Moriarity (75 / 101)
👈 What You Learned | TOC | Visualizing the Genealogy of the Tiger Evolut ion 👉
In the previous chapter, you worked to add some tracking mechanisms to your genetic algorithm. The purpose of tracking things like statistics, genealogy, and other metrics is not only to improve the performance of your algorithms but also to demonstrate the overall effectiveness of your algorithm at solving a particular problem. For example, a biologist simulating the evolution of tigers would use the metrics implemented in the previous chapter to theorize about how evolution in the wild takes place.
Of course, good biologists wouldn’t present the data collected in its raw form. Instead, they would do some analysis, transform the data in some way, and then create graphs, charts, and other visualizations that best depict evidence supporting their theories. These visualizations are often the best way to present results. You might also benefit from analyzing certain visualizations to determine how to tweak your algorithm in certain ways.
Additionally, depending on the problem you’re trying to solve, you want to be able to see what’s going on in real time. For example, if you were trying to create a Tetris-playing AI, you’d want to watch it play Tetris in real time.
In this chapter, you’re going to learn how to create visualizations for both of these purposes — visualizing metrics and visualizing evolutions in real time. You’ll start by visualizing the genealogy of the tiger evolution you created earlier. Then you’ll export some basic statistics to a graph and visually analyze the statistics before moving on to a different problem — playing Tetris with a genetic algorithm.
👈 What You Learned | TOC | Visualizing the Genealogy of the Tiger Evolut ion 👉
Genetic Algorithms in Elixir by Sean Moriarity can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.

