Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Kernel model template

`templateKernel`

creates a template suitable for fitting a
Gaussian kernel classification model for nonlinear classification.

The template specifies the binary learner model, number of dimensions of expanded space,
kernel scale, box constraint, and regularization strength, among other parameters. After
creating the template, train the model by passing the template and data to `fitcecoc`

.

`t = templateKernel()`

`t = templateKernel(Name,Value)`

returns a kernel model
template.`t`

= templateKernel()

If you create a default template, then the software uses default values for all input arguments during training.

returns a template with additional options specified by one or more name-value pair
arguments. For example, you can implement logistic regression or specify the number of
dimensions of the expanded space.`t`

= templateKernel(`Name,Value`

)

If you display `t`

in the Command Window, then some properties of
`t`

appear empty (`[]`

). During training, the software
uses default values for the empty properties.

`templateKernel`

minimizes the regularized objective function using a Limited-memory Broyden-Fletcher-Goldfarb-Shanno (LBFGS) solver with ridge (*L*_{2}) regularization. To find the type of LBFGS solver used for training, type `FitInfo.Solver`

in the Command Window.

`'LBFGS-fast'`

— LBFGS solver.`'LBFGS-blockwise'`

— LBFGS solver with a block-wise strategy. If`templateKernel`

requires more memory than the value of`BlockSize`

to hold the transformed predictor data, then it uses a block-wise strategy.`'LBFGS-tall'`

— LBFGS solver with a block-wise strategy for tall arrays.

When `templateKernel`

uses a block-wise strategy, `templateKernel`

implements LBFGS by distributing the calculation of the loss and gradient among different parts of the data at each iteration. Also, `templateKernel`

refines the initial estimates of the linear coefficients and the bias term by fitting the model locally to parts of the data and combining the coefficients by averaging. If you specify `'Verbose',1`

, then `templateKernel`

displays diagnostic information for each data pass and stores the information in the `History`

field of `FitInfo`

.

When `templateKernel`

does not use a block-wise strategy, the initial estimates are zeros. If you specify `'Verbose',1`

, then `templateKernel`

displays diagnostic information for each iteration and stores the information in the `History`

field of `FitInfo`

.

[3] Huang, P. S., H. Avron, T. N.
Sainath, V. Sindhwani, and B. Ramabhadran. “Kernel methods match Deep Neural Networks
on TIMIT.” *2014 IEEE International Conference on Acoustics, Speech and
Signal Processing*. 2014, pp. 205–209.