PRTools Operations

Here the operations between the elements of PRTools are summarized. As described, the elements are data (datasets, datafiles, cells arrays and doubles) and mappings.

Datasets and datafiles are variables of the PRTools dataset class in which vector representations of objects are stored as well as their annotation, e.g. labels, sizes, types. Below and in most of the documentation these variables are named as A, B, ... . The dataset size is [m,k], corresponding to m objects given by vectors of length k. Example_1, Example_2.

Mappings are variables of the PRTools mapping class that refer to procedures that map datasets of one vector space into another. The name of this procedure, its parameters and various types of annotation are stored inside a mapping variable. Below, as well as in most of the documentation these variables are named as W, V, U, ....  Their size is [k,n] if the mapping is between space of k and n dimensions. Example_3.

The basic PRTools operation is

B = A*W

which maps the objects of the dataset A (size [m,k]) from a k-dimensional vector space into an n-dimensional vector space if W has size [k,n]. The resulting dataset B has thereby size [m,n]. It copies all appropriate annotation from A, e.g. the class labels of the objects. Example_4.

In the above basic PRTools operation the Matlab *-operator is overloaded. Note that it is consistent with data matrices A and B in which objects are represented as row-vectors in A and a linear vector transformation given by a transformation matrix W. The PRTools mappings can also be non-linear but are still based on the concept of a mapping between two vector spaces.

Classifiers are of a special type of mapping. If there are c classes defined for a classifier W then W has size [k,c] and maps the objects A into a c-dimensional space. Here every object is a vector with c elements, of for each class. After normalization they have values between 0 and 1, called class confidences. For some classifiers they may be understood as the probability that this object belongs to the corresponding class. Example_5.

Mappings and in particular classifiers can be optimized for training data. An untrained mapping U can be optimized by a training set A by the same basic PRTools operation:

W = A*U

In this case data supplied to mapping results into another mapping. There are some other mapping types described separately that also operate on data by the *-operator.

Where ever applicable datasets and datafiles can be replaced in the PRTools operations by arrays of doubles and cell arrays, resulting in doubles respectively cell arrays. This is possible in case the additional information stored in datasets or datafiles can be neglected for the mapping operation.

Datasets, datafiles and mappings can be combined with variables of the same type using many of the standard Matlab operators like

+, -, *, .*, .^ , /, , ./, |, &, ~, xor, abs, '

and

>, >=, <, <=, =, ~=

The following links offer more information when and how such operators apply:
datasets, datafiles, cells and doubles, mappings, classifiers, stacked, parallel, sequential, dyadic

elements: datasets datafiles cells and doubles mappings classifiers mapping types.
operations: datasets datafiles cells and doubles mappings classifiers stacked parallel sequential dyadic.
user commands: datasets representation classifiers evaluation clustering examples support routines.
introductory examples: Introduction Scatterplots Datasets Datafiles Mappings Classifiers Evaluation Learning curves Feature curves Dimension reduction Combining classifiers Dissimilarities.
advanced examples.