Easy AI with Python 3

Having recently become interested in Artificial Intelligence (AI), especially Machine Learning (ML), and then more especially Artificial Neural Networks (ANN), I was thinking about posting some short AI programs – but I have yet to write any. So today I came across this video of Raymond Hettinger talking about Easy AI with Python. Now if you don’t know about RH, you’re in for a treat! He’s possibly (IMHO) the world’s best teacher of Python, and he’s written a great deal of the Python interpreter. The code fragments in that (old) video seem to me to be ideal for this site, and so I’ll be posting some of them in due course (updated to Python 3). Meanwhile, please enjoy the video, embedded below!

Note that the codes are in Python 2; as just mentioned, I’ll be posting Python 3 versions, but till then, here are some of the things to change if you can’t wait:

  • Remove the x from xrange;
  • Change print to a function, with brackets;
  • More as I notice them.

I’m not sure whether all the programs he describes would be regarded as true AI by everyone, but they’re certainly fun, interesting, useful, and educational. And anyway some of the techniques typically found in AI/ML seem to me to be just ‘curve-fitting’ or some other piece of mathematics or computer science that doesn’t really warrant a fancy name; most of what we program computers to do previously required some level of intelligence. But I’m still a newb at this so I hope I’ll figure it out eventually!