small medium large xlarge

Genetic Algorithms and Machine Learning for Programmers: Create AI Models and Evolve Solutions


Cover image for Genetic Algorithms and Machine Learning for Programmers

Genetic Algorithms and Machine Learning for Programmers

Create AI Models and Evolve Solutions


Self-driving cars, natural language recognition, and online recommendation engines are all possible thanks to Machine Learning. Now you can create your own genetic algorithms, nature-inspired swarms, Monte Carlo simulations, cellular automata, and clusters. Learn how to test your ML code and dive into even more advanced topics. If you are a beginner-to-intermediate programmer keen to understand machine learning, this book is for you.

Customer Reviews

I really like the book; it’s pitched nicely at the interested beginner and doesn’t
make undue assumptions about background knowledge.

- Burkhard Kloss

Director, Applied Numerical Research Labs

A unique take on the subject and should very much appeal to programmers
looking to get started with various machine learning techniques.

- Christopher L. Simons

Senior Lecturer, University of the West of England, Bristol, UK

Turtles, paper bags, escape, AI, fun whilst learning: it’s turtles all the way out.

- Russel Winder

Retired Consultant, Self-Employed

This book lifts the veil on the complexity and magic of machine learning techniques
for ordinary programmers. Simple examples and interactive programs really show
you not just how these algorithms work, but bring real-world problems to life.

- Steve Love

Programmer, Freelance

See All Reviews

Choose Your Format(s)

  • $24.95 In Stock
  • Ebooks are DRM free.

  • Ebook delivery options.

What You Need

Code in C++ (>= C++11), Python (2.x or 3.x) and JavaScript (using the HTML5 canvas). Also uses matplotlib and some open source libraries, including SFML, Catch and Cosmic-Ray. These plotting and testing libraries are not required but their use will give you a fuller experience. Armed with just a text editor and compiler/interpreter for your language of choice you can still code along from the general algorithm descriptions.

Contents & Extracts

  • Preface
    • Who Is This Book For?
    • What’s in This Book?
    • Online Resources
    • Acknowledgments
  • Escape! Code Your Way Out of a Paper Bag excerpt
    • Let’s Begin
    • Your Mission: Find a Way Out
    • How to Help the Turtle Escape
    • Let’s Save the Turtle
    • Did It Work?
    • Over to You
  • Decide! Find the Paper Bag
    • Your Mission: Learn from Data
    • How to Grow a Decision Tree
    • Let’s Find That Paper Bag
    • Did It Work?
    • Over to You
  • Boom! Create a Genetic Algorithm excerpt
    • Your Mission: Fire Cannonballs
    • How to Breed Solutions
    • Let’s Fire Some Cannons
    • Did It Work?
    • Over to You
  • Swarm! Build a Nature-Inspired Swarm
    • Your Mission: Crowd Control
    • How to Form a Swarm
    • Let’s Make a Swarm
    • Did It Work?
    • Over to You
  • Colonize! Discover Pathways
    • Your Mission: Lay Pheromones
    • How to Create Pathways
    • Let’s March Some Ants
    • Did It Work?
    • Over to You
  • Diffuse! Employ a Stochastic Model
    • Your Mission: Make Small Random Steps
    • How to Cause Diffusion
    • Let’s Diffuse Some Particles
    • Did It Work?
    • Over to You
  • Buzz! Converge on One Solution
    • Your Mission: Beekeeping
    • How to Feed the Bees
    • Let’s Make Some Bees Swarm
    • Did It Work?
    • Over to You
  • Alive! Create Artificial Life
    • Your Mission: Make Cells Come Alive
    • How to Create Artificial Life
    • Let’s Make Cellular Automata
    • Did It Work?
    • Over to You
  • Dream! Explore CA with GA
    • Your Mission: Find the Best
    • How to Explore a CA
    • Let’s Find the Best Starting Row
    • Did It Work?
    • Over to You
  • Optimize! Find the Best
    • Your Mission: Move Turtles
    • How to Get a Turtle into a Paper Bag
    • Let’s Find the Bottom of the Bag
    • Did It Work?
    • Extension to More Dimensions
    • Over to You


Frances Buontempo is the editor of ACCU’s Overload magazine ( She has published articles and given talks centered on technology and machine learning. With a PhD in data mining, she has been programming professionally since the 1990s. During her career as a programmer, she has championed unit testing, mentored newer developers, deleted quite a bit of code and fixed a variety of bugs.