Untrained mappings

Learning from data is the key issue of pattern recognition. So the trainable mappings are the core of PRTools. They have two states: untrained and trained. An untrained mapping may have a number of parameter to be supplied by the user. Examples are the number of neighbors in the kNN classifier knnc, regularization parameters in density estimators like ldc and qdc and the trade-off parameter in the support vector classifier svc and the kernel.

Training is done by supplying a dataset to the untrained mapping. For classifiers the dataset should be labeled. Mappings like PC-analysis (pcam) that don’t need labels will also operate on doubles. The result of an untrained mapping is a trained mapping which is ready to be used for mapping new data to a space or a set of labels for which the routine is optimized.

The following rules apply if a dataset A is processed by a sequential combination of a fixed mapping F, a trained mapping T and an untrained mapping U.

T = A*U
Training an untrained mapping results in a trained mapping
T = A*F*U = (A*F)*U The data is mapped by F and the result is used to train U. This is usually not what the user wants as new data A2 has to be mapped by F first to the proper space before it can be applied to T: A2*F*T.
T = A*(F*U) = F*(A*F*U) By combining a fixed mapping with an untrained mapping before training is started, PRTools is able to combine the fixed mapping with the trained result. Herewith new data can be directly applied to T.
U3 = U1*U2
Combining untrained mappings results in a new untrained mapping.
U2 = A*U1*U2 = T1*U2 Training a set of two untrained mappings like this just trains the first.
T = A*(U1*U2) = A*U1*(A*(A*U1)*U2)
Training a combined set of untrained mappings trains both, in a proper way and combines the combined trained mapping such that it can be directly applied to new data from the same source as T.
Tn = A*[U1 U2 U3 ... Uk]*V Training a stacked combiner, combined by the fixed combiner V
Tn = A**([U1 U2 U3 ... Uk]*U) Training a stacked combiner, combined by the yet untrained combiner U
Tn = A*[U1;U2;U3 ...;Uk]*V Training a parallel combiner, combined by the fixed combiner V
Tn = A*([U1;U2;U3 ...;Uk]*U) Training a parallel combiner, combined by the yet untrained combiner U

An example is:

A1 = gendatb; % training set
A2 = gendatb; % independent test set
T1 = A1*(pcam([],1)*fisherc);
T2 = A1*pcam([],1)*(A1*(A1*pcam([],1))*fisherc);

disp([A1*T1*testc A1*T2*testc])

disp([A2*T1*testc A2*T2*testc])

The results for T1 and T2 are the same, as PRTools implicitly computes T2 as T1;

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.

 
Print Friendly, PDF & Email