A beginner's guide to how machines learn