Simple Reinforcement Learning in Python

Machine learning is a field of computer science concerned with teaching machines to do “clever” things like write stories, understand pictures, or trade on the stock market. There are different subdisciplines in machine learning that focus on different ways a machine can learn. One of these is Reinforcement Learning (RL), which focuses on how machines can learn from experience.

Think of a lab mouse placed at the entrace to a maze. Gradually, from experience, a mouse will learn that completing a maze will deliver a reward of cheese (or some other mousey treat)…