Optimise regularisation and complexity parameters by crossvalidation
[W,PARS] = REGOPTC(A,CLASSF,PARS,DEFS,NPAR,PAR_MIN_MAX,TESTFUN,REALINT)
This routine is used inside classifiers and mappings to optimise a regularisation or complexity parameter. Using cross-validation the performance of the classifier is estimated using TESTFUN (e.g. TESTC). FMINBND is used for the optimisation. Only the parameters in PARS that are set to NaN are optimised. For the other ones the given values are used in the internal calls to CLASSF in REGOPTC. In case mulitple parameters are set to NaN they are optimised in the order supplied by NPAR.
The final parameters PARS can also be retrieved by GETOPT_PARS. This is useful if W is optimised inside training a classifier that does not return these parameters in the output.
For examples of usage inside a classifier see LDC and SVC. Consequently LDC can be called as in the below example.
Some globals are used to specify the optimisation. Users may change them by PRGLOBAL. See the FAQ on this topic.
A = gendatd([30 30],50);
datasets, mappings, prcrossval, testc, getopt_pars, prglobal,