YAILS, an incremental rule learning system

The goal of this file is to help you on quickly being able to try something with Yails.

For further information consult either the Yails User's Manual or the Yails technical report (or contact ltorgo@liacc.up.pt).


CONTENTS


WHAT IS YAILS

Yails is an incremental rule learning system. This program is able to learn rules describing a set of concepts that you which to "teach" the system. In order to achieve this you need to give Yails examples of these concepts.

Yails learns concepts in a kind of propositional language. This means that the examples given to it are described by a conjunction of "property = value" pairs. The rules produced by Yails also use this kind of description. This of course limits the kind of things you can teach Yails. Nevertheless Yails can use both numeric valued properties (ex. "temperature = 39.5") as well as symbolic ones (ex. "color = red"). The rules learned by Yails may include intervals of values in case of conditions involving numeric attributes (ex. "temperature > 29"). Yails as also two special values namely "unknown" and "dontcare" which can help you if you either don't know a particular property value or if you want to tell Yails it is irrelevant for a particular example.

Yails learns concepts in an incremental fashion, meaning that you can give it a file of examples and if you are not happy with the results you can go on from the current learned theory and give Yails more examples, and the system will try to reformulate its theory in order to incorporate the new examples.

HOW TO RUN YAILS

In order to run Yails you will need YAP-prolog. Assuming that you have it you need to run it and then load Yails. You can automate this tasks by building some Unix scripts (see files "go" and "yails" in the Yails distribuition directory for some ideas).

After lunching Yap Prolog by typing "yap" at the Unix prompt you should issue the command "[loader]." at the Yap prompt to load in Yails. This file not only loads Yails but may (depending on your version) also start the command line interface of Yails. There is a predicate "first_action/0" in this file ("loader.yap") which you can edit to make (or not) Yails run imediatelly the interface. See next section if this is not your case.

YAILS COMMAND LINE INTERFACE

After running Yails you can start the command line interface which will enable you to more easily interact with the system. To do that type the following at the Prolog prompt :

?- interface.

You are now at Yails command line interface. You can try to type "help" followed by "return" to go through some of the main commands. Nevertheless perhaps it is a good idea to end up reading this file before trying anything.

To leave the command line interface you have two alternatives : typing "end" will send you to the Prolog prompt; typing "quit" will put you back in Unix.

Please not that within the command line interface commands DO NOT end with period like in normal prolog prompt.

WHAT DO I NEED TO START

If you have some problem in mind that you want to try with Yails you will need some initial steps before you are ready to use Yails. First you need to decide which will be the properties (attributes) that you will use to describe the examples given to Yails and their respective types ("symbol" or "numeric").

Having decided that you need to put this information in a file that later you will give Yails. This file needs to have the extension ".types". Its contents are a set of facts, one for each of the properties (you have an example file in the Yails directory, "toy.types"). Each of the Prolog facts have 3 arguments. The first is the property name, the second its type and the third is currently unused and you should put the anonymous variable on it (see the file "toy.types").

After this first step you are ready to use Yails. Nevertheless if you don't want to give all examples by hand to Yails you might want to have another file with a set of examples that you afterwards instruct Yails to learn. You have an example of such a file in Yails directory ("toy"). These files have one example in each line following a certain syntax. Each example is a set of properties values separated by spaces or commas. The last value is the concept to which the example belongs. The order of the values is not irrelevant. It should be the same order as the order of the properties in the ".types" file. For instance if you have the following information in a ".types" file :

attribute(color,symbol,_).
attribute(temperature,numeric,_).

You could have a file of examples of this domain with the following contents:

red 40 x
blue 12.67 y
green 30 x

This file has three examples, two of concept "x" and one of concept "y". The first example (which belongs to concept "x") has color red and temperature 40. Note that values should be separated by spaces.

HOW DO I MAKE YAILS LEARN MY EXAMPLES

Assuming that you are running Yails in the command line interface and that you previously built the files referred in the previous section, the first step is to tell Yails which problem do you want it to learn. This involves reading the information in the ".types" file. In order to do that you use the following command (let's assume that you had built a file named "my_prob.types" with the declaration of the properties you which to use in your problem) :

YAILS - problem my_prob

After this step Yails is ready to receive your examples. You can either give them by hand or by asking Yails to read them from a previuously built examples file. In order to learn the examples contained in a file you can use the following command (let's assume your examples file is named "my_exs") :

YAILS - learn my_exs

This command will make Yails lear each of the examples contained in file "my_exs", one by one.

If you want to see the results of learning you can issue the command :

YAILS - show rules

If you are not happy with the results you can hand input other examples (of course you could also learn another file of examples). This can be accomplished in two ways :

YAILS - new example

This way Yails will interactively ask you to input the example and afterwards the concept (or class) which it represents. In this way Yails shows you the properties of the problem and explains you the form of your input.

The other way is to directly input the example in the command. The general format is as follows :

YAILS - new example [concept] [list of properties values]

For instance in the example given above you could issue the following command:

YAILS - new example y red 56.78

Notice that in this command the concept comes first (in opposition to the files of examples).

HOW DO I USE THE RESULTS OF YAILS LEARNING

One of the things you can do with the rules learned by Yails is to ask Yails to classify a new example which either you don't know to which concept it belongs or just to test Yails accuracy.

You can do this by typing the command :

YAILS - classify example

You will be asked to input the example (not its concept of course!), and you'll get a table of possible classifications of the example (it's possible that only one classification is outputed if no conflits arise between the rules learned by Yails). The table is ordered by descending order of Yails confidence on the classification (this is described by the collumn "opinion value"). In the first collumn we can see the ID of the rule which originated that particular classification (which is showed in the last collumn). If we want to see the rule you can issue the command :

YAILS - show rule [RuleID]

You can also ask Yails to classify a file of examples having exactly the same format of the files of examples given for learning (with the concept included).

In this mode Yails classifies each example of the file in turn comparing its classification with the concept asserted in the file. In the end Yails outputs the results of the classification task (the percentage of correct classifications as well as other indicators, like number of rules used, etc.).

The command that you need to use is :

YAILS - classify file [name of the file with examples]


Luis Torgo

e-mail : ltorgo@liacc.up.pt