PRTools contents

PRTools manual

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 Untrained classifiers (mapping)
 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 minimized, 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
  DESCRIPTIOM 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).  Matlab's 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.

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, crossval, testc, getopt_pars,

PRTools contents

PRTools manual