PRTools Contents

PRTools User Guide

regoptc

REGOPTC

Optimise regularisation and complexity parameters by crossvalidation

     [W,PARS] = REGOPTC(A,CLASSF,PARS,DEFS,NPAR,PAR_MIN_MAX,TESTFUN,REALINT)

Input
 A Dataset, training set
 CLASSF String containing the name of the classifier routine.
 PARS Cell array with parameters for CLASSF
 DEFS Defaults for PARS
 NPAR Index in PARS of parameters to be optimised
 PAR_MIN_MAX Minimum and maximum values of the search interval for  the parameters to be optimised
 TESTFUN Criterion function to be minimised, default TESTC
 REALINT 0/1 vector, indicating for every parameter in PARS whether  it is real (1) or integer (0). Default: all real.

Output
 W Best classifier, trained by A
 PARS Resulting parameter vector

Description

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.

Example(s)

 A = gendatd([30 30],50);
 W = ldc(A,0,NaN); % set first reg par to 0 and optimise second.
 getopt_pars       % retrieve optimal paameter set

See also

datasets, mappings, prcrossval, testc, getopt_pars, prglobal,

PRTools Contents

PRTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.