117WILF
117WILF
117WILF
Wilf’s
Programmers’ Workshop
Learn more about artificial intelligence techniques in the second part of
Wilf Hey’s investigation into expert programs.
magine training your to build a program that simulates Imagine that you are provided with a
I computer to
recognise concepts
rather than objects.
Last month we built an expert program,
some of the workings of the
human mind. There are several
reasons why this is a very difficult
task – first of all because we still know
photograph, and you are required to
identify whether the object portrayed is a
spade. If you can record the steps in your
thought process, you should be able to
which was able to classify objects. When comparatively little about the way our convert them into program code – at least
enough information was classified our minds work, and second because the in theory.
expert was then able to use tree- hardware in our brain functions in very One of the major problems in education
structured data to determine which of different ways from computers. is that sometimes the experts don’t know
several objects you meant when you what it is that makes them experts. For
answered relevant questions. Calling a spade a spade example, the coach who looks for new
Given enough objects, along with Consider how you might provide your PC recruits for football may swear that he has
questions that distinguish them, the expert with the knowledge of what a spade is. You an eye for a good player before even
can quickly identify anything previously could, for example, organise this seeing a demonstration of that player’s
encountered. A competent computerised knowledge with last month’s program in the football skills.
doctor can be built in a similar manner, form of probing questions – ‘Does it have a It may seem unlikely that such
asking a patient questions about disease handle?’ – Yes; ‘Does it have a flat metal expertise could be transferred to a
symptoms, leading to a useful diagnosis. blade?’ and so on. However, this hardly computer – it is intangible and undefined.
It is a totally different matter, however, matches the way a human being thinks. Yet statistical methods can be used that
each of the criteria stored in Tweak$ and Rule(i) = SGN(Rule(i) + Value(i)) always give the correct guess. The best
asking you whether the object currently way to understand this is to watch it
being evaluated matches it (Y or N). In the SGN always produces a value of 1, –1 or 0, happen – set up a simple three-rule test
array named Value, 1 is used to indicate Y, so it is ideal for our circumstances. We and watch what happens to the diagnostic
or 0 for N. never want the magnitude to exceed one line. Try it in situations where all questions
In the array called Rules you’ll find a (whether positive or negative). are significant, and where one question
sequence of values which indicate the If we omitted this function, the has no significance (for example, colour
significance of the corresponding question magnitude of each rule may become quite when trying to distinguish between plants
in Tweak$: 0 means that the rule provides large, depending on how many adjustments and animals).
no clue to the final result; 1 means that the to the rules are made. It would then take Note that rules which at one point have
rule is considered to be a clue towards a many samples to make an effective change a value of 0 (having no bearing on the
positive decision; and –1 means that the to the evaluation. answer) may well end up with a different
rule is considered to be a clue towards a Remember that when Student makes result after evaluating several more
negative decision. its guesses, it does so only on the basis of samples, so even these seemingly
When we multiply each answer value whether its calculation is positive or irrelevant questions are still asked while
by the corresponding rule value, we arrive negative and not on the magnitude of the the program is in its learning mode.
at several small positive or negative values, value. The program learns more quickly If you use this program as a basis for
each contributing a particle of information when you keep these values low – close to your own expert, you will of course stop
about whether the sample object deserves zero – so that they can change from asking such insignificant questions (those
to be in one category or the other. positive to negative readily (or vice versa). with the matching rule entry having a value
All these clues are added together. If This modification of the rules by adding 0) when the program is switched into
the sum is positive, the program guesses or subtracting the corresponding answer expounding mode. See also the panel
that the positive category (whatever it is values, according to whether the program’s above, How to teach your Student, for
named) is correct; if the sum is negative, it incorrect guess was Y or N, modifies those more information.
suggests the negative category’s name. rules where you answered Y. Keep these projects to hand – last
If the calculation provides the wrong Assuming that you set up enough rules month’s expert programs, and this month’s
result for a particular sample, the rules are to distinguish between objects with Student program – because in the future
modified – the place where this happens is accuracy, and that you gave truthful we will return to the topic of expert
indicated by a comment in the program answers, the rule values will eventually systems. These both provide a good
code. Note the use of the SGN function: settle into the pattern of answers which foundation on which to build. PCP