CompactClassificationECOC
statistics: CompactClassificationECOC
A multiclass model built from binary learners, without its training data.
A CompactClassificationECOC carries the binary learners of an error
correcting output codes model and the coding matrix that says what each of
them was trained to tell apart, and nothing else: the predictor data, the
labels and the weights are gone, so it predicts and scores new data but
cannot be refitted or cross validated.
It comes from compact on a ClassificationECOC, and from
fitcecoc itself when the binary learners are linear or kernel
classifiers, which carry no training data of their own.
See also: fitcecoc, ClassificationECOC, designecoc
Source Code: CompactClassificationECOC
The CompactClassificationECOC class contains the following properties:
A cell column with one trained model per column of
CodingMatrix, each telling the classes that column marks +1
from those it marks -1. This property is read-only.
A KxL matrix of -1, 0 and +1 with one row per class and one column per binary learner. A class marked 0 took no part in that learner. This property is read-only.
A row with one element per binary learner, the total observation weight of the classes that learner took part in. This property is read-only.
The distinct labels seen in the training data, in the order the rows
of CodingMatrix, Prior and Cost take them. This
property is read-only.
One of 'binodeviance', 'exponential',
'hamming', 'hinge', 'linear',
'logit' or 'quadratic'.
A learner scoring on (-Inf,+Inf) takes every one of them but
'quadratic', and one scoring on [0,1] takes only
'hamming' and 'quadratic': a loss reads a score
against the interval it was written for, and the other way round it
would read a posterior as a signed score. Assigning one the learners
cannot take raises.
A KxK matrix whose (i,j) element is the cost of calling a member of class i a member of class j.
A character vector naming one of the transforms
parseScoreTransform accepts, or a function handle.
The CompactClassificationECOC class offers the following public methods:
CompactClassificationECOC: label = predict (obj, XC)
CompactClassificationECOC: [label, NegLoss] = predict (…)
CompactClassificationECOC: [label, NegLoss, PBScore] = predict (…)
CompactClassificationECOC: […] = predict (…, name, value)
label = predict (obj, XC) sends each row of
XC to every binary learner, turns the scores they return into a
cost per class, and returns the class of least cost. XC must
have as many columns as the data the model was fitted on.
[label, NegLoss] = predict (…) also returns
the NxK negated average loss, the largest entry of a row naming
the class that row was given.
[label, NegLoss, PBScore] = predict (…)
also returns the NxL scores the binary learners gave the class
each was trained to call +1.
| Name | Value | |
|---|---|---|
'BinaryLoss' | The loss to read the binary
scores with, overriding the BinaryLoss property for this call. | |
'Decoding' | 'lossweighted' (default) or
'lossbased'. The first averages the loss over the learners a
class took part in, the second over every learner, a class that sat a
column out costing the same there as a class at the decision boundary. |
See also: CompactClassificationECOC, ClassificationECOC, fitcecoc
CompactClassificationECOC: obj = discardSupportVectors (obj)
obj = discardSupportVectors (obj) empties
Alpha, SupportVectors and SupportVectorLabels on
every binary learner that is a support vector machine on a linear
kernel, whose linear model stands in for them exactly, so nothing the
model answers changes. Any other learner is left as it is, a code
being free to mix them, and a model with no linear support vector
machine among its learners warns and is returned unchanged.
See also: CompactClassificationECOC, ClassificationSVM.discardSupportVectors
CompactClassificationECOC: sub = selectModels (obj, idx)
sub = selectModels (obj, idx) narrows every
binary learner to the strengths idx names, which may be indices
into the learner’s Lambda or a logical vector over it. Only a
linear learner is fitted over several strengths, so any other raises.
See also: CompactClassificationECOC, ClassificationLinear.selectModels
CompactClassificationECOC: m = margin (obj, X, Y)
CompactClassificationECOC: m = margin (…, name, value)
m = margin (obj, X, Y) returns one
margin per row of X: the negated loss of the true class less the
largest negated loss among the others. A positive margin means the
row was classified correctly, and the larger it is the further the
decision was from going the other way.
It takes the same 'BinaryLoss' and 'Decoding'
arguments predict does.
See also: CompactClassificationECOC.predict, CompactClassificationECOC.edge
CompactClassificationECOC: e = edge (obj, X, Y)
CompactClassificationECOC: e = edge (…, name, value)
e = edge (obj, X, Y) returns the
weighted mean of the margins, one number for the whole of X.
It takes 'Weights' beside the arguments predict takes.
See also: CompactClassificationECOC.margin, CompactClassificationECOC.loss
CompactClassificationECOC: L = loss (obj, X, Y)
CompactClassificationECOC: L = loss (…, name, value)
L = loss (obj, X, Y) returns the
weighted classification loss of X against the true labels
Y.
| Name | Value | |
|---|---|---|
'LossFun' | 'classiferror' (default),
'classifcost', 'mincost', 'binodeviance',
'exponential', 'hinge', 'logit' or
'quadratic'. | |
'Weights' | One nonnegative weight per row of X. The default is uniform. |
It also takes the 'BinaryLoss' and 'Decoding'
arguments predict takes.
See also: CompactClassificationECOC.predict, CompactClassificationECOC.edge