Categories &

Functions List

Class Definition: ClassificationECOC

statistics: ClassificationECOC

A multiclass model built from binary learners.

An error correcting output codes model turns a problem of K classes into a set of two class problems. A coding matrix gives one column per binary learner saying which classes that learner calls +1, which it calls -1, and which sit it out; a new observation is sent to every learner and given the class whose column of the matrix its scores match most closely.

The fit is carried out by the learners themselves, whichever fitcecoc was asked for, and the decoding by CompactClassificationECOC, which this class holds the data of a fit on top of.

See also: fitcecoc, CompactClassificationECOC, designecoc

Source Code: ClassificationECOC

The ClassificationECOC class contains the following properties:

An NxL matrix of -1, 0 and +1, row n being the row of CodingMatrix belonging to that observation’s class. This property is read-only.

The ClassificationECOC class offers the following public methods:

ClassificationECOC: obj = ClassificationECOC (X, Y)
ClassificationECOC: obj = ClassificationECOC (…, name, value)

obj = ClassificationECOC (X, Y) fits one binary learner per column of a one against one coding design and returns them as a ClassificationECOC object. fitcecoc is the documented way in, and its help lists the options both take.

See also: fitcecoc, CompactClassificationECOC, designecoc

ClassificationECOC: CVMdl = crossval (obj)
ClassificationECOC: CVMdl = crossval (…, name, value)

CVMdl = crossval (obj) partitions the training data into ten folds, fits the same model to each fold’s training part, and returns them as a ClassificationPartitionedECOC.

NameValue
'KFold'The number of folds, an integer greater than one. The default is ten, or the number of observations when there are fewer than ten.
'Holdout'The share of the data held out, a number strictly between 0 and 1.
'Leaveout''on' for one fold per observation, 'off' otherwise.
'CVPartition'A cvpartition object, which names the folds outright.

Only one of the four may be given.

See also: ClassificationECOC, ClassificationPartitionedECOC, cvpartition

ClassificationECOC: CMdl = compact (obj)

CMdl = compact (obj) returns a CompactClassificationECOC carrying the binary learners and the coding matrix but not X, Y or W, so it predicts and scores new data but cannot be refitted or cross validated.

See also: ClassificationECOC, CompactClassificationECOC

ClassificationECOC: label = predict (obj, XC)
ClassificationECOC: [label, NegLoss, PBScore] = predict (…)
ClassificationECOC: […] = predict (…, name, value)

It takes and returns exactly what CompactClassificationECOC.predict does, the training data playing no part in a prediction.

See also: ClassificationECOC, CompactClassificationECOC.predict

ClassificationECOC: 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: ClassificationECOC, ClassificationSVM.discardSupportVectors

ClassificationECOC: 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: ClassificationECOC, ClassificationLinear.selectModels

ClassificationECOC: m = margin (obj, X, Y)

See also: CompactClassificationECOC.margin

ClassificationECOC: e = edge (obj, X, Y)

See also: CompactClassificationECOC.edge

ClassificationECOC: L = loss (obj, X, Y)

See also: CompactClassificationECOC.loss

ClassificationECOC: label = resubPredict (obj)

See also: ClassificationECOC.predict

ClassificationECOC: m = resubMargin (obj)

See also: ClassificationECOC.margin

ClassificationECOC: e = resubEdge (obj)

See also: ClassificationECOC.edge

ClassificationECOC: L = resubLoss (obj)

See also: ClassificationECOC.loss