Tuesday, 17 February 2009

Progress and ID3

Made some progress this week, mainly focussed around implementing a version of the ID3 algorithm. So far the code reads in a text file of examples that will later be used to generate the decision tree. This presented a bit of a tricky situation. Obviously the code needs to be as flexible as possible so that different decision trees can be created simply by loading in a different example set. Basically I had to resort to writing a rudimentary tool to load in the file, parse it to make sure it makes sense and then convert the text into useful values for the code. There are still a few little bugs that need to be sorted out but in general I'm nearly there.

At this point I should probably go into a little more detail about the ID3 algorithm. The ID3 algorithm is a method of creating a decision tree based on past experience to introduce learning to an intelligent agent. For example, if a decision tree was to be created as to whether or not to attack an enemy, the algorithm would take into account the entities strength, health, weaponry and the enemies strength, health and weaponry and use past experience and previous outcomes to build and navigate the tree effectively and realistically. ID3 uses entropy to decide which attributes weighs more heavily on the on the decision and split the tree accordingly. Entropy is a measure of uncertainty that gives an accurate yet not perfect way of finding the most efficient way to build the tree.

The advantage to using this method is that a new tree can be generated quickly and easily when an agent learns something new about its environment and thus the agent can act accordingly.

No comments: