<< , >> , up , Title , Contents

5.1. Learning

YAILS has several commands that you can use to learn. Most of them deal with learning examples contained in a file as this is the most common way of using the program. Nevertheless it's also possible to give it examples, one by one. There are also commands that show you the present theory of YAILS as well as other information. Also possible is to save the theory in a file possibily to load it back again in future in order to continue the learning process.

To learn some problem YAILS needs some information about it before being able to start learning examples. This information consists of the name the attributes as well as their types and eventual restrictions in their domain. This information is usually contained in a file that YAILS can load in. This means that when you want to learn some problem you need to have two files :- one with the above referred declarations and one with the examples to learn (unless you want to type by hand each example one by one in which case you don't need the later). The format of the information contained in those files is described bellow.

The declarations file should have the name of the problem and extension ".types". Its contents are prolog facts that give YAILS the information it needs about the domain of the problem. Bellow there is an example of a toy problem :

File : "toy.types"

attribute(color,symbol,_).
attribute(power,numeric,[power>0]).
attribute(cilind,numeric,[cilind>0]).
attribute(make,symbol,_]).
attribute(max_speed,numeric,[max_speed>0]).
attribute(accel,numeric,[accel>0]).
attribute(country,symbol,_).

The third argument of the attribute/3 clauses may be used to state some restrictions to the domain of the attribute.

The examples file should have the same name as the declarations file but without extension. Each example is described by one line of the examples file. The example is a list of attribute values separated by commas and the last value is the class to which the example belongs. With respect to the same toy exmple presented above I show below some examples in this format :

File : "toy"

red,dontcare,1600,honda,220,7.900,japan,sportif
black,220,2500,mercedes,230,8,germany,family
white,140,1900,renault,210,8.500,france,sportif
red,370,4000,ferrari,320,4.700,italy,sportif
white,60,1200,renault,155,14,france,utilitary
red,55,1000,opel,155,14,germany,utilitary
white,35,750,fiat,140,18,italy,utilitary
black,55,1100,seat,155,16,spain,utilitary
red,90,1400,honda,dontcare,10.200,japan,family
black,75,1400,ford,165,14,england,family
white,85,1400,bmw,175,12,germany,family
white,88,1400,alfa,180,11,italy,family
white,75,1300,fiat,170,13,italy,family
white,175,unknown,unknown,170,7,japan,sportif

Notice that there are two special values. These are the value dontcare and the value unknown. The first states that the value of the attribute in cause is irrelevant and the second that it is an unknown but perhaps relevant value (see section 2.6). Notice that the values are presented in the order difened by the order of the attribute/3 clauses in the declarations file (this means that each first value belongs to the attribute color).

Bellow an example of interaction with Yails is presented:

===============================================
YAILS - Yet Another Incremental Learning System
===============================================

YAP-Prolog version Mar 1992, Luis Torgo

YAILS - problem toy_stat

YAILS - show status

=========================================================================== ---- YAILS system information ----
--------------------------------------------------------------------------- * SYSTEM

Trace -> off
--------------------------------------------------------------------------- * PROBLEM

Name -> toy_stat

Attributes :

Attr no.1 => color,symbol Attr no.2 => power,numeric
Attr no.3 => cilind,numeric Attr no.4 => make,symbol
Attr no.5 => max_speed,numeric Attr no.6 => accel,numeric
Attr no.7 => country,symbol
--------------------------------------------------------------------------- * PARAMETERS
similarity_threshold(0.500) minimal_coverage(1) minimal_consistency(0.950)
minimal_matching_score(0.900) minimal_utility(0.050)

YAILS - learn file toy_stat

YAILS - show rules
# { make=mercedes } => family (0.786)
family -> 1 examples
# { cilind in ]1200...1600[ } => family (0.964)
family -> 6 examples
# { accel=8 } /\ { max_speed=170 } => sportif (0.800)
sportif -> 1 examples
# { accel<8 } => sportif (0.900)
sportif -> 3 examples
# { accel<14 } /\ { make=renault } => sportif (0.800)
sportif -> 1 examples
# { make=ferrari } => sportif (0.800)
sportif -> 1 examples
# { cilind<1300 } => utilitary (1.000)
utilitary -> 4 examples

YAILS - new example

Existing attributes :
Attr no.1 => color,symbol Attr no.2 => power,numeric
Attr no.3 => cilind,numeric Attr no.4 => make,symbol
Attr no.5 => max_speed,numeric Attr no.6 => accel,numeric
Attr no.7 => country,symbol

Introduce the example in the format : ValueAttr1 ValueAttr2 ...
You can use values "dontcare" and "unknown"

EXAMPLE :: red 270 3000 honda 280 4.5 japan

Introduce the class of the example

CLASS :: sportif

The first command shown (problem toy_stat) has the meaning of telling Yails which problem you want to deal which implies that Yails loads the information in file "toy_stat.types".

The command (show status) is used to present the user usefull information on the status of the system (parameters, etc.).

In order to learn examples from a file the comand used is "learn file <FileName>". This command incrementaly learns each example contained in the file.

To input manually one more example you can use the command "new example".

Finally the command "show rules" enables you to see the present state of the theory.

Also available are the commands "load theory <FileName>" and "save theory <FileName>" which enable the user to save the present state of the learned theory to load it back again in future in order to continue to learn.


<< , >> , up , Title , Contents