templateLinear
statistics: T = templateLinear ()
statistics: T = templateLinear (name, value)
Create a template for a linear classifier for high dimensional data.
T = templateLinear () returns a template carrying the default
options of ClassificationLinear. A template names a learner and
the options it is to be fitted with, without fitting anything: it is given
to a function that fits many models, such as fitcecoc, which uses it
for every binary learner it trains.
T = templateLinear (name, value) also stores
the given options. They are the name-value arguments of
fitclinear, and any of them may be given here instead.
T = templateLinear ('Learner', 'logistic', 'Lambda', 1e-4);
Mdl = fitcecoc (X, Y, 'Learners', T);
|
T is a structure carrying Method, Type and one
field per option given.
MATLAB returns an object of a class whose name we cannot use, which has no
public properties and one method this package declines package wide, so a
structure carries everything a user can observe. This is what
ModelParameters already does throughout the package.
An option name is not checked here. ClassificationLinear owns
the list of options it takes and checks it when the template is used, so a
name it does not know is refused then rather than now.
See also: fitcecoc, ClassificationLinear, fitclinear
Source Code: templateLinear