HOME Mapping combining Mappings Mapping detailsProgramming mappings

Programming mappings

There are many pre-programmed mappings available in PRTools. They are discussed separately. So for the starting user there is no need to program his own mappings. More advanced users and especially those who develop new algorithms for pattern recognition or machine learning may want to have their own versions of existing routines or to define entirely new ones. They should obey the PRTools rules if it is desirable that they can be handled by the PRTools system of storing mappings in a single variable of the class mapping. This is needed, for instance, when they have to be called by routines like testc, cleval or featself . In some subsections it will be shown how this can be done.

First it should be determined what mapping type is needed:

The below two tables show routines specifically designed for programming mappings and some higher level routines for handling mappings.

> Routines facilitating the programming of mappings
setdefaults substitute default parameter values
mapping low level mapping definition
define_mapping defines a mapping of type fixed, untrained or combiner
trained_mapping definition of a trained mapping
mapping_task retrieves the task of the mapping (definition, training, execution) from input parameters
isdataset tests input parameter on dataset type.
isdatafile tests input parameter on datafile type.
islabtype tests dataset or datafile on type of labeling
isvaldfile tests on dataset validity for some problem: number of classes, numbers of objects.
cdats support routine for checking datasets

> Handling mappings

display

writes in the command window the name, the dimensionalities of the input space and the output space (i.e. numbers of features), the mapping type and the command that executes the mapping.
disp writes in the command window the results of display and getdata.
+W returns the contents of the data field of the mapping W. This is identical to getdata(W).
setbatch sets a flag for controlling the execution of mappings in batch mode.
getbatch retrieval of the mapping batch mode flag
dataset conversion the axes of an affine mapping into a dataset.
isaffine test on affine mapping.
isclassifier test on classifier mapping.
iscombiner test on combining mapping.
isfixed test on fixed mapping.
istrained test on trained mapping.
isuntrained test on untrained mapping.
show shows the axes of an affine mapping as images in case of a feature space of a dataset with object images.

For further discussions and examples see to the following subsections.


R.P.W. Duin, January 28, 2013


HOME Mapping combining Mappings Mapping detailsProgramming mappings