# doc-cache created by Octave 11.2.0
# name: cache
# type: cell
# rows: 3
# columns: 1449
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 818
statistics: ClassificationBaggedEnsemble

Bagged ensemble of decision trees for classification

A ClassificationBaggedEnsemble object holds decision trees each
grown on a sample drawn from the training data in proportion to the
observation weights, each split chosen from ceil (sqrt (P))
predictors drawn afresh at every node. It predicts by averaging its
trees&rsquo; class probabilities.

Create one with fitcensemble and 'Method' set to
'Bag' . It carries everything a ClassificationEnsemble
does, and which rows each tree drew. A boosting method that resamples,
asked for with 'Resample' , 'FResample' or
'Replace' , returns this class too: its trees are boosted and
summed by their weights, each grown on the rows it drew.

See also:
fitcensemble,
ClassificationEnsemble,
CompactClassificationEnsemble,
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Bagged ensemble of decision trees for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationBaggedEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
ClassificationEnsemble: property BinEdges

Bin edges of the predictors

Always empty, binning not being implemented. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
ClassificationBaggedEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
ClassificationEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationBaggedEnsemble.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
ClassificationEnsemble: property ClassNames

Names of the classes

The classes, in the type of the response, sorted or in the order given
by the 'ClassNames' option; the columns of the scores take them
in that order. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
ClassificationBaggedEnsemble.ClassificationBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 364
ClassificationBaggedEnsemble: obj = ClassificationBaggedEnsemble ( X , Y )
ClassificationBaggedEnsemble: obj = ClassificationBaggedEnsemble (&hellip;, name , value )

Fit a bagged ensemble of decision trees.

fitcensemble with 'Method' set to 'Bag' is the
documented way in, and its help lists the options both take.

See also:
fitcensemble,
ClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Fit a bagged ensemble of decision trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationBaggedEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 167
ClassificationEnsemble: property CombineWeights

How the weak learners are combined

'WeightedSum' for boosting, 'WeightedAverage' for
Bag. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
How the weak learners are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationBaggedEnsemble.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
ClassificationEnsemble: property Cost

Misclassification costs

A square matrix, Cost(i,j) being the cost of classifying an
observation of class i as class j . A boosting method
starts from observation weights multiplied by the total cost of
misclassifying each observation&rsquo;s class. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Misclassification costs



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationBaggedEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 163
ClassificationEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationBaggedEnsemble.FResample


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
ClassificationBaggedEnsemble: property FResample

Share of the observations each tree draws

A number greater than 0 and no greater than 1, each tree drawing
ceil (FResample * N) observations. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Share of the observations each tree draws



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.FitInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 446
ClassificationEnsemble: property FitInfo

Fit information

A column with one element per learner: the weighted classification error
for AdaBoostM1, the weighted pseudo-loss for AdaBoostM2 and RUSBoost, and
the weighted mean squared error of the regression tree for GentleBoost
and LogitBoost. For LPBoost and TotalBoost a matrix with a row per
learner: its margin on each observation, and its edge last. Empty for
Bag. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Fit information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationBaggedEnsemble.FitInfoDescription


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 104
ClassificationEnsemble: property FitInfoDescription

Description of FitInfo

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Description of FitInfo



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
ClassificationBaggedEnsemble.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 193
ClassificationEnsemble: property HyperparameterOptimizationResults

Results of optimizing the hyperparameters

Always empty, such optimization not being implemented. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Results of optimizing the hyperparameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationBaggedEnsemble.LearnerNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
ClassificationEnsemble: property LearnerNames

Names of the weak learners

{'Tree'} , or for Subspace {'KNN'} or
{'Discriminant'} . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Names of the weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationBaggedEnsemble.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
ClassificationEnsemble: property Method

Ensemble method

'AdaBoostM1' , 'AdaBoostM2' , 'GentleBoost' ,
'LogitBoost' , 'RUSBoost' , 'LPBoost' ,
'TotalBoost' , 'Bag' or 'Subspace' . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Ensemble method



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationBaggedEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 284
ClassificationEnsemble: property ModelParameters

Parameters of the fit

A structure with the fields Type , Method ,
LearnerTemplates , the tree template the learners were grown
from, NLearn , the number of learning cycles asked for in all,
and LearnRate . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Parameters of the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationBaggedEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 106
ClassificationEnsemble: property NumObservations

Number of observations used

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of observations used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationBaggedEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationEnsemble: property NumTrained

Number of trained weak learners

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Number of trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationBaggedEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 136
ClassificationEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationBaggedEnsemble.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
ClassificationEnsemble: property Prior

Prior probabilities of the classes

A row vector with one probability per class. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationBaggedEnsemble.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationEnsemble: property ReasonForTermination

Why the fit stopped adding learners

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Why the fit stopped adding learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.Replace


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 151
ClassificationBaggedEnsemble: property Replace

Whether the trees draw with replacement

A logical scalar, true by default. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Whether the trees draw with replacement



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationBaggedEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationBaggedEnsemble.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
ClassificationEnsemble: property RowsUsed

Rows of the data that were used

A logical column over the rows as supplied. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Rows of the data that were used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationBaggedEnsemble.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
ClassificationEnsemble: property ScoreTransform

Transform applied to the predicted scores

See CompactClassificationEnsemble.ScoreTransform .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Transform applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
ClassificationEnsemble: property Trained

Trained weak learners

A column cell array of compact trees, as described under
CompactClassificationEnsemble.Trained . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationBaggedEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 152
ClassificationEnsemble: property TrainedWeights

Weights of the trained weak learners

A column with one weight per learner. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Weights of the trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationBaggedEnsemble.UseObsForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
ClassificationBaggedEnsemble: property UseObsForLearner

Which observations each tree drew

An NxNumTrained logical matrix, true where a tree&rsquo;s sample holds
an observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Which observations each tree drew



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationBaggedEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 261
ClassificationEnsemble: property UsePredForLearner

Which predictors each learner uses

For the 'Subspace' method, a logical matrix with one row per
predictor and one column per learner. Empty for tree learners, as
MATLAB returns it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationBaggedEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
ClassificationEnsemble: property W

Observation weights

The weights given, scaled so that the observations of each class sum
to its prior probability. A cost matrix is not folded into them.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationBaggedEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationEnsemble: property X

Predictor data

The predictors the ensemble was fitted on, one row per observation, a
row missing a value or a class having been left out. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationBaggedEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
ClassificationEnsemble: property Y

Class labels

The labels the ensemble was fitted on, in the type they were given in.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 254
ClassificationBaggedEnsemble: CMdl = compact ( obj )

Drop the training data from a bagged ensemble.

Returns a CompactClassificationEnsemble , as
ClassificationEnsemble.compact does.

See also:
ClassificationBaggedEnsemble,
CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Drop the training data from a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationBaggedEnsemble.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 331
ClassificationBaggedEnsemble: CVMdl = crossval ( obj )
ClassificationBaggedEnsemble: CVMdl = crossval (&hellip;, name , value )

Cross-validate a bagged ensemble.

Behaves as ClassificationEnsemble.crossval , returning a
ClassificationPartitionedEnsemble .

See also:
ClassificationBaggedEnsemble,
ClassificationPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Cross-validate a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationBaggedEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
ClassificationBaggedEnsemble: e = edge ( obj , X , Y )
ClassificationBaggedEnsemble: e = edge (&hellip;, name , value )

Classification edge of a bagged ensemble.

Behaves as CompactClassificationEnsemble.edge .

See also:
ClassificationBaggedEnsemble,
CompactClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification edge of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationBaggedEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
ClassificationBaggedEnsemble: L = loss ( obj , X , Y )
ClassificationBaggedEnsemble: L = loss (&hellip;, name , value )

Classification loss of a bagged ensemble.

Behaves as CompactClassificationEnsemble.loss .

See also:
ClassificationBaggedEnsemble,
CompactClassificationEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification loss of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationBaggedEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 298
ClassificationBaggedEnsemble: m = margin ( obj , X , Y )
ClassificationBaggedEnsemble: m = margin (&hellip;, name , value )

Classification margins of a bagged ensemble.

Behaves as CompactClassificationEnsemble.margin .

See also:
ClassificationBaggedEnsemble,
CompactClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Classification margins of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.oobEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 340
ClassificationBaggedEnsemble: e = oobEdge ( obj )
ClassificationBaggedEnsemble: e = oobEdge (&hellip;, name , value )

Out-of-bag classification edge.

The weighted mean of the out-of-bag margins, weighted by W .
'Mode' and 'Learners' are taken as by oobLoss .

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.oobMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Out-of-bag classification edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.oobLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
ClassificationBaggedEnsemble: L = oobLoss ( obj )
ClassificationBaggedEnsemble: L = oobLoss (&hellip;, name , value )

Out-of-bag classification loss.

The loss of the out-of-bag scores against Y , weighted by
W , an observation in the sample of every tree used being left
out. 'LossFun' and 'Mode' are taken as by
CompactClassificationEnsemble.loss , and 'Learners'
restricts the trees.

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.oobPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Out-of-bag classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationBaggedEnsemble.oobMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 366
ClassificationBaggedEnsemble: m = oobMargin ( obj )
ClassificationBaggedEnsemble: m = oobMargin (&hellip;, &rsquo;Learners&rsquo;, idx )

Out-of-bag classification margins.

The margin of each training observation under its out-of-bag scores,
NaN for one in the sample of every tree used.

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.oobEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Out-of-bag classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
ClassificationBaggedEnsemble.oobPermutedPredictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 692
ClassificationBaggedEnsemble: imp = oobPermutedPredictorImportance ( obj )
ClassificationBaggedEnsemble: imp = oobPermutedPredictorImportance (&hellip;, &rsquo;Learners&rsquo;, idx )

Out-of-bag predictor importance by permutation.

For each tree, the values of each predictor are permuted among the
observations out of its bag, and the tree&rsquo;s misclassification rate on
them, weighted by W , is taken before and after. imp holds,
for each predictor, the mean of the rise over the trees divided by its
standard deviation over the trees, zero where the mean is zero.
'Learners' restricts the trees.

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Out-of-bag predictor importance by permutation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationBaggedEnsemble.oobPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 656
ClassificationBaggedEnsemble: label = oobPredict ( obj )
ClassificationBaggedEnsemble: [ label , scores ] = oobPredict (&hellip;)
ClassificationBaggedEnsemble: [&hellip;] = oobPredict (&hellip;, &rsquo;Learners&rsquo;, idx )

Out-of-bag predictions for the training data.

Each training observation is classified by the trees whose samples
left it out, as predict classifies it with
'UseObsForLearner' set to ! UseObsForLearner . An
observation in the sample of every tree used has NaN scores and
is given the class of greatest prior probability. 'Learners'
restricts the trees.

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.oobLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Out-of-bag predictions for the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationBaggedEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 378
ClassificationBaggedEnsemble: label = predict ( obj , X )
ClassificationBaggedEnsemble: [ label , scores ] = predict (&hellip;)
ClassificationBaggedEnsemble: [&hellip;] = predict (&hellip;, name , value )

Classify new data with a bagged ensemble.

Behaves as CompactClassificationEnsemble.predict .

See also:
ClassificationBaggedEnsemble,
CompactClassificationEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classify new data with a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationBaggedEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
ClassificationBaggedEnsemble: imp = predictorImportance ( obj )
ClassificationBaggedEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

The mean over the trees of each tree&rsquo;s predictorImportance , as
CompactClassificationEnsemble.predictorImportance computes it.

See also:
ClassificationBaggedEnsemble,
ClassificationBaggedEnsemble.oobPermutedPredictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationBaggedEnsemble.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
ClassificationBaggedEnsemble: e = resubEdge ( obj )
ClassificationBaggedEnsemble: e = resubEdge (&hellip;, name , value )

Classification edge of a bagged ensemble on the training data.

Behaves as ClassificationEnsemble.resubEdge .

See also:
ClassificationBaggedEnsemble,
ClassificationEnsemble.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Classification edge of a bagged ensemble on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationBaggedEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
ClassificationBaggedEnsemble: L = resubLoss ( obj )
ClassificationBaggedEnsemble: L = resubLoss (&hellip;, name , value )

Classification loss of a bagged ensemble on the training data.

Behaves as ClassificationEnsemble.resubLoss .

See also:
ClassificationBaggedEnsemble,
ClassificationEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Classification loss of a bagged ensemble on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationBaggedEnsemble.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 317
ClassificationBaggedEnsemble: m = resubMargin ( obj )
ClassificationBaggedEnsemble: m = resubMargin (&hellip;, name , value )

Classification margins of the training data of a bagged ensemble.

Behaves as ClassificationEnsemble.resubMargin .

See also:
ClassificationBaggedEnsemble,
ClassificationEnsemble.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Classification margins of the training data of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationBaggedEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 312
ClassificationBaggedEnsemble: label = resubPredict ( obj )
ClassificationBaggedEnsemble: [ label , scores ] = resubPredict (&hellip;)

Classify the training data with a bagged ensemble.

Behaves as ClassificationEnsemble.resubPredict .

See also:
ClassificationBaggedEnsemble,
ClassificationEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Classify the training data with a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationBaggedEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 357
ClassificationBaggedEnsemble: B = resume ( obj , NumLearningCycles )
ClassificationBaggedEnsemble: B = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more trees in a bagged ensemble.

Behaves as ClassificationEnsemble.resume , the new trees&rsquo; samples
added to UseObsForLearner .

See also:
ClassificationBaggedEnsemble,
ClassificationEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Grow more trees in a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1448
statistics: ClassificationDiscriminant

Discriminant analysis classification

The ClassificationDiscriminant class implements a
discriminant analysis classifier object, which can predict responses for
new data using the predict method.

Discriminant analysis classification is a statistical method used to
classify observations into predefined groups based on their
characteristics. It estimates the parameters of different distributions
for each class and predicts the class of new observations by finding the
one with the smallest misclassification cost.

Create a ClassificationDiscriminant object by using the
fitcdiscr function or the class constructor.

Six discriminant types are available, in two families. The linear family,
'linear' , 'diagLinear' and 'pseudoLinear' , pools
one covariance across the classes and separates them with a hyperplane.
The quadratic family, 'quadratic' , 'diagQuadratic' and
'pseudoQuadratic' , estimates a covariance per class and separates
them with a quadric. A 'diag' type keeps only the variances,
which is the same model as a Gamma of 1, and a 'pseudo'
type inverts a singular covariance rather than refusing it.

DiscrimType may be assigned after fitting, but only within
its own family : the family is fixed when the model is fitted, because it
decides which covariances the fit has to estimate. Assigning it, or
Gamma , re-derives Sigma , LogDetSigma and
Coeffs without refitting.

See also:
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Discriminant analysis classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationDiscriminant.BetweenSigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 750
ClassificationDiscriminant: property BetweenSigma

Between-class covariance matrix

A P -by- P matrix holding the covariance of the class means
about the overall mean, weighted by how many observations each class
contributes. With n_k observations in class k ,
p_k = n_k / n and \bar{\mu} = \sum_k p_k \mu_k , it is

BetweenSigma = sum_k n_k (Mu(k,:) - mubar)' * (Mu(k,:) - mubar)
/ (n * (1 - sum_k p_k^2))

The denominator is the unbiased one for a weighted covariance, so a
balanced fit divides by n (K-1) / K . It reads the class
sizes , not Prior : assigning a prior leaves it where it was. It
is estimated for every discriminant type, the quadratic family included,
since it describes the classes rather than the fit. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Between-class covariance matrix



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationDiscriminant.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 374
ClassificationDiscriminant: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationDiscriminant.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 238
ClassificationDiscriminant: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationDiscriminant.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 411
ClassificationDiscriminant: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
ClassificationDiscriminant.ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3447
statistics: obj = ClassificationDiscriminant ( X , Y )
statistics: obj = ClassificationDiscriminant (&hellip;, name , value )

Create a ClassificationDiscriminant class object containing a
discriminant analysis model.

obj = ClassificationDiscriminant ( X , Y ) returns
a ClassificationDiscriminant object, with X as the predictor data
and Y containing the class labels of observations in X .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables. X will be used to train the discriminant model.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y can contain any type
of categorical data. Y must have the same number of rows as
X .

obj = ClassificationDiscriminant (&hellip;, name ,
value ) returns a ClassificationDiscriminant object with parameters
specified by the following name , value paired input
arguments:

Name Value
'PredictorNames' A cell array of character
vectors specifying the names of the predictors. The length of this array
must match the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the Discriminant model.
ClassNames are of the same type as the class labels in Y .
'Cost' An N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X , where
R is the number of unique categories in Y . If an instance
is correctly classified into its category the cost is calculated to be 1,
otherwise 0. The cost matrix can be altered by using
Mdl .cost = somecost . By default, its value is
cost = ones (rows (X), numel (unique (Y))) .
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
Alternatively, you can specify 'empirical' to use the empirical
class probabilities or 'uniform' to assume equal class
probabilities.
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . They weigh the class means and
covariances, the covariances being unbiased for them, and an empirical
prior sums them per class. Only their proportions matter, and a row of
zero weight is left out of the fit.
'ScoreTransform' A user-defined function handle
or a character vector specifying one of the following builtin functions
specifying the transformation applied to predicted classification scores.
Supported values include 'doublelogit' , 'invlogit' ,
'ismax' , 'logit' , 'none' , 'identity' ,
'sign' , 'symmetric' , 'symmetricismax' , and
'symmetriclogit' .
'DiscrimType' A character vector or string scalar
specifying the type of discriminant analysis to perform. The only
supported value is 'linear' .
'FillCoeffs' A character vector or string scalar
with values 'on' or 'off' specifying whether to fill the
coefficients after fitting. If set to 'on' , the coefficients are
computed during model fitting, which can be useful for prediction.
'Gamma' A numeric scalar specifying the
regularization parameter for the covariance matrix. It adjusts the linear
discriminant analysis to make the model more stable in the presence of
multicollinearity or small sample sizes. A value of 0 corresponds to no
regularization, while a value of 1 corresponds to
a completely regularized model.

See also:
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
Create a ClassificationDiscriminant class object containing a discriminant analysis model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationDiscriminant.Coeffs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 872
ClassificationDiscriminant: property Coeffs

Coefficient matrices

A K&times;K structure containing the coefficient matrices, where
K is the number of classes. If the 'FillCoeffs' parameter
was set to 'off' in either the fitcdiscr function or the
ClassificationDiscriminant constructor, then Coeffs is
empty ([]) . This property is read-only.

Coeffs(i,j) contains the coefficients of the boundary between
the classes i and j in the following fields:

DiscrimType - A character vector
Class1 - ClassNames (i)
Class2 - ClassNames (j)
Const - A scalar
Linear - A vector with length as the number of predictors.
Quadratic - The quadratic family only. A PxP
matrix, or a 1xP vector for 'diagQuadratic' , following
the shape of Sigma .

The diagonal entries carry the two class names and nothing else. The
structure is rebuilt whenever DiscrimType , Gamma or
Prior is assigned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Coefficient matrices



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationDiscriminant.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1205
ClassificationDiscriminant: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

Add or change the Cost property using dot notation as in:

obj .Cost = costMatrix

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationDiscriminant.Delta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 809
ClassificationDiscriminant: property Delta

Delta threshold for the linear coefficients

A nonnegative scalar that eliminates predictors. A per-class linear
coefficient is set to zero when it falls below Delta , and the
comparison is made on the standardized coefficient, the
coefficient times the within-class standard deviation of its predictor.
Scaling matters here: a threshold on the raw coefficients would depend
on the units each predictor is measured in, so the same model in
centimetres and in metres would drop different predictors.

DeltaPredictor reports, per predictor, the value at which it
drops out of every class at once.

It applies to the linear family only, a quadratic discriminant having no
linear coefficients to eliminate. Assigning it rebuilds Coeffs
and changes what predict answers.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Delta threshold for the linear coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationDiscriminant.DeltaPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 482
ClassificationDiscriminant: property DeltaPredictor

Minimum Delta at which each predictor drops out

A row vector with one entry per predictor, the value of Delta at
which that predictor&rsquo;s coefficient is zero for every class and the
predictor leaves the model altogether. It is all zeros for the
quadratic family, which has no linear coefficients to eliminate.

This property is read-only, and it describes the fit rather than the
threshold: assigning Delta does not move it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Minimum Delta at which each predictor drops out



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationDiscriminant.DiscrimType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 796
ClassificationDiscriminant: property DiscrimType

Discriminant type

A character vector naming the discriminant model, one of
'linear' , 'quadratic' , 'diagLinear' ,
'diagQuadratic' , 'pseudoLinear' or
'pseudoQuadratic' . A linear type pools one covariance across
the classes; a quadratic type estimates one per class. A
'diag' type keeps only the variances, and a 'pseudo'
type inverts a singular covariance instead of refusing it.

This property may be assigned, but only within its own family :
the three linear types interchange freely and so do the three quadratic
ones, while no assignment moves a model between the two. The family is
fixed when the model is fitted, because it decides which covariances the
fit has to estimate. Assigning re-derives Sigma ,
LogDetSigma , Gamma and Coeffs .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Discriminant type



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationDiscriminant.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 271
ClassificationDiscriminant: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationDiscriminant.Gamma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 513
ClassificationDiscriminant: property Gamma

Gamma regularization parameter

A scalar from 0 to 1 shrinking the covariance towards its diagonal.
Gamma and DiscrimType are one state: a value of 1 is the
diagonal type, so assigning it renames DiscrimType to
'diagLinear' or 'diagQuadratic' , and assigning a
diagonal type sets Gamma to 1.

The quadratic family admits 0 and 1 only. A value below
MinGamma is refused, since it would leave the covariance
singular. Assigning re-derives Sigma , LogDetSigma and
Coeffs .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Gamma regularization parameter



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
ClassificationDiscriminant.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 369
ClassificationDiscriminant: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationDiscriminant.LogDetSigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 618
ClassificationDiscriminant: property LogDetSigma

Logarithm of the determinant of the within-class covariance matrix

A scalar for the linear family and a Kx1 vector for the quadratic
one, one entry per class. It is computed in correlation space, as the
sum of the logarithms of the predictor variances plus the log
determinant of the correlation matrix, which is far better conditioned
than the covariance when the data are nearly collinear. A predictor
with no variance contributes nothing rather than an infinity, and the
'pseudo' types sum only over the directions that carry variance.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Logarithm of the determinant of the within-class covariance matrix



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationDiscriminant.MinGamma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 444
ClassificationDiscriminant: property MinGamma

Minimum value for the Gamma regularization parameter

A scalar from 0 to 1, the least regularization that leaves the
correlation matrix invertible. It is 0 when the matrix is already
invertible, and positive when the predictors are collinear, in which
case a plain 'linear' or 'quadratic' fit is raised to it
rather than failing. Assigning a Gamma below it is refused.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Minimum value for the Gamma regularization parameter



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationDiscriminant.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 477
ClassificationDiscriminant: property ModelParameters

Fitting options, as they were given

A structure holding the parameters of the fit: DiscrimType ,
Gamma , Delta , FillCoeffs , and the
Version , Method and Type tags.

MATLAB reports a SaveMemory field beside these. This class
has no such option and always stores the full covariance, so there is
no setting to report and the field is absent rather than answering for
a knob that does not exist. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationDiscriminant.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 271
ClassificationDiscriminant: property Mu

Class means

A K&times;P numeric matrix specifying the mean of the multivariate
normal distribution of each corresponding class, where K is the
number of classes and P is the number of predictors in X .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
Class means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationDiscriminant.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 248
ClassificationDiscriminant: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the ClassificationDiscriminant model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationDiscriminant.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 242
ClassificationDiscriminant: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationDiscriminant model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationDiscriminant.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 266
ClassificationDiscriminant: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationDiscriminant.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 619
ClassificationDiscriminant: property Prior

Prior probability for each class

A numeric vector specifying the prior probabilities for each class. The
order of the elements in Prior corresponds to the order of the
classes in ClassNames .

Add or change the Prior property using dot notation as in:

obj .Prior = priorVector

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationDiscriminant.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
ClassificationDiscriminant: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationDiscriminant.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 404
ClassificationDiscriminant: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the ClassificationDiscriminant model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationDiscriminant.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1006
ClassificationDiscriminant: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationDiscriminant.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 512
ClassificationDiscriminant: property Sigma

Within-class covariance

A numeric array whose shape follows DiscrimType , with P
predictors and K classes:

DiscrimType Sigma LogDetSigma
'linear' , 'pseudoLinear' PxP
scalar
'quadratic' , 'pseudoQuadratic' PxPxK
Kx1
'diagLinear' 1xP scalar
'diagQuadratic' 1xPxK Kx1

The linear family pools one covariance across the classes and the
quadratic family estimates one per class. This property is read-only,
but it is re-derived whenever DiscrimType or Gamma is
assigned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Within-class covariance



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationDiscriminant.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 253
ClassificationDiscriminant: property W

Observation weights

A numeric column vector with one entry per observation used for fitting:
the 'Weights' given, or equal weights, scaled to sum to one. The
prior does not enter them. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationDiscriminant.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
ClassificationDiscriminant: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationDiscriminant.XCentered


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
ClassificationDiscriminant: property XCentered

Predictor data with class means subtracted

A matrix of the same size as X and the values in X with the
corresponding class means subtracted. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Predictor data with class means subtracted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationDiscriminant.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 318
ClassificationDiscriminant: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationDiscriminant.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 286
ClassificationDiscriminant: CVMdl = compact ( obj )

Create a CompactClassificationDiscriminant object.

CVMdl = compact ( obj ) creates a compact version of the
ClassificationDiscriminant object, obj .

See also:
fitcdiscr,
ClassificationDiscriminant,
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create a CompactClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationDiscriminant.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1076
ClassificationDiscriminant: CVMdl = crossval ( obj )
ClassificationDiscriminant: CVMdl = crossval (&hellip;, Name , Value )

Cross Validate a Discriminant classification object.

CVMdl = crossval ( obj ) returns a cross-validated model
object, CVMdl , from a trained model, obj , using 10-fold
cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv , where
isa ( cv , "cvpartition") = 1.

See also:
fitcdiscr,
ClassificationDiscriminant,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Cross Validate a Discriminant classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationDiscriminant.cvshrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1889
ClassificationDiscriminant: err = cvshrink ( obj )
ClassificationDiscriminant: [ err , gamma ] = cvshrink ( obj )
ClassificationDiscriminant: [ err , gamma , delta ] = cvshrink ( obj )
ClassificationDiscriminant: [ err , gamma , delta , numpred ] = cvshrink ( obj )
ClassificationDiscriminant: [&hellip;] = cvshrink (&hellip;, Name , Value )

Cross validate the regularization of a discriminant.

err = cvshrink ( obj ) cross validates obj over a
grid of Gamma values and returns the misclassification rate at
each of them, so that a regularization can be chosen by what it costs
on held-out data rather than on the data it was fitted to.

[ err , gamma , delta , numpred ] = cvshrink
( obj ) also returns the grid itself and the number of predictors
surviving at each point of it. gamma is a column with one entry
per Gamma ; err , delta and numpred carry one
row per Gamma and one column per Delta .

Name Value
'NumGamma' The number of Gamma intervals, a
positive integer, 10 by default, giving NumGamma + 1 values
evenly spaced from 0 to 1.
'NumDelta' The number of Delta intervals, a
non-negative integer, 0 by default. For each Gamma the
Delta values run from 0 to the point at which every predictor
has been eliminated, so the grid is not the same in every row.
'Gamma' The Gamma values to try, given
explicitly as a vector, in place of 'NumGamma' .
'Delta' The Delta values to try, given
explicitly, in place of 'NumDelta' : a vector used for every
Gamma , or a matrix with one row per Gamma .

Every point of the grid is cross validated against the same partition,
so the errors differ by the regularization and not by the split. The
partition is drawn at random, so err is not reproducible across
runs and does not match MATLAB&rsquo;s; gamma , delta and
numpred are deterministic and do.

See also:
ClassificationDiscriminant,
fitcdiscr,
ClassificationDiscriminant.nLinearCoeffs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Cross validate the regularization of a discriminant.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationDiscriminant.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 617
ClassificationDiscriminant: e = edge ( obj , X , Y )
ClassificationDiscriminant: e = edge (&hellip;, "Weights" , w )

Classification edge, the mean of the classification margins.

e = edge ( obj , X , Y ) reduces the vector
that margin returns to a single number, the mean margin over the
rows of X . It says how far the model puts the true class ahead of
its nearest rival on average, so a larger edge is a better model, and
unlike a loss it is not bounded above and rewards confidence rather than
bare correctness.

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge, the mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationDiscriminant.logp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 690
ClassificationDiscriminant: lp = logp ( obj , X )

Log unconditional probability density of the observations.

lp = logp ( obj , X ) returns an Nx1
vector holding, for each row of X , the natural logarithm of
P(x) = sum_k P(k) P(x|k) , the density of the observation summed
over the classes with each class weighted by its prior P(k) .
Each P(x|k) is the multivariate normal density of class
k .

obj must be a ClassificationDiscriminant object.

X must be an NxP numeric matrix with one column per
predictor of the trained model.

An unusually low value marks an observation the model finds unlikely
under every class, which is what makes this an outlier test rather
than a classification.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Log unconditional probability density of the observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationDiscriminant.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1930
ClassificationDiscriminant: L = loss ( obj , X , Y )
ClassificationDiscriminant: L = loss (&hellip;, name , value )

Compute loss for a trained ClassificationDiscriminant object.

L = loss ( obj , X , Y ) computes the loss,
L , using the default loss function 'mincost' .

obj is a ClassificationDiscriminant object trained on
X and Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

L = loss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Compute loss for a trained ClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationDiscriminant.mahal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1013
ClassificationDiscriminant: M = mahal ( obj , X )
ClassificationDiscriminant: M = mahal (&hellip;, 'ClassLabels' , labels )

Squared Mahalanobis distance to the class means.

M = mahal ( obj , X ) returns an NxK
matrix whose element (i,j) is the squared Mahalanobis distance
from observation i to the mean of class j , measured
against the covariance that class carries: the one shared covariance
for a linear discriminant and the class&rsquo;s own for a quadratic one.

obj must be a ClassificationDiscriminant object.

X must be an NxP numeric matrix with one column per
predictor of the trained model.

M = mahal (&hellip;, 'ClassLabels' , labels )
returns an Nx1 vector instead, holding for each observation the
distance to the mean of the class labels names for it.
labels must have one entry per row of X , each of them one
of ClassNames .

The distance is measured against the covariance the model reports, so
a regularized model is measured against its regularized covariance.
The prior does not enter it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Squared Mahalanobis distance to the class means.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationDiscriminant.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 842
ClassificationDiscriminant: m = margin ( obj , X , Y )

Classification margins for discriminant analysis classifier.

m = margin ( obj , X , Y ) returns
the classification margins for obj with data X and
classification Y . m is a numeric vector of length size (X,1).

obj is a ClassificationDiscriminant object trained on
X
and Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

The classification margin for each observation is the difference between
the classification score for the true class and the maximal
classification score for the false classes.

See also:
fitcdiscr,
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification margins for discriminant analysis classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationDiscriminant.nLinearCoeffs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 887
ClassificationDiscriminant: n = nLinearCoeffs ( obj )
ClassificationDiscriminant: n = nLinearCoeffs ( obj , delta )

Number of nonzero linear coefficients at a regularization threshold.

n = nLinearCoeffs ( obj ) returns the number of
predictors the discriminant keeps at its own Delta .

n = nLinearCoeffs ( obj , delta ) returns the
number it would keep at each threshold in delta , as a column
vector however delta is shaped.

A predictor survives a threshold when its DeltaPredictor reaches
it, the comparison including equality, so delta at exactly a
predictor&rsquo;s own value still counts it. A threshold above every
DeltaPredictor therefore leaves nothing and returns zero.

The count is taken whatever the DiscrimType , as MATLAB takes it,
even though Delta regularizes the linear types alone.

See also:
fitcdiscr,
ClassificationDiscriminant,
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Number of nonzero linear coefficients at a regularization threshold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationDiscriminant.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1430
ClassificationDiscriminant: label = predict ( obj , XC )
ClassificationDiscriminant: [ label , score , cost ] = predict ( obj , XC )

Classify new data points into categories using the discriminant
analysis model from a ClassificationDiscriminant object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
predictor data in obj.X and corresponding labels, obj.Y ,
stored in the ClassificationDiscriminant model, obj .

obj must be a ClassificationDiscriminant class object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the discriminant
model in obj .

[ label , score , cost ] = predict ( obj ,
XC ) also returns score , which contains the predicted class
scores or posterior probabilities for each instance of the corresponding
unique classes, and cost , which is a matrix containing the expected
cost of the classifications.

The score matrix contains the posterior probabilities for each
class, calculated using the multivariate normal probability density
function and the prior probabilities of each class. These scores are
normalized to ensure they sum to 1 for each observation.

The cost matrix contains the expected classification cost for each
class, computed based on the posterior probabilities and the specified
misclassification costs.

See also:
ClassificationDiscriminant,
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 120
Classify new data points into categories using the discriminant analysis model from a ClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationDiscriminant.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 251
ClassificationDiscriminant: e = resubEdge ( obj )

Classification edge of the model on its own training data.

e = resubEdge ( obj ) is edge applied to the
observations the model was fitted on, the mean of resubMargin
weighted by the training weights.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Classification edge of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationDiscriminant.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 621
ClassificationDiscriminant: L = resubLoss ( obj )
ClassificationDiscriminant: L = resubLoss (&hellip;, name , value )

Classification loss of the model on its own training data.

L = resubLoss ( obj ) is loss applied to the
observations the model was fitted on, defaulting to
'mincost' and to the training weights, and it accepts the same
Name-Value pairs.

Being a resubstitution quantity it is a lower bound on the error rather
than an estimate of it. It is worth least on a lazy learner: a
one-neighbour ClassificationKNN has a resubstitution loss of
exactly zero, every training point being its own nearest neighbour.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Classification loss of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationDiscriminant.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 296
ClassificationDiscriminant: m = resubMargin ( obj )

Classification margins of the model on its own training data.

m = resubMargin ( obj ) is margin applied to the
observations the model was fitted on, one number per observation. Being
a resubstitution quantity it is optimistic by construction.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margins of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationDiscriminant.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 630
ClassificationDiscriminant: label = resubPredict ( obj )
ClassificationDiscriminant: [ label , score , cost ] = resubPredict ( obj )

Classify the training data with the model fitted to it.

label = resubPredict ( obj ) is predict applied
to the observations the model was fitted on, which it holds in
X . Handing them over yourself is not the same thing: a row
dropped for a missing response is not in X , so the original
matrix and the model&rsquo;s own are different data.

The result measures fit and not generalization, and is optimistic by
construction. crossval is what estimates performance on data the
model has not seen.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Classify the training data with the model fitted to it.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationDiscriminant.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
ClassificationDiscriminant: savemodel ( obj , filename )

Save a ClassificationDiscriminant object.

savemodel ( obj , filename ) saves each property of a
ClassificationDiscriminant object into an Octave binary file, the name of
which is specified in filename , along with an extra variable, which
defines the type classification object these variables constitute. Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcdiscr,
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Save a ClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
ClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 684
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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
A multiclass model built from binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationECOC.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 160
ClassificationECOC: property BinEdges

The bin edges of the predictors, empty unless the learners binned
them, which none here does. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 93
The bin edges of the predictors, empty unless the learners binned them, which none here does.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationECOC.BinaryLearners


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
ClassificationECOC: property BinaryLearners

The trained binary learners, one per column of CodingMatrix .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
The trained binary learners, one per column of CodingMatrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationECOC.BinaryLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
ClassificationECOC: property BinaryLoss

The loss that turns a binary learner&rsquo;s score into a cost. See
CompactClassificationECOC.BinaryLoss .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
The loss that turns a binary learner's score into a cost.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationECOC.BinaryY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
ClassificationECOC: property BinaryY

What each observation was to each binary learner

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
What each observation was to each binary learner



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationECOC.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClassificationECOC: property CategoricalPredictors

The columns holding categorical predictors, empty when none is. Every
binary learner was given them. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
The columns holding categorical predictors, empty when none is.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationECOC.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 219
ClassificationECOC: property ClassNames

The distinct class labels, sorted or in the order given by the
'ClassNames' option; the rows of CodingMatrix ,
Prior and Cost take them in that order. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 149
The distinct class labels, sorted or in the order given by the 'ClassNames' option; the rows of CodingMatrix, Prior and Cost take them in that order.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationECOC.ClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 462
ClassificationECOC: obj = ClassificationECOC ( X , Y )
ClassificationECOC: obj = ClassificationECOC (&hellip;, name , value )

Fit a multiclass model from binary learners.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Fit a multiclass model from binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationECOC.CodingMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 119
ClassificationECOC: property CodingMatrix

The coding design, a KxL matrix of -1, 0 and +1. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
The coding design, a KxL matrix of -1, 0 and +1.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationECOC.CodingName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
ClassificationECOC: property CodingName

The name of the coding design, or 'custom' when the matrix was
given outright. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 78
The name of the coding design, or 'custom' when the matrix was given outright.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationECOC.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 79
ClassificationECOC: property Cost

The cost of misclassification, a KxK matrix.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
The cost of misclassification, a KxK matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationECOC.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
ClassificationECOC: property ExpandedPredictorNames

The names of the predictors as the learners saw them. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
The names of the predictors as the learners saw them.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
ClassificationECOC.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClassificationECOC: property HyperparameterOptimizationResults

The result of optimizing the hyperparameters, always empty here, no
such optimization being implemented. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 104
The result of optimizing the hyperparameters, always empty here, no such optimization being implemented.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationECOC.LearnerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
ClassificationECOC: property LearnerWeights

The total observation weight each binary learner was trained on. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
The total observation weight each binary learner was trained on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationECOC.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
ClassificationECOC: property ModelParameters

A structure of the options the model was fitted with. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
A structure of the options the model was fitted with.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationECOC.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 106
ClassificationECOC: property NumObservations

The number of observations used. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
The number of observations used.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationECOC.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 101
ClassificationECOC: property PredictorNames

The names of the predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
The names of the predictors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationECOC.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
ClassificationECOC: property Prior

The prior probability of each class.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
The prior probability of each class.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationECOC.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationECOC: property ResponseName

The name of the response variable. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
The name of the response variable.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationECOC.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
ClassificationECOC: property RowsUsed

A logical column marking the rows of the original data that were
used, the rest having been dropped as missing. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 111
A logical column marking the rows of the original data that were used, the rest having been dropped as missing.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationECOC.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 91
ClassificationECOC: property ScoreTransform

The transform applied to the predicted scores.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
The transform applied to the predicted scores.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationECOC.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 155
ClassificationECOC: property W

The observation weights, scaled so that each class carries its prior
and the whole sums to one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
The observation weights, scaled so that each class carries its prior and the whole sums to one.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationECOC.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 128
ClassificationECOC: property X

The predictor data the model was fitted on, one row per observation.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
The predictor data the model was fitted on, one row per observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationECOC.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 101
ClassificationECOC: property Y

The class labels the model was fitted on. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
The class labels the model was fitted on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationECOC.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 361
ClassificationECOC: CMdl = compact ( obj )

Drop the training data from a ClassificationECOC .

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Drop the training data from a ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationECOC.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 796
ClassificationECOC: CVMdl = crossval ( obj )
ClassificationECOC: CVMdl = crossval (&hellip;, name , value )

Cross validate a ClassificationECOC .

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

Name Value
'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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Cross validate a ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationECOC.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 602
ClassificationECOC: obj = discardSupportVectors ( obj )

Give up the support vectors of the binary learners.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Give up the support vectors of the binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationECOC.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
ClassificationECOC: e = edge ( obj , X , Y )

Classification edge of a ClassificationECOC . See
CompactClassificationECOC.edge .

See also:
CompactClassificationECOC.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Classification edge of a ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationECOC.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
ClassificationECOC: L = loss ( obj , X , Y )

Classification loss of a ClassificationECOC . See
CompactClassificationECOC.loss .

See also:
CompactClassificationECOC.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Classification loss of a ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationECOC.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
ClassificationECOC: m = margin ( obj , X , Y )

Classification margin of a ClassificationECOC . See
CompactClassificationECOC.margin .

See also:
CompactClassificationECOC.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Classification margin of a ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationECOC.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 432
ClassificationECOC: label = predict ( obj , XC )
ClassificationECOC: [ label , NegLoss , PBScore ] = predict (&hellip;)
ClassificationECOC: [&hellip;] = predict (&hellip;, name , value )

Classify new data with a trained ClassificationECOC .

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

See also:
ClassificationECOC,
CompactClassificationECOC.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Classify new data with a trained ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationECOC.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 119
ClassificationECOC: e = resubEdge ( obj )

Classification edge on the training data.

See also:
ClassificationECOC.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification edge on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationECOC.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 119
ClassificationECOC: L = resubLoss ( obj )

Classification loss on the training data.

See also:
ClassificationECOC.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationECOC.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 125
ClassificationECOC: m = resubMargin ( obj )

Classification margin on the training data.

See also:
ClassificationECOC.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Classification margin on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationECOC.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 150
ClassificationECOC: label = resubPredict ( obj )

Classify the training data with a trained ClassificationECOC .

See also:
ClassificationECOC.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classify the training data with a trained ClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationECOC.selectModels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 422
ClassificationECOC: sub = selectModels ( obj , idx )

Keep a subset of the fitted regularization strengths.

sub = selectModels ( obj , idx ) narrows every
binary learner to the strengths idx names, which may be indices
into the learner&rsquo;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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Keep a subset of the fitted regularization strengths.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 622
statistics: ClassificationEnsemble

Boosted ensemble of decision trees for classification

A ClassificationEnsemble object holds the weak learners a
boosting method grew one after another, each on the observations
reweighted by the errors of those before it, together with the data it
was fitted on. AdaBoostM1, GentleBoost and LogitBoost fit two classes,
AdaBoostM2 more than two.

Create one with fitcensemble . A bagged ensemble is a
ClassificationBaggedEnsemble , and compact returns a
CompactClassificationEnsemble without the data.

See also:
fitcensemble,
CompactClassificationEnsemble,
ClassificationBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Boosted ensemble of decision trees for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
ClassificationEnsemble: property BinEdges

Bin edges of the predictors

Always empty, binning not being implemented. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
ClassificationEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationEnsemble.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
ClassificationEnsemble: property ClassNames

Names of the classes

The classes, in the type of the response, sorted or in the order given
by the 'ClassNames' option; the columns of the scores take them
in that order. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationEnsemble.ClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 382
ClassificationEnsemble: obj = ClassificationEnsemble ( X , Y )
ClassificationEnsemble: obj = ClassificationEnsemble (&hellip;, name , value )

Fit a boosted ensemble of decision trees.

fitcensemble is the documented way in, and its help lists the
options both take. A bagged ensemble is fitted by
ClassificationBaggedEnsemble .

See also:
fitcensemble,
ClassificationBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Fit a boosted ensemble of decision trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 167
ClassificationEnsemble: property CombineWeights

How the weak learners are combined

'WeightedSum' for boosting, 'WeightedAverage' for
Bag. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
How the weak learners are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationEnsemble.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
ClassificationEnsemble: property Cost

Misclassification costs

A square matrix, Cost(i,j) being the cost of classifying an
observation of class i as class j . A boosting method
starts from observation weights multiplied by the total cost of
misclassifying each observation&rsquo;s class. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Misclassification costs



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 163
ClassificationEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationEnsemble.FitInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 446
ClassificationEnsemble: property FitInfo

Fit information

A column with one element per learner: the weighted classification error
for AdaBoostM1, the weighted pseudo-loss for AdaBoostM2 and RUSBoost, and
the weighted mean squared error of the regression tree for GentleBoost
and LogitBoost. For LPBoost and TotalBoost a matrix with a row per
learner: its margin on each observation, and its edge last. Empty for
Bag. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Fit information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationEnsemble.FitInfoDescription


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 104
ClassificationEnsemble: property FitInfoDescription

Description of FitInfo

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Description of FitInfo



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
ClassificationEnsemble.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 193
ClassificationEnsemble: property HyperparameterOptimizationResults

Results of optimizing the hyperparameters

Always empty, such optimization not being implemented. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Results of optimizing the hyperparameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationEnsemble.LearnerNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
ClassificationEnsemble: property LearnerNames

Names of the weak learners

{'Tree'} , or for Subspace {'KNN'} or
{'Discriminant'} . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Names of the weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationEnsemble.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
ClassificationEnsemble: property Method

Ensemble method

'AdaBoostM1' , 'AdaBoostM2' , 'GentleBoost' ,
'LogitBoost' , 'RUSBoost' , 'LPBoost' ,
'TotalBoost' , 'Bag' or 'Subspace' . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Ensemble method



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 284
ClassificationEnsemble: property ModelParameters

Parameters of the fit

A structure with the fields Type , Method ,
LearnerTemplates , the tree template the learners were grown
from, NLearn , the number of learning cycles asked for in all,
and LearnRate . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Parameters of the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 106
ClassificationEnsemble: property NumObservations

Number of observations used

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of observations used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationEnsemble: property NumTrained

Number of trained weak learners

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Number of trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 136
ClassificationEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationEnsemble.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
ClassificationEnsemble: property Prior

Prior probabilities of the classes

A row vector with one probability per class. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationEnsemble.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationEnsemble: property ReasonForTermination

Why the fit stopped adding learners

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Why the fit stopped adding learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationEnsemble.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
ClassificationEnsemble: property RowsUsed

Rows of the data that were used

A logical column over the rows as supplied. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Rows of the data that were used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationEnsemble.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
ClassificationEnsemble: property ScoreTransform

Transform applied to the predicted scores

See CompactClassificationEnsemble.ScoreTransform .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Transform applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
ClassificationEnsemble: property Trained

Trained weak learners

A column cell array of compact trees, as described under
CompactClassificationEnsemble.Trained . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 152
ClassificationEnsemble: property TrainedWeights

Weights of the trained weak learners

A column with one weight per learner. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Weights of the trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 261
ClassificationEnsemble: property UsePredForLearner

Which predictors each learner uses

For the 'Subspace' method, a logical matrix with one row per
predictor and one column per learner. Empty for tree learners, as
MATLAB returns it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
ClassificationEnsemble: property W

Observation weights

The weights given, scaled so that the observations of each class sum
to its prior probability. A cost matrix is not folded into them.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationEnsemble: property X

Predictor data

The predictors the ensemble was fitted on, one row per observation, a
row missing a value or a class having been left out. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
ClassificationEnsemble: property Y

Class labels

The labels the ensemble was fitted on, in the type they were given in.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationEnsemble.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 299
ClassificationEnsemble: CMdl = compact ( obj )

Drop the training data from an ensemble.

CMdl = compact ( obj ) returns a
CompactClassificationEnsemble holding the learners and what
prediction needs. It predicts new data identically.

See also:
ClassificationEnsemble,
CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Drop the training data from an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationEnsemble.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 591
ClassificationEnsemble: CVMdl = crossval ( obj )
ClassificationEnsemble: CVMdl = crossval (&hellip;, name , value )

Cross-validate an ensemble.

CVMdl = crossval ( obj ) refits the ensemble on the
training part of each of ten folds, stratified by class, and returns a
ClassificationPartitionedEnsemble . One of 'KFold' , an
integer greater than 1, 'Holdout' , a number between 0 and 1,
'Leaveout' , 'on' for one fold per observation, or
'CVPartition' , a cvpartition object, may choose the
partition instead.

See also:
ClassificationEnsemble,
ClassificationPartitionedEnsemble,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Cross-validate an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 302
ClassificationEnsemble: e = edge ( obj , X , Y )
ClassificationEnsemble: e = edge (&hellip;, name , value )

Classification edge of an ensemble.

Behaves as CompactClassificationEnsemble.edge and takes the
same Name-Value arguments.

See also:
ClassificationEnsemble,
CompactClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Classification edge of an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 302
ClassificationEnsemble: L = loss ( obj , X , Y )
ClassificationEnsemble: L = loss (&hellip;, name , value )

Classification loss of an ensemble.

Behaves as CompactClassificationEnsemble.loss and takes the
same Name-Value arguments.

See also:
ClassificationEnsemble,
CompactClassificationEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Classification loss of an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 313
ClassificationEnsemble: m = margin ( obj , X , Y )
ClassificationEnsemble: m = margin (&hellip;, name , value )

Classification margins of an ensemble.

Behaves as CompactClassificationEnsemble.margin and takes the
same Name-Value arguments.

See also:
ClassificationEnsemble,
CompactClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Classification margins of an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 387
ClassificationEnsemble: label = predict ( obj , X )
ClassificationEnsemble: [ label , scores ] = predict (&hellip;)
ClassificationEnsemble: [&hellip;] = predict (&hellip;, name , value )

Classify new data with an ensemble.

Behaves as CompactClassificationEnsemble.predict and takes the
same Name-Value arguments.

See also:
ClassificationEnsemble,
CompactClassificationEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Classify new data with an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 317
ClassificationEnsemble: imp = predictorImportance ( obj )
ClassificationEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

Behaves as CompactClassificationEnsemble.predictorImportance .

See also:
ClassificationEnsemble,
CompactClassificationEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationEnsemble.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
ClassificationEnsemble: e = resubEdge ( obj )
ClassificationEnsemble: e = resubEdge (&hellip;, name , value )

Classification edge on the training data.

edge on X and Y , weighted by W unless
'Weights' are given.

See also:
ClassificationEnsemble,
ClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification edge on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
ClassificationEnsemble: L = resubLoss ( obj )
ClassificationEnsemble: L = resubLoss (&hellip;, name , value )

Classification loss on the training data.

loss on X and Y , weighted by W unless
'Weights' are given.

See also:
ClassificationEnsemble,
ClassificationEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationEnsemble.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 283
ClassificationEnsemble: m = resubMargin ( obj )
ClassificationEnsemble: m = resubMargin (&hellip;, name , value )

Classification margins of the training data.

margin on X and Y , taking the same Name-Value
arguments.

See also:
ClassificationEnsemble,
ClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Classification margins of the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 346
ClassificationEnsemble: label = resubPredict ( obj )
ClassificationEnsemble: [ label , scores ] = resubPredict (&hellip;)
ClassificationEnsemble: [&hellip;] = resubPredict (&hellip;, name , value )

Classify the training data.

predict on X , taking the same Name-Value arguments.

See also:
ClassificationEnsemble,
ClassificationEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Classify the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 676
ClassificationEnsemble: B = resume ( obj , NumLearningCycles )
ClassificationEnsemble: B = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more weak learners.

B is the ensemble with up to NumLearningCycles further
learners grown as though the fit had asked for them from the start: the
boosting weights carry on from where it stopped. An ensemble whose fit
ended on a learner that classified the data perfectly grows no more.
'NPrint' is taken as by fitcensemble .

MATLAB R2024a restarts the mislabel weights of AdaBoostM2 on a resume,
so its learner weights then differ from those of one longer fit; here
they are the same.

See also:
ClassificationEnsemble,
fitcensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Grow more weak learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2023
statistics: ClassificationGAM

Generalized additive model classification

The ClassificationGAM class implements a gradient boosting
algorithm for classification. This approach allows the model to capture
non-linear relationships between predictors and the binary response
variable.

Generalized additive model classification is a statistical method that
extends linear models by allowing non-linear relationships between each
predictor and the response variable through smooth functions. It combines
the interpretability of linear models with the flexibility of
non-parametric methods.

Create a ClassificationGAM object by using the fitcgam
function or the class constructor.

Two weak learners are available, selected by FitMethod .

'boostedtrees' , the default, boosts one shallow decision tree per
predictor in each round, which is the scheme MATLAB&rsquo;s generalized
additive model uses. A second phase then boosts trees over pairs of
predictors, where interactions are asked for.

'splines' boosts a smoothing spline per predictor over
NumIterations passes. It has no MATLAB counterpart and is an
Octave extension, kept because a smooth additive fit is a genuinely
different and often better answer than a staircase of stumps.

The two take different arguments, and an argument meant for one is
refused by the other rather than ignored.

The choice is visible in the properties. Knots , Order ,
DoF , Formula , LearningRate , NumIterations ,
BaseModel , ModelwInt and IntMatrix describe a spline
fit and are empty under the boosted-tree engine, while
ModelParameters , ReasonForTermination , BinEdges ,
PairDetectionBinEdges and TreeModel describe a tree fit and
are empty under the spline engine.

Fitted values are not expected to equal MATLAB&rsquo;s even under
'boostedtrees' . The stopping rule and the step-reduction limit
are not recoverable from anything MATLAB reports, so this engine
documents its own; what the two share is the estimator and the reported
surface, not the arithmetic.

See also:
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Generalized additive model classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.BaseModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 288
ClassificationGAM: property BaseModel

Base model parameters

A structure containing the parameters of the base model without any
interaction terms. The base model represents the generalized additive
model with only the main effects (predictor terms) included.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Base model parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationGAM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 475
ClassificationGAM: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the model discretized it before fitting. It is empty here
and stays empty: this generalized additive model is built from splines,
which take the predictors as they are, where MATLAB&rsquo;s is built from
boosted trees and bins them. That difference is described in the class
documentation.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationGAM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 219
ClassificationGAM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector holding the column of each predictor treated as
categorical, and empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationGAM.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
ClassificationGAM: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationGAM.ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3867
statistics: obj = ClassificationGAM ( X , Y )
statistics: obj = ClassificationGAM (&hellip;, name , value )

Create a ClassificationGAM class object containing a generalized
additive classification model.

obj = ClassificationGAM ( X , Y ) returns
a ClassificationGAM object, with X as the predictor data
and Y containing the class labels of observations in X .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables. X will be used to train the GAM model.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y can contain any type
of categorical data. Y must have the same number of rows as
X .

obj = ClassificationGAM (&hellip;, name ,
value ) returns a ClassificationGAM object with parameters
specified by the following name , value paired input
arguments:

Name Value
'PredictorNames' A cell array of character
vectors specifying the names of the predictors. The length of this array
must match the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the GAM model.
ClassNames are of the same type as the class labels in Y .
The model keeps the classes in this order; by default they are sorted.
'Cost' An N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X , where
R is the number of unique categories in Y . If an instance
is correctly classified into its category the cost is calculated to be 1,
otherwise 0. The cost matrix can be altered by using
Mdl .cost = somecost . By default, its value is
cost = ones (rows (X), numel (unique (Y))) .
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
Alternatively, you can specify 'empirical' to use the empirical
class probabilities or 'uniform' to assume equal class
probabilities. The prior weighs the boosted-tree fit: each class
carries its prior, spread over its observations in proportion to
'Weights' , and an empirical prior is each class&rsquo;s share of the
weight.
'ScoreTransform' A user-defined function handle
or a character vector specifying one of the following builtin functions
specifying the transformation applied to predicted classification scores.
Supported values include 'doublelogit' , 'invlogit' ,
'ismax' , 'logit' , 'none' , 'identity' ,
'sign' , 'symmetric' , 'symmetricismax' , and
'symmetriclogit' .
'Formula' (spline option) A character vector
specifying the model
formula in the form 'Y ~ terms' where Y represents the
response variable and terms specifies the predictor variables and
interaction terms.
'Interactions' A logical matrix, a positive
integer scalar, or the string 'all' for defining the interactions
between predictor variables.
'Knots' (spline option) A scalar or row vector
specifying the
number of knots for each predictor variable in the spline fitting.
'Order' (spline option) A scalar or row vector
specifying the
order of the spline for each predictor variable.
'DoF' (spline option) A scalar or row vector
specifying the
degrees of freedom for each predictor variable in the spline fitting.
'LearningRate' (spline option) A scalar value between
0 and 1
specifying the learning rate used in the gradient boosting algorithm.
'NumIterations' (spline option) A positive integer
specifying
the maximum number of iterations for the gradient boosting algorithm.

A row marked (spline option) belongs to the spline
engine and requires 'FitMethod', 'splines' ; passing one
under the default boosted-tree engine is an error rather than
being ignored. The boosted-tree engine&rsquo;s own options are
documented under fitcgam .

See also:
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
Create a ClassificationGAM class object containing a generalized additive classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationGAM.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1196
ClassificationGAM: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

Add or change the Cost property using dot notation as in:

obj .Cost = costMatrix

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
ClassificationGAM.DoF


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 207
ClassificationGAM: property DoF

Degrees of freedom for spline fitting

A scalar or row vector specifying the degrees of freedom for each
predictor variable in the spline fitting. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Degrees of freedom for spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationGAM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 294
ClassificationGAM: property ExpandedPredictorNames

Names of the expanded predictor variables

A cell array of character vectors naming the predictors as the model
sees them. It matches PredictorNames unless a categorical
predictor was expanded into dummy variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of the expanded predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 717
ClassificationGAM: property FitMethod

Which engine fitted the model

A character vector, either 'boostedtrees' or
'splines' . The default is 'boostedtrees' , which is the
scheme MATLAB&rsquo;s generalized additive model uses and the one the
tree-shaped properties above describe.

'splines' selects the penalised-spline engine instead, which is
an Octave extension with no MATLAB counterpart. It is the scheme this
class fitted before version 1.9.0, and it is kept because a smooth
additive fit is a genuinely different and often better answer than a
staircase of stumps. The two engines take different arguments and an
argument meant for one is refused by the other rather than ignored.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Which engine fitted the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationGAM.Formula


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
ClassificationGAM: property Formula

Model specification formula

A character vector specifying the model formula in the form
'Y ~ terms' where Y represents the response variable and
terms specifies the predictor variables and interaction terms.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Model specification formula



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationGAM.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 360
ClassificationGAM: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.IntMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 557
ClassificationGAM: property IntMatrix

Every term the model fits

A logical matrix with one row per term and one column per predictor,
true wherever the term multiplies that predictor. A row naming one
predictor is a main effect, two an interaction, and three or more a
higher-order term. This property is read-only.

It is the complete record, where Interactions reports only the
two-way terms, in the form MATLAB reports them. It is also the form
the 'Interactions' option takes back, so passing it to the
constructor rebuilds a model over the same terms.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Every term the model fits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationGAM.Interactions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 598
ClassificationGAM: property Interactions

Two-way interaction terms of the fitted model

A Kx2 matrix of predictor index pairs, one row per two-way term
the model carries, and zeros (0, 2) when it carries none. It
reports what was fitted rather than what was asked for, so a count of
terms, 'all' , a logical matrix and a formula all leave the same
kind of value behind. This property is read-only.

A main effect names one predictor and a higher-order term names three
or more, and neither has a two-column form, so neither appears here.
IntMatrix remains the complete record of every term fitted.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Two-way interaction terms of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.Intercept


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
ClassificationGAM: property Intercept

Intercept of the fitted model

A numeric scalar, the log-odds of the response mean, which every
additive term is measured against. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Intercept of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationGAM.Knots


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 193
ClassificationGAM: property Knots

Knots for spline fitting

A scalar or row vector specifying the number of knots for each predictor
variable in the spline fitting. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Knots for spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationGAM.LearningRate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 207
ClassificationGAM: property LearningRate

Learning rate for gradient boosting

A scalar value between 0 and 1 specifying the learning rate used in the
gradient boosting algorithm. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Learning rate for gradient boosting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationGAM.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 818
ClassificationGAM: property ModelParameters

Parameters the model was fitted with

A structure holding the fitting parameters. Under the boosted-tree
engine it carries MATLAB&rsquo;s own fields: NumPrint ,
MaxPValue , InitialLearnRateForPredictors ,
InitialLearnRateForInteractions ,
NumTreesPerPredictor , NumTreesPerInteraction ,
MaxNumSplitsPerPredictor , MaxNumSplitsPerInteraction ,
VerbosityLevel , Interactions , Version ,
Method and Type . Interactions here is the
request as it was made, a count or 'all' , where the
Interactions property of the model is the pairs actually
selected.

Under the spline engine it describes that scheme instead, carrying
Knots , Order , DoF , Formula ,
Interactions , LearningRate and NumIterations ,
since none of the tree vocabulary applies to it.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Parameters the model was fitted with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.ModelwInt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
ClassificationGAM: property ModelwInt

Model parameters with interactions

A structure containing the parameters of the model that includes
interaction terms. This model extends the base model by adding
interaction terms between predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Model parameters with interactions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationGAM.NumIterations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 200
ClassificationGAM: property NumIterations

Maximum number of iterations

A positive integer specifying the maximum number of iterations for the
gradient boosting algorithm. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Maximum number of iterations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationGAM.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
ClassificationGAM: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the ClassificationGAM model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationGAM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
ClassificationGAM: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationGAM model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationGAM.Order


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
ClassificationGAM: property Order

Order of spline fitting

A scalar or row vector specifying the order of the spline for each
predictor variable. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Order of spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationGAM.PairDetectionBinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 487
ClassificationGAM: property PairDetectionBinEdges

Bin edges used to detect interactions

A cell array with one row vector per predictor, holding the coarse cut
points the residuals of the predictor phase were laid on while pairs
were being tested. The grid is eight equal-frequency bins whatever the
sample size, as MATLAB&rsquo;s is. It is empty when the model carries no
interaction terms, and empty throughout under the spline engine, which
does not bin.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Bin edges used to detect interactions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationGAM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
ClassificationGAM: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationGAM.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 562
ClassificationGAM: property Prior

Prior probability for each class

A 2-element numeric vector specifying the prior probabilities for each
class. The order of the elements in Prior corresponds to the
order of the classes in ClassNames . This property is read-only.

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationGAM.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 539
ClassificationGAM: property ReasonForTermination

Why each fitting phase stopped

A structure with the fields PredictorTrees and
InteractionTrees , each a character vector saying why that phase
of the fit ended: that it trained the trees it was asked for, or that
it could no longer improve the model. A phase that never ran reports
an empty character vector, which is what a model with no interaction
terms shows for the second field.

It is empty under the spline engine, which has no tree budget to
exhaust.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Why each fitting phase stopped



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationGAM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 161
ClassificationGAM: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationGAM.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
ClassificationGAM: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the ClassificationGAM model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationGAM.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1350
ClassificationGAM: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1

The default is 'logit' , as in MATLAB. This model&rsquo;s raw
score is a log-odds, reported as the pair [-f, f] whose two
columns sum to zero, and the transform is what turns it into the
posterior probabilities that sum to one. Every transform therefore
composes on the log-odds and not on the probabilities, so
'none' returns the log-odds themselves.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.TreeModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 778
ClassificationGAM: property TreeModel

The fitted shape functions and interaction surfaces

A structure holding what the boosted-tree engine fitted, with fields
ShapeValues , one column vector per predictor giving that
predictor&rsquo;s contribution in each of its bins, PairValues , one
matrix per selected pair, and Pairs , the predictor indices those
matrices belong to. A shape function is a step function, so these are
the whole of the fit however many trees produced them.

MATLAB exposes no equivalent: it reports the bin edges but never the
values on them, so its shape functions can only be reached through
predict . This property is an Octave extension, and it is empty
under the spline engine, whose fit lives in BaseModel and
ModelwInt .

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
The fitted shape functions and interaction surfaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationGAM.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
ClassificationGAM: property W

Observation weights

A numeric column vector with one entry per observation used for
training, normalised to sum to one. This property is read-only.

Each class carries its prior, spread over its own observations in
proportion to their 'Weights' , and evenly when none were given.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationGAM.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
ClassificationGAM: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationGAM.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
ClassificationGAM: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationGAM.addInteractions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1087
ClassificationGAM: obj = addInteractions ( obj , interactions )

Add interaction terms to a fitted model.

obj = addInteractions ( obj , interactions ) fits
the interaction terms named by interactions on top of the terms
the model already carries and returns the updated model. The univariate
fit is left alone, so predict with
'IncludeInteractions' set false answers exactly as it
answered before.

interactions takes the forms the constructor&rsquo;s
'Interactions' option takes: a nonnegative integer count of
terms, a logical matrix with a column per predictor, or 'all' .

A model already carrying interaction terms is not extended, which is
what MATLAB refuses too. A model fitted from a 'Formula' names
every term it has, interactions among them, and is refused for the same
reason.

Which terms a count selects is this implementation&rsquo;s own: they are
taken in the order nchoosek lists the pairs, where MATLAB ranks
them by how much each contributes. The constructor&rsquo;s option chooses
the same way, so the two agree with each other.

See also:
fitcgam,
ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Add interaction terms to a fitted model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationGAM.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
ClassificationGAM: CVMdl = compact ( obj )

Create a CompactClassificationGAM object.

CVMdl = compact ( obj ) creates a compact version of the
ClassificationGAM object, obj .

See also:
fitcgam,
ClassificationGAM,
CompactClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create a CompactClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationGAM.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1061
ClassificationGAM: CVMdl = crossval ( obj )
ClassificationGAM: CVMdl = crossval (&hellip;, name , value )

Cross Validate a Generalized Additive Model classification object.

CVMdl = crossval ( obj ) returns a cross-validated model
object, CVMdl , from a trained model, obj , using 10-fold
cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv , where
isa ( cv , "cvpartition") = 1.

See also:
fitcgam,
ClassificationGAM,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Cross Validate a Generalized Additive Model classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationGAM.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 453
ClassificationGAM: e = edge ( obj , X , Y )
ClassificationGAM: e = edge (&hellip;, "Weights" , w )

Classification edge of a generalized additive model.

e = edge ( obj , X , Y ) returns the mean of
the classification margins over the rows of X .

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .

See also:
ClassificationGAM,
ClassificationGAM.margin,
ClassificationGAM.loss,
ClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Classification edge of a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 952
ClassificationGAM: L = loss ( obj , X , Y )
ClassificationGAM: L = loss (&hellip;, name , value )

Classification loss of a generalized additive model.

L = loss ( obj , X , Y ) returns the loss of
the model on the rows of X against the true labels Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss. Supported values are
"mincost" , the default, "binodeviance" ,
"classifcost" , "classiferror" , "exponential" ,
"hinge" , "logit" and "quadratic" .
"mincost" assigns each observation to the class of least
expected cost and charges what that assignment costs, so it reads the
scores as a posterior, which is what this model returns;
"classifcost" charges what the model&rsquo;s own prediction costs.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
ClassificationGAM,
ClassificationGAM.margin,
ClassificationGAM.edge,
ClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Classification loss of a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationGAM.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 484
ClassificationGAM: m = margin ( obj , X , Y )

Classification margin of a generalized additive model.

m = margin ( obj , X , Y ) returns a column
vector holding, for each row of X , the score the model gives its
true class in Y less the score it gives the other class. A
positive margin means the observation is classified correctly, and the
larger it is the more confidently so.

See also:
ClassificationGAM,
ClassificationGAM.edge,
ClassificationGAM.loss,
ClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Classification margin of a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1391
ClassificationGAM: label = predict ( obj , XC )
ClassificationGAM: [ label , score ] = predict ( obj , XC )
ClassificationGAM: [ label , score ] = predict (&hellip;, 'IncludeInteractions' , includeInteractions )

Predict labels for new data using the Generalized Additive Model (GAM)
stored in a ClassificationGAM object.

label = predict ( obj , XC ) returns the predicted
labels for the data in XC based on the model stored in the
ClassificationGAM object, obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the predicted class scores or
posterior probabilities for each observation. Every row is predicted.
Under boosted trees a missing value adds nothing from a main effect,
and an interaction term takes the value its trees give a row missing
that predictor; under splines a row holding a missing value is scored
NaN and takes the class of largest prior.

[ label , score ] = predict ( obj , XC ,
'IncludeInteractions', includeInteractions ) allows you to specify
whether interaction terms should be included when making predictions.

obj must be a ClassificationGAM class object.

XC must be an M&times;P numeric matrix where each row is an
observation and each column corresponds to a predictor variable.

includeInteractions is a logical scalar indicating whether to
include interaction terms in the predictions.

See also:
ClassificationGAM,
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
Predict labels for new data using the Generalized Additive Model (GAM) stored in a ClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
ClassificationGAM: e = resubEdge ( obj )

Classification edge of a generalized additive model on its training
data.

See also:
ClassificationGAM,
ClassificationGAM.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Classification edge of a generalized additive model on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
ClassificationGAM: L = resubLoss ( obj )
ClassificationGAM: L = resubLoss (&hellip;, name , value )

Classification loss of a generalized additive model on its training
data.

See also:
ClassificationGAM,
ClassificationGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Classification loss of a generalized additive model on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationGAM.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
ClassificationGAM: m = resubMargin ( obj )

Classification margin of a generalized additive model on its training
data.

See also:
ClassificationGAM,
ClassificationGAM.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Classification margin of a generalized additive model on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationGAM.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 339
ClassificationGAM: label = resubPredict ( obj )
ClassificationGAM: [ label , score ] = resubPredict ( obj )

Classify the training data with the generalized additive model it was
fitted on.

label = resubPredict ( obj ) is predict applied
to the observations the model was fitted on.

See also:
ClassificationGAM,
ClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
Classify the training data with the generalized additive model it was fitted on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationGAM.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 957
ClassificationGAM: Mdl = resume ( obj , numTrees )

Resume training a generalized additive model.

Mdl = resume ( obj , numTrees ) adds
numTrees more trees to obj and returns the result. The
original model is not modified.

Training continues in the phase that ran last, which is what MATLAB
does: a model carrying interaction terms gains interaction trees and
its predictor shape functions are left alone, while a model without
them gains predictor trees. A round starts at its initial learning
rate whatever its number, so the model this returns is the model a
single fit of the combined budget would have produced.

numTrees must be a positive integer scalar. Resuming raises
where there is nothing left to gain, rather than returning the model
unchanged, and it is not available under
'FitMethod', 'splines' : a backfit that has converged to its
tolerance has no budget to extend.

See also:
ClassificationGAM,
fitcgam,
ClassificationGAM.addInteractions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Resume training a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationGAM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 472
ClassificationGAM: savemodel ( obj , filename )

Save a ClassificationGAM object.

savemodel ( obj , filename ) saves each property of a
ClassificationGAM object into an Octave binary file, the name of which is
specified in filename , along with an extra variable, which defines
the type classification object these variables constitute. Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcgam,
ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Save a ClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 707
statistics: ClassificationKNN

K-nearest neighbors classification

The ClassificationKNN class implements a K-nearest neighbor
classifier object, which can predict responses for new data using the
predict method. The implemented algorithm allows you choose a range
of different distance metrics, the number of nearest neighbors, as well as
the searching algorithm.

The K-nearest neighbors (k-NN) classifier is a simple, non-parametric
machine learning algorithm used for classification tasks. It classifies a
data point based on the majority class of its k closest neighbors in the
feature space.

Create a ClassificationKNN object by using the fitcknn
function or the class constructor.

See also:
fitcknn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
K-nearest neighbors classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKNN.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 365
ClassificationKNN: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKNN.BreakTies


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 949
ClassificationKNN: property BreakTies

Tie-breaking algorithm

A character vector specifying the tie-breaking algorithm used by the
predict method, when multiple classes have the same smallest cost.
It can be one of the following:

'smallest' (default), which favors the class with the
smallest index among the tied groups, i.e. the one that appears first in
the training labelled data.
'nearest' , which favors the class with the nearest neighbor
among the tied groups, i.e. the class with the closest member point
according to the distance metric used.
'random' , which randomly picks one class among the tied
groups.

The tie-breaking algorithm is only used when IncludeTies is
false . Change the BreakTies property using dot notation
as in:

obj .BreakTies = algorithm

This property may be assigned after fitting. It decides the label
when two classes hold the same weight among the neighbours, and it
applies whether or not IncludeTies is set.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Tie-breaking algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationKNN.BucketSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 326
ClassificationKNN: property BucketSize

Maximum data points in each node

A positive integer scalar specifying the maximum number of data points in
the leaf node of the Kd-tree. BucketSize only applies when the
NSMethod property is 'kdtree' .

Change the BucketSize property using dot notation as in:

obj .BucketSize = maxnum


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Maximum data points in each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKNN.CacheSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 663
ClassificationKNN: property CacheSize

Size of the Gram matrix cache

A positive scalar giving the cache size in megabytes, 1000 by default.
Change the CacheSize property using dot notation as in:

obj .CacheSize = newCacheSize

This property is stored and reported for compatibility and
does not affect the fit or any prediction . A nearest-neighbour
model keeps no Gram matrix to cache: it holds the training data and
computes each distance when asked. Assigning it changes nothing but
the value read back.

MATLAB carries the same property and hides it from properties ,
where this package reports it, so that a value a user may set is a
value a user can find.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Size of the Gram matrix cache



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationKNN.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
ClassificationKNN: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationKNN.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
ClassificationKNN: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationKNN.ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5502
statistics: obj = ClassificationKNN ( X , Y )
statistics: obj = ClassificationKNN (&hellip;, name , value )

Create a ClassificationKNN class object containing a k-Nearest
Neighbor classification model.

obj = ClassificationKNN ( X , Y ) returns a
ClassificationKNN object, with X as the predictor data and Y
containing the class labels of observations in X .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables. X will be used to train the kNN model.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y can contain any type
of categorical data. Y must have same numbers of Rows as X .

obj = ClassificationKNN (&hellip;, name , value )
returns a ClassificationKNN object with parameters specified by the
following name , value paired input arguments:

Name Value
'PredictorNames' A cell array of character
vectors specifying the names of the predictors. The length of this array
must match the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the GAM model.
ClassNames are of the same type as the class labels in Y .
'Cost' An N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X , where
R is the number of unique categories in Y . If an instance
is correctly classified into its category the cost is calculated to be 1,
otherwise 0. The cost matrix can be altered by using
Mdl .cost = somecost . By default, its value is
cost = ones (rows (X), numel (unique (Y))) .
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
Alternatively, you can specify 'empirical' to use the empirical
class probabilities or 'uniform' to assume equal class
probabilities.
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . Each class carries its prior, spread
over its observations in proportion to their weights, and a neighbour
votes with that weight. An empirical prior sums the weights per class,
standardization uses weighted means and standard deviations, and a row
of zero weight is left out.
'ScoreTransform' A user-defined function handle
or a character vector specifying one of the following builtin functions
specifying the transformation applied to predicted classification scores.
Supported values include 'doublelogit' , 'invlogit' ,
'ismax' , 'logit' , 'none' , 'identity' ,
'sign' , 'symmetric' , 'symmetricismax' , and
'symmetriclogit' .
'BreakTies' A character vector specifying the
tie-breaking algorithm used by predict method, when multiple
classes have the same smallest cost. Available options are
'smallest' (default), which uses the smallest index among tied
groups, 'nearest' , which uses the class with the nearest neighbor
among tied groups, and 'random' , which randomly selects one of
the tied groups.
'NumNeighbors' A positive integer value that
specifies the number of nearest neighbors to be found in the kNN search
algorithm for classifying each point during prediction. By default,
it is 1.
'Distance' Any valid distance metric supported by
the pdist2 function. Note that the allowable distance metrics
depend on the selected nearest neighbor search method.
'DistanceWeight' Either a distance weighting
function, specified either as a function handle, which accepts a matrix
of nonnegative distances and returns a matrix the same size containing
nonnegative distance weights, or a character vector with one of the
following values: 'equal' , which corresponds to no weighting;
'inverse' , which corresponds to a weight equal to
1/distance ; 'squaredinverse' , which corresponds to a
weight equal to 1/distance^2 .
'Cov' A square matrix with the same number of
columns X specifying the covariance matrix for computing the
mahalanobis distance. This must be a positive definite matrix matching.
This argument is only valid when the selected distance metric is
'mahalanobis' .
'Exponent' A positive scalar (usually an integer)
specifying the Minkowski distance exponent. This argument is only valid
when the selected distance metric is 'minkowski' . By default,
it is 2.
'Scale' A nonnegative numeric vector specifying
the scale parameters for the standardized Euclidean distance. The vector
length must be equal to the number of columns in X . This argument
is only valid when the selected distance metric is 'seuclidean' ,
in which case each coordinate of X is scaled by the corresponding
element of 'scale' , as is each query point in Y . By
default, the scale parameter is the standard deviation of each coordinate
in X . If a variable in X is constant, i.e. zero variance,
this value is forced to 1 to avoid division by zero. This is the
equivalent of this variable not being standardized.
'NSMethod' A character vector specifying the
nearest neighbor search method used by knnsearch , which can be
'kdtree' or 'exhaustive' . See knnsearch for more
information about default values and allowable distance metrics for each
search method.
'BucketSize' A positive integer value specifying
the maximum number of data points in the leaf node of the Kd-tree. This
argument is meaningful only when the selected nearest neighbor search
method is 'kdtree' . By default, it is 50.

See also:
fitcknn,
knnsearch,
rangesearch,
pdist2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 93
Create a ClassificationKNN class object containing a k-Nearest Neighbor classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationKNN.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1186
ClassificationKNN: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

Add or change the Cost property using dot notation as in:

obj .Cost = costMatrix

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes are in. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationKNN.DistParameter


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1265
ClassificationKNN: property DistParameter

Parameter for distance metric

A positive definite covariance matrix, a positive scalar, or a vector of
positive scale values specifying the parameter for the corresponding
distance metric as shown below:

'mahalanobis' accepts a positive definite covariance
matrix.
'minkowski' accepts a positive scalar as the Minkowski
distance exponent.
'seuclidean' accepts a vector of positive scale values of
equal length as the number of predictors in X .

For any other distance metric, DistParameter is empty
([]) . Change the DistParameter property using dot
notation as in:

obj .DistParameter = distParam

This property may be assigned after fitting, but only under the three
metrics that carry one: 'minkowski' , 'seuclidean' and
'mahalanobis' . Under any other metric there is nothing for it
to mean and the assignment is refused.

Deviation from MATLAB. A 'seuclidean' scale of zeros
is refused here. MATLAB accepts it, then warns from inside its distance
routine at predict time and answers anyway, which contradicts its own
message that the scale must hold positive values. A zero scale divides
that predictor by nothing, so it is rejected where it is given rather
than surfacing later as a warning attached to an answer.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Parameter for distance metric



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKNN.Distance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1069
ClassificationKNN: property Distance

Distance metric

A character vector specifying the distance metric used by the
neighbor-searcher method, or a function handle to a custom distance
function. See the available distance metrics in knnsearch for
more info. A custom distance function must have the form
D2 = distfun ( ZI , ZJ ) , where
ZI is a 1&times;N vector containing one row of the predictor
data, ZJ is an M2&times;N matrix containing multiple rows of the
predictor data, and D2 is an M2&times;1 vector of distances
whose k -th element is the distance between the observations
ZI and ZJ ( k ,:) . A custom distance function
carries no DistParameter . Change the Distance
property using dot notation as in:

obj .Distance = newDistance

This property may be assigned after fitting. NSMethod is
read-only and constrains it: a 'kdtree' model takes
'euclidean' , 'cityblock' , 'chebychev' and
'minkowski' only, and never a function handle. Assigning a
different metric recomputes DistParameter , since a parameter
belonging to one metric means nothing under another.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Distance metric



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationKNN.DistanceWeight


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 725
ClassificationKNN: property DistanceWeight

Distance weighting function

A character vector or a function handle specifying the distance weighting
function, which can be any of the following values:

'equal' , which corresponds to @(d) d .
'inverse' , which corresponds to @(d) 1/d .
'squaredinverse' , which corresponds to @(d) 1/d.^2 .
@fcn , which is a function handle that accepts a matrix of
nonnegative distances, and returns a matrix the same size containing
nonnegative distance weights.

Change the DistanceWeight property
using dot notation as in:

obj .DistanceWeight = newDistanceWeight

A character vector naming the weight, or the func2str form of a
supplied handle. This property may be assigned after fitting.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Distance weighting function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationKNN.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 262
ClassificationKNN: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationKNN.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 360
ClassificationKNN: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationKNN.IncludeTies


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 448
ClassificationKNN: property IncludeTies

Flag for handling ties

A logical scalar specifying whether prediction includes all the neighbors
whose distance values are equal to the k^th smallest distance. If
IncludeTies is true , prediction includes all of these
neighbors. Otherwise, prediction uses exactly k neighbors.

Change the IncludeTies property using dot notation as in:

obj .IncludeTies = flag

This property may be assigned after fitting.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Flag for handling ties



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationKNN.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 800
ClassificationKNN: property ModelParameters

Fitting options, as they were given

A structure holding the parameters of the fit: NumNeighbors ,
NSMethod , Distance , BucketSize ,
IncludeTies , DistanceWeight , BreakTies ,
Exponent , Cov , Scale , StandardizeData ,
and the Version , Method and Type tags.

Each of the three distance parameters belongs to one metric and is
empty under the others: Exponent to 'minkowski' ,
Cov to 'mahalanobis' and Scale to
'seuclidean' . Cov and Scale hold what was
passed and stay empty otherwise, while Exponent carries its
default of 2 for a 'minkowski' fit that did not name one.
What the fit used in every case is the DistParameter property.
BucketSize is likewise empty unless the search is
'kdtree' , the only method that reads it. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationKNN.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 436
ClassificationKNN: property Mu

Predictor means

A numeric vector of the same length as the columns in X with the
mean values corresponding to each predictor. If the predictor variables
have not been standardized, then 'obj.Mu' is empty. This
property is read-only.

Each predictor is summarized from every observation where that
predictor is present, so a row holding a missing value in another
predictor still contributes to this one.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKNN.NSMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 406
ClassificationKNN: property NSMethod

Nearest neighbor search method

A character vector specified as either 'kdtree' , which creates
and uses a Kd-tree to find nearest neighbors, or 'exhaustive' ,
which uses the exhaustive search algorithm by computing the distance
values from all points in X to find nearest neighbors.

Change the NSMethod property using dot notation as in:

obj .NSMethod = newNSMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Nearest neighbor search method



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationKNN.NumNeighbors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 401
ClassificationKNN: property NumNeighbors

Number of nearest neighbors

A positive integer value specifyingNumber of nearest neighbors in X
used to classify each point during prediction. Change the
NumNeighbors property using dot notation as in:

obj .NumNeighbors = newNumNeighbors

This property may be assigned after fitting. A value larger than
NumObservations is reduced to it rather than refused.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of nearest neighbors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationKNN.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
ClassificationKNN: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the ClassificationKNN model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationKNN.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
ClassificationKNN: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationKNN model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationKNN.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
ClassificationKNN: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationKNN.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 610
ClassificationKNN: property Prior

Prior probability for each class

A numeric vector specifying the prior probabilities for each class. The
order of the elements in Prior corresponds to the order of the
classes in ClassNames .

Add or change the Prior property using dot notation as in:

obj .Prior = priorVector

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationKNN.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 161
ClassificationKNN: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKNN.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
ClassificationKNN: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the ClassificationKNN model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationKNN.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 997
ClassificationKNN: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationKNN.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 464
ClassificationKNN: property Sigma

Predictor standard deviations

A numeric vector of the same length as the columns in X with the
standard deviations corresponding to each predictor. If the predictor
variables have not been standardized, then 'obj.Sigma' is empty.
This property is read-only.

Each predictor is summarized from every observation where that
predictor is present, so a row holding a missing value in another
predictor still contributes to this one.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationKNN.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 312
ClassificationKNN: property W

Observation weights

A numeric column vector with one entry per observation used for fitting.
Each class carries its prior, spread over its own observations in
proportion to the 'Weights' given, or evenly when none were.
Reassigning Prior re-derives it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationKNN.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
ClassificationKNN: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationKNN.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
ClassificationKNN: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKNN.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1037
ClassificationKNN: CVMdl = crossval ( obj )
ClassificationKNN: CVMdl = crossval (&hellip;, Name , Value )

Cross Validate a ClassificationKNN object.

CVMdl = crossval ( obj ) returns a cross-validated model
object, CVMdl , from a trained model, obj , using 10-fold
cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv , where
isa ( cv , "cvpartition") = 1.

See also:
fitcknn,
ClassificationKNN,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Cross Validate a ClassificationKNN object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationKNN.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 599
ClassificationKNN: e = edge ( obj , X , Y )
ClassificationKNN: e = edge (&hellip;, "Weights" , w )

Classification edge, the mean of the classification margins.

e = edge ( obj , X , Y ) reduces the vector
that margin returns to a single number, the mean margin over the
rows of X . It says how far the model puts the true class ahead of
its nearest rival on average, so a larger edge is a better model, and
unlike a loss it is not bounded above and rewards confidence rather than
bare correctness.

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge, the mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationKNN.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1894
ClassificationKNN: L = loss ( obj , X , Y )
ClassificationKNN: L = loss (&hellip;, name , value )

Compute loss for a trained ClassificationKNN object.

L = loss ( obj , X , Y ) computes the loss,
L , using the default loss function 'mincost' .

obj is a ClassificationKNN object trained on X and
Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

L = loss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
fitcknn,
ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Compute loss for a trained ClassificationKNN object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationKNN.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 751
ClassificationKNN: m = margin ( obj , X , Y )

m = margin ( obj , X , Y ) returns
the classification margins for obj with data X and
classification Y . m is a numeric vector of length size (X,1).

obj is a ClassificationKNN object trained on X
and Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

The classification margin for each observation is the difference between
the classification score for the true class and the maximal
classification score for the false classes.

See also:
fitcknn,
ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 99
m = margin (obj, X, Y) returns the classification margins for obj with data X and classification Y.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationKNN.partialDependence


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1730
ClassificationKNN: [pd, x, y] = partialDependence ( obj , Vars , Labels )
ClassificationKNN: [pd, x, y] = partialDependence (&hellip;, Data )
ClassificationKNN: [pd, x, y] = partialDependence (&hellip;, name , value )

Compute partial dependence for a trained ClassificationKNN object.

[pd, x, y] = partialDependence ( obj , Vars ,
Labels )
computes the partial dependence of the classification scores on the
variables Vars for the specified class Labels .

obj is a trained ClassificationKNN object.

Vars is a vector of positive integers, character vector,
string array, or cell array of character
vectors representing predictor variables (it can be indices of
predictor variables in obj.X ).

Labels is a character vector, logical vector, numeric vector,
or cell array of character vectors representing class
labels. (column vector)

[pd, x, y] = partialDependence (&hellip;, Data )
specifies new predictor data to use for computing the partial dependence.

[pd, x, y] = partialDependence (&hellip;, name ,
value ) allows additional options specified by name-value pairs:

Name Value
'NumObservationsToSample' Number of
observations to sample. Must be a positive integer. Defaults to the
number of observations in the training data.
'QueryPoints' Points at which to evaluate
the partial dependence.
Must be a numeric column vector, numeric two-column matrix, or
cell array of character column vectors.
'UseParallel' Logical value indicating
whether to perform computations in parallel.
Defaults to false .

Return Values

pd : Partial dependence values.
x : Query points for the first predictor variable in Vars.
y : Query points for the second predictor variable in
Vars (if applicable).

See also:
fitcknn,
ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Compute partial dependence for a trained ClassificationKNN object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationKNN.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1290
ClassificationKNN: labels = predict ( obj , XC )
ClassificationKNN: [ labels , scores , cost ] = predict ( obj , XC )

Classify new data points into categories using the kNN algorithm from a
k-Nearest Neighbor classification model.

labels = predict ( obj , XC ) returns the matrix of
labels predicted for the corresponding instances in XC , using the
predictor data in obj.X and corresponding labels, obj.Y ,
stored in the k-Nearest Neighbor classification model, obj .

obj must be a ClassificationKNN class object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the SVM model in
obj .

[ labels , scores , cost ] = predict ( obj ,
XC ) also returns scores , which contains the predicted class
scores or posterior probabilities for each instance of the corresponding
unique classes, and cost , which is a matrix containing the expected
cost of the classifications. By default, scores returns the
posterior probabilities for KNN models, unless a specific ScoreTransform
function has been specified. See fitcknn for more info.

Note! predict is explicitly using 'exhaustive' as the
nearest search method due to the very slow implementation of
'kdtree' in the knnsearch function.

See also:
fitcknn,
ClassificationKNN,
knnsearch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
Classify new data points into categories using the kNN algorithm from a k-Nearest Neighbor classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKNN.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 210
ClassificationKNN: e = resubEdge ( obj )

Classification edge of the model on its own training data.

e = resubEdge ( obj ) is edge applied to the
observations the model was fitted on, the mean of resubMargin .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Classification edge of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKNN.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 576
ClassificationKNN: L = resubLoss ( obj )
ClassificationKNN: L = resubLoss (&hellip;, name , value )

Classification loss of the model on its own training data.

L = resubLoss ( obj ) is loss applied to the
observations the model was fitted on, defaulting to
'mincost' , and it accepts the same Name-Value pairs.

Being a resubstitution quantity it is a lower bound on the error rather
than an estimate of it. It is worth least on a lazy learner: a
one-neighbour ClassificationKNN has a resubstitution loss of
exactly zero, every training point being its own nearest neighbour.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Classification loss of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationKNN.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
ClassificationKNN: m = resubMargin ( obj )

Classification margins of the model on its own training data.

m = resubMargin ( obj ) is margin applied to the
observations the model was fitted on, one number per observation. Being
a resubstitution quantity it is optimistic by construction.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margins of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationKNN.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 612
ClassificationKNN: label = resubPredict ( obj )
ClassificationKNN: [ label , score , cost ] = resubPredict ( obj )

Classify the training data with the model fitted to it.

label = resubPredict ( obj ) is predict applied
to the observations the model was fitted on, which it holds in
X . Handing them over yourself is not the same thing: a row
dropped for a missing response is not in X , so the original
matrix and the model&rsquo;s own are different data.

The result measures fit and not generalization, and is optimistic by
construction. crossval is what estimates performance on data the
model has not seen.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Classify the training data with the model fitted to it.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKNN.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 472
ClassificationKNN: savemodel ( obj , filename )

Save a ClassificationKNN object.

savemodel ( obj , filename ) saves each property of a
ClassificationKNN object into an Octave binary file, the name of which is
specified in filename , along with an extra variable, which defines
the type classification object these variables constitute. Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcknn,
ClassificationKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Save a ClassificationKNN object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1308
statistics: ClassificationKernel

Gaussian kernel binary classifier for large data.

A ClassificationKernel object maps the predictors into a
randomized feature space whose inner product approximates a Gaussian
kernel, and then fits a linear model there. A kernel classifier is
therefore as nonlinear as a support vector machine with a Gaussian kernel,
while costing what a linear fit costs: nothing of size NxN is ever
formed.

The expansion is the random Fourier basis of Rahimi and Recht, drawn once
when the model is fitted and kept with it, so predict maps new data
through the same basis. MATLAB approximates the same kernel by the
Fastfood construction, which reaches the same distribution more cheaply;
the two are interchangeable in distribution but not draw by draw, and the
draws come from different generators in any case, so the scores of a model
fitted here and one fitted in MATLAB differ even from the same seed.
What does not differ is what they estimate.

Like ClassificationLinear the object holds no copy of the training
data. It does hold the basis and the coefficients, so it is bounded by
the number of expansion dimensions rather than by the number of
observations.

Create a ClassificationKernel object with fitckernel .

See also:
fitckernel,
ClassificationLinear,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Gaussian kernel binary classifier for large data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationKernel.BoxConstraint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 310
ClassificationKernel: property BoxConstraint

Box constraint of the support vector machine

A positive scalar. It is the reciprocal of the product of
Lambda and the number of observations, so setting either of
the two in the constructor fixes the other, and giving both is an
error. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Box constraint of the support vector machine



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationKernel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 191
ClassificationKernel: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationKernel.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
ClassificationKernel: property ClassNames

Names of the two classes

A column of the same type as the response supplied to the constructor,
sorted or in the order given by the 'ClassNames' option. The
second of the two is the positive class, the one a positive score
belongs to. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Names of the two classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationKernel.ClassificationKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2565
ClassificationKernel: obj = ClassificationKernel ( X , Y )
ClassificationKernel: obj = ClassificationKernel (&hellip;, name , value )

Fit a Gaussian kernel binary classifier.

obj = ClassificationKernel ( X , Y ) fits a
support vector machine in a randomized Gaussian kernel space to the
NxP predictor matrix X and the Nx1 response
Y , which must name exactly two classes.

obj = ClassificationKernel (&hellip;, name ,
value ) takes the following Name-Value pairs.

Name Value
'Learner' 'svm' , the default, or
'logistic' .
'NumExpansionDimensions' 'auto' , the
default, or a positive integer.
'KernelScale' 1 by default, a positive
scalar, or 'auto' , which takes the median distance between the
observations.
'Lambda' 'auto' , the default, which is the
reciprocal of the number of observations, or a nonnegative scalar. It
cannot be given beside 'BoxConstraint' .
'BoxConstraint' A positive scalar, 1 by
default. It applies to a support vector machine alone.
'Standardize' Whether to centre and scale the
predictors, false by default.
'BetaTolerance' Relative tolerance on the
coefficients, 1e-4 by default.
'GradientTolerance' Absolute tolerance on the
gradient&rsquo;s infinity norm, 1e-6 by default.
'IterationLimit' Largest number of iterations,
1000 by default.
'HessianHistorySize' Number of curvature pairs the
solver keeps, 15 by default.
'BlockSize' Memory the expansion may occupy, in
megabytes, 4e3 by default.
'ClassNames' The classes to keep, given in the type
of Y , in the order the model keeps them; by default they are
sorted.
'Cost' A square misclassification cost matrix.
'Prior' 'empirical' , the default,
'uniform' , a vector of probabilities, or a structure with
ClassNames and ClassProbs fields.
'ScoreTransform' A transformation applied to the
scores, named or given as a function handle.
'Weights' One nonnegative weight per observation.
'PredictorNames' One name per predictor.
'ResponseName' A name for the response.
'CategoricalPredictors' The categorical predictors,
as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros
and ones per distinct value it takes in the training data, named as in
'x1 == 2' , and the coded columns are not standardized. A row
holding a value the training data did not is scored NaN and
labelled with the class of largest prior, as a row missing a predictor
is.

The fit is always by limited-memory BFGS, the only solver MATLAB
offers a kernel model, and always under a ridge penalty.

See also:
fitckernel,
ClassificationLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Fit a Gaussian kernel binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationKernel.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 596
ClassificationKernel: property Cost

Cost of misclassifying an observation

A square numeric matrix with one row and one column per class, whose
(i,j) element is the cost of classifying an observation of
class i into class j . It defaults to one everywhere
except the diagonal, which is zero. This property is read-only, as it
is in MATLAB; a cost matrix is given to the constructor instead.

The costs are folded into the prior before the observations are
weighted, so a class that is costlier to misclassify weighs more in
the fit. They are read again by the 'mincost' and
'classifcost' losses.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Cost of misclassifying an observation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationKernel.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 325
ClassificationKernel: property ExpandedPredictorNames

Names of the predictors as the fit saw them

A cell array of character vectors. It equals PredictorNames
unless categorical predictors were dummy coded, each then named once
per level, as in 'x1 == 2' . The expansion dimensions have no
names. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Names of the predictors as the fit saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationKernel.FittedLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
ClassificationKernel: property FittedLoss

Loss function the fit minimized

'hinge' for a support vector machine and 'logit' for a
logistic regression. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Loss function the fit minimized



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationKernel.KernelScale


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
ClassificationKernel: property KernelScale

Scale of the Gaussian kernel

A positive scalar dividing every predictor before the expansion, so a
larger scale makes the kernel wider and the classifier smoother. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Scale of the Gaussian kernel



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKernel.Lambda


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 192
ClassificationKernel: property Lambda

Regularization strength

A nonnegative scalar, the reciprocal of the product of
BoxConstraint and the number of observations. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Regularization strength



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationKernel.Learner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationKernel: property Learner

Linear model fitted in the expanded space

Either 'svm' or 'logistic' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Linear model fitted in the expanded space



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationKernel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 237
ClassificationKernel: property ModelParameters

Fitting options, as they were given

A structure holding every parameter of the fit, with the
'auto' values as they were given rather than as they were
resolved. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationKernel.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationKernel: property Mu

Predictor means used to standardize

A row vector with one element per predictor, or empty when the model
was fitted without standardizing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Predictor means used to standardize



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationKernel.NumExpansionDimensions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 345
ClassificationKernel: property NumExpansionDimensions

Number of dimensions of the expanded space

A positive integer scalar. It defaults to
2 .^ ceil (min (log2 ( p ) + 5, 15)) for p
predictors, so four predictors give 128 dimensions. More dimensions
approximate the kernel more closely and cost proportionally more.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Number of dimensions of the expanded space



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationKernel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
ClassificationKernel: property PredictorNames

Names of the predictors

A cell array of character vectors with one name per column of the
training data, defaulting to 'x1' , 'x2' and so on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKernel.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 253
ClassificationKernel: property Prior

Prior probability of each class

A numeric row vector with one element per class, in the order of
ClassNames and summing to one. It defaults to the class
frequencies of the training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationKernel.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
ClassificationKernel: property Regularization

Penalty on the coefficients

Always 'ridge (L2)' : a kernel model fits in the expanded
space, where a lasso penalty has nothing to select. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Penalty on the coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationKernel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
ClassificationKernel: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationKernel.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 314
ClassificationKernel: property ScoreTransform

Transformation applied to the predicted scores

A character vector naming a transformation, or the text of the
function handle that was supplied. Assigning to it accepts either.
It defaults to 'logit' for a logistic learner and to
'none' for a support vector machine.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Transformation applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationKernel.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 219
ClassificationKernel: property Sigma

Predictor standard deviations used to standardize

A row vector with one element per predictor, or empty when the model
was fitted without standardizing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Predictor standard deviations used to standardize



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationKernel.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 249
ClassificationKernel: e = edge ( obj , X , Y )
ClassificationKernel: e = edge (&hellip;, 'Weights' , W )

Weighted mean of the classification margins.

The weights are normalized within each class to that class&rsquo;s prior
before they are applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Weighted mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationKernel.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 390
ClassificationKernel: l = loss ( obj , X , Y )
ClassificationKernel: l = loss (&hellip;, name , value )

Classification loss on new data.

l = loss ( obj , X , Y ) returns the
misclassification rate.

l = loss (&hellip;, name , value ) takes
'LossFun' , one of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' and
'quadratic' , and 'Weights' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKernel.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
ClassificationKernel: m = margin ( obj , X , Y )

Classification margin of each observation.

m = margin ( obj , X , Y ) returns the
score of the true class less the score of the other one. A positive
margin is a correct classification.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification margin of each observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationKernel.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 424
ClassificationKernel: labels = predict ( obj , XC )
ClassificationKernel: [ labels , scores ] = predict ( obj , XC )

Classify new observations.

labels = predict ( obj , XC ) maps each row of
XC through the model&rsquo;s own random basis and returns the class of
largest score.

[ labels , scores ] = predict ( obj , XC )
also returns the Nx2 scores, whose columns follow
ClassNames , after ScoreTransform has been applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Classify new observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationKernel.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 877
ClassificationKernel: obj = resume ( obj , X , Y )
ClassificationKernel: obj = resume (&hellip;, name , value )

Continue fitting a kernel classifier.

obj = resume ( obj , X , Y ) restarts the
optimization from the coefficients the model already carries, through
the basis it already holds, and returns the model it reaches. It
takes 'BetaTolerance' , 'GradientTolerance' and
'IterationLimit' , each defaulting to what the model was
fitted with, and 'Weights' .

X and Y must be the data the model was fitted to; the
object keeps no copy of them, which is what makes it small. Neither
does it keep the observation weights, so a model fitted with
'Weights' must be given them again here or it will resume
against uniform ones. MATLAB behaves the same way: measured on
R2024a, resuming a weighted fit without passing the weights back
reaches the objective of the unweighted fit.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Continue fitting a kernel classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationKernel.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
ClassificationKernel: savemodel ( obj , filename )

Save a kernel classifier to a file.

savemodel ( obj , filename ) saves the model
obj into filename in a form loadmodel can read
back, the random basis included.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Save a kernel classifier to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1087
statistics: ClassificationLinear

Linear binary classifier for high dimensional data.

A ClassificationLinear object fits a linear model,
X * Beta + Bias , to a two class problem by minimizing a
regularized average loss. The loss is the hinge loss for a support vector
machine and the deviance for a logistic regression, and the penalty is
either a ridge or a lasso one.

Unlike the other classifiers of this package the object holds no copy of
the training data: the coefficients, the intercept and the fitting options
are the whole model. That is what makes it suited to data with more
predictors than an in memory kernel matrix could carry, and it is why the
class has no compact method and no resubstitution methods.

A vector of regularization strengths fits one model per value in a single
object. Beta is then a PxL matrix and Bias a
1xL row, every method returns one column per strength, and
selectModels narrows the object down to the strengths worth
keeping.

Create a ClassificationLinear object with fitclinear .

See also:
fitclinear,
ClassificationKernel,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Linear binary classifier for high dimensional data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationLinear.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClassificationLinear: property Beta

Fitted linear coefficients

A Px1 column, or a PxL matrix with one column per
regularization strength when Lambda holds more than one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Fitted linear coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationLinear.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
ClassificationLinear: property Bias

Fitted intercept

A scalar, or a 1xL row with one element per regularization
strength. It is zero throughout when the model was fitted with
'FitBias' set to false. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Fitted intercept



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationLinear.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 191
ClassificationLinear: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationLinear.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 399
ClassificationLinear: property ClassNames

Names of the two classes

A column of the same type as the response supplied to the constructor:
a cell array of character vectors, a numeric vector, a logical vector
or a character matrix, sorted or in the order given by the
'ClassNames' option. The second of the two is the positive
class, the one a positive score belongs to. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Names of the two classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationLinear.ClassificationLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4063
ClassificationLinear: obj = ClassificationLinear ( X , Y )
ClassificationLinear: obj = ClassificationLinear (&hellip;, name , value )

Fit a linear binary classifier.

obj = ClassificationLinear ( X , Y ) fits a
linear support vector machine to the NxP predictor matrix
X and the Nx1 response Y , which must name exactly
two classes.

obj = ClassificationLinear (&hellip;, name ,
value ) takes the following Name-Value pairs.

Name Value
'Learner' 'svm' , the default, or
'logistic' . The first minimizes the hinge loss and the second
the deviance.
'Regularization' 'ridge' or
'lasso' . It defaults to 'lasso' when the solver is
'sparsa' and to 'ridge' otherwise.
'Lambda' 'auto' , the default, which is the
reciprocal of the number of observations, or a nonnegative scalar, or
a vector of them. A vector fits one model per value.
'Solver' One of 'sgd' , 'asgd' ,
'dual' , 'bfgs' , 'lbfgs' and 'sparsa' ,
or a cell array of them applied in turn, each warm starting the next.
The default depends on the data and the penalty, as described below.
'Beta' Initial coefficients, a Px1 column or
a PxL matrix. It defaults to zeros.
'Bias' Initial intercept, a scalar or a 1xL
row. It defaults to the weighted average of the class labels for a
logistic learner and to zero for a support vector machine.
'FitBias' Whether to fit an intercept at all, true
by default.
'PostFitBias' Whether to refit the intercept once
the coefficients are settled, false by default.
'ObservationsIn' 'rows' , the default, or
'columns' , which transposes X before fitting.
'BetaTolerance' Relative tolerance on the
coefficients, 1e-4 by default.
'GradientTolerance' Absolute tolerance on the
gradient&rsquo;s infinity norm, 1e-6 by default.
'DeltaGradientTolerance' Tolerance on the
complementarity gap of the 'dual' solver, 1 by
default for a hinge loss. MathWorks documents 0.1 , which is
the default of the regression counterpart; R2024a and R2026a
both report 1 here.
'IterationLimit' Largest number of iterations,
1000 by default.
'PassLimit' Largest number of passes over the data
for the stochastic solvers, 1 by default, and 10 for
'dual' .
'BatchSize' Mini-batch size of the stochastic
solvers, 10 by default.
'BatchLimit' Largest number of mini-batches.
'LearnRate' Step size of the stochastic solvers.
'OptimizeLearnRate' Whether to halve the step size
when the objective rises, true by default.
'TruncationPeriod' Number of mini-batches between
soft thresholdings under a lasso penalty, 10 by default.
'NumCheckConvergence' Number of passes between
convergence checks of the 'dual' solver, 2 by
default. MathWorks documents 5 ; R2024a and R2026a both
report 2 , so the documentation is stale rather than the
releases being inconsistent.
'HessianHistorySize' Number of curvature pairs the
quasi-Newton solvers keep, 15 by default.
'ClassNames' The classes to keep, given in the type
of Y . Observations of any other class are dropped. The model
keeps the classes in this order; by default they are sorted.
'Cost' A square misclassification cost matrix.
'Prior' 'empirical' , the default,
'uniform' , a vector of probabilities, or a structure with
ClassNames and ClassProbs fields.
'ScoreTransform' A transformation applied to the
scores, named or given as a function handle.
'Weights' One nonnegative weight per observation.
'PredictorNames' One name per predictor.
'ResponseName' A name for the response.
'CategoricalPredictors' The categorical predictors,
as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros
and ones per distinct value it takes in the training data, named as in
'x1 == 2' . A row holding a value the training data did not
is scored NaN and labelled with the class of largest prior, as
a row missing a predictor is.

The default solver is 'sparsa' under a lasso penalty. Under a
ridge penalty it is 'bfgs' when there are no more than 100
predictors, and beyond that 'dual' for a support vector
machine and 'sgd' for a logistic regression.

See also:
fitclinear,
ClassificationKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Fit a linear binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationLinear.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 634
ClassificationLinear: property Cost

Cost of misclassifying an observation

A square numeric matrix with one row and one column per class, whose
(i,j) element is the cost of classifying an observation of
class i into class j . It defaults to one everywhere
except the diagonal, which is zero. This property is read-only:
MATLAB refuses an assignment into it on this class, as it does on the
support vector machine, so a cost matrix is given to the constructor
instead.

The cost matrix takes no part in the fit and none in predict ,
which returns the class of largest score. It is read by the
'mincost' and 'classifcost' losses alone.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Cost of misclassifying an observation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationLinear.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
ClassificationLinear: property ExpandedPredictorNames

Names of the predictors as the fit saw them

A cell array of character vectors. It equals PredictorNames
unless categorical predictors were expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Names of the predictors as the fit saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationLinear.FittedLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
ClassificationLinear: property FittedLoss

Loss function the fit minimized

'hinge' for a support vector machine and 'logit' for a
logistic regression. This is the loss of the objective, which is not
the loss loss reports unless it is asked for. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Loss function the fit minimized



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationLinear.Lambda


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
ClassificationLinear: property Lambda

Regularization strength

A nonnegative scalar, or a 1xL row of them in ascending order.
It defaults to the reciprocal of the number of observations used to
train the model. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Regularization strength



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationLinear.Learner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClassificationLinear: property Learner

Linear classification model that was fitted

Either 'svm' or 'logistic' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Linear classification model that was fitted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationLinear.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
ClassificationLinear: property ModelParameters

Fitting options, as they were given

A structure holding every parameter of the fit, including the ones
that a different solver would have used and the 'auto' values
before they were resolved. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationLinear.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
ClassificationLinear: property PredictorNames

Names of the predictors

A cell array of character vectors with one name per column of the
training data, defaulting to 'x1' , 'x2' and so on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationLinear.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 253
ClassificationLinear: property Prior

Prior probability of each class

A numeric row vector with one element per class, in the order of
ClassNames and summing to one. It defaults to the class
frequencies of the training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationLinear.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
ClassificationLinear: property Regularization

Penalty on the coefficients

'ridge (L2)' or 'lasso (L1)' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Penalty on the coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationLinear.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
ClassificationLinear: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationLinear.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
ClassificationLinear: property ScoreTransform

Transformation applied to the predicted scores

A character vector naming a transformation, or the text of the
function handle that was supplied. Assigning to it accepts either.
It defaults to 'logit' for a logistic learner, which turns the
scores into posterior probabilities, and to 'none' for a
support vector machine.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Transformation applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationLinear.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 321
ClassificationLinear: e = edge ( obj , X , Y )
ClassificationLinear: e = edge (&hellip;, 'Weights' , W )

Weighted mean of the classification margins.

e = edge ( obj , X , Y ) returns one value
per regularization strength. The weights are normalized within each
class to that class&rsquo;s prior before they are applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Weighted mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationLinear.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 429
ClassificationLinear: l = loss ( obj , X , Y )
ClassificationLinear: l = loss (&hellip;, name , value )

Classification loss on new data.

l = loss ( obj , X , Y ) returns the
misclassification rate, one value per regularization strength.

l = loss (&hellip;, name , value ) takes
'LossFun' , one of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' and
'quadratic' , and 'Weights' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationLinear.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
ClassificationLinear: m = margin ( obj , X , Y )

Classification margin of each observation.

m = margin ( obj , X , Y ) returns the
score of the true class less the score of the other one, one row per
observation and one column per regularization strength. A positive
margin is a correct classification.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification margin of each observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationLinear.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 608
ClassificationLinear: labels = predict ( obj , XC )
ClassificationLinear: [ labels , scores ] = predict ( obj , XC )

Classify new observations.

labels = predict ( obj , XC ) returns the class
of largest score for each row of XC , in the type of the
response the model was fitted to. With L regularization
strengths labels has one column per strength.

[ labels , scores ] = predict ( obj , XC )
also returns the scores, an Nx2 matrix whose columns follow
ClassNames , or an Nx2xL array with more than one
strength. The scores are -f and +f for the raw model
value f , after ScoreTransform has been applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Classify new observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationLinear.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 186
ClassificationLinear: savemodel ( obj , filename )

Save a linear classifier to a file.

savemodel ( obj , filename ) saves the model
obj into filename in a form loadmodel can read
back.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Save a linear classifier to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationLinear.selectModels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 259
ClassificationLinear: sub = selectModels ( obj , idx )

Keep a subset of the fitted regularization strengths.

sub = selectModels ( obj , idx ) returns a model
holding only the strengths idx names, which may be indices into
Lambda or a logical vector over it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Keep a subset of the fitted regularization strengths.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1219
statistics: ClassificationNaiveBayes

Naive Bayes classification

The ClassificationNaiveBayes class implements a naive Bayes
classifier object, which can predict responses for new data using the
predict method.

A naive Bayes classifier estimates one univariate density per class and
per predictor, and treats the predictors as conditionally independent
given the class. The joint likelihood of an observation is therefore the
product of its per-predictor densities, and the posterior follows from
the class prior by Bayes&rsquo; rule. The independence assumption is rarely
true, but it costs only one density per predictor rather than one joint
density over all of them, which is what makes the model usable when the
predictors are many and the observations few.

Create a ClassificationNaiveBayes object by using the
fitcnb function or the class constructor.

Each predictor carries its own distribution, named in
DistributionNames , and the fitted parameters of class k and
predictor j are held in DistributionParameters{k,j} . A
'normal' predictor stores a two element column vector, the class
conditional mean and standard deviation; a 'kernel' predictor
stores a prob.KernelDistribution object.

See also:
fitcnb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Naive Bayes classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationNaiveBayes.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 494
ClassificationNaiveBayes: property BinEdges

Bin edges

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. A naive Bayes
model fits a density to each predictor as it stands and bins nothing, so
this is always an empty cell. It is kept because the cross-validated
model carries it across, and because code that reaches into it with
cellfun must find a cell rather than an empty matrix. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Bin edges



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationNaiveBayes.CategoricalLevels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 247
ClassificationNaiveBayes: property CategoricalLevels

Levels of the categorical predictors

A cell array with one entry per predictor, holding the distinct levels
of each categorical predictor and empty for every other. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Levels of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationNaiveBayes.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
ClassificationNaiveBayes: property CategoricalPredictors

Categorical predictor indices

A numeric row vector of the column indices of X treated as
categorical, or empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Categorical predictor indices



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationNaiveBayes.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
ClassificationNaiveBayes: property ClassNames

Class labels of the fitted model

A cell array of character vectors, a logical or numeric column vector,
or a character array, holding the distinct classes the model was fitted
on, in the order the other per-class properties use. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Class labels of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationNaiveBayes.ClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 441
ClassificationNaiveBayes: obj = ClassificationNaiveBayes ( X , Y )
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (&hellip;, name , value )

Create a ClassificationNaiveBayes object.

obj = ClassificationNaiveBayes ( X , Y ) fits a
naive Bayes classifier to the predictor data X and the class
labels Y . The supported Name / Value pairs are
those of fitcnb , which is the documented way to reach this
constructor.

See also:
fitcnb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create a ClassificationNaiveBayes object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNaiveBayes.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 396
ClassificationNaiveBayes: property Cost

Misclassification cost

A square numeric matrix with one row and column per class, in the order
of ClassNames . Cost(i,j) is the cost of classifying an
observation of class i into class j , and the default is
one off the diagonal and zero on it. It may be assigned after fitting,
as a matrix or as a structure carrying ClassNames and
ClassificationCosts .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Misclassification cost



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationNaiveBayes.DistributionNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
ClassificationNaiveBayes: property DistributionNames

Predictor distributions

A cell array of character vectors with one entry per predictor, naming
the distribution fitted to it: 'normal' or 'kernel' .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Predictor distributions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationNaiveBayes.DistributionParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 421
ClassificationNaiveBayes: property DistributionParameters

Fitted distribution parameters

A cell array with one row per class and one column per predictor.
DistributionParameters{k,j} holds the parameters fitted to
predictor j within class k : a two element column vector,
the mean and the standard deviation, for a 'normal' predictor,
and a prob.KernelDistribution object for a 'kernel' one.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Fitted distribution parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationNaiveBayes.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
ClassificationNaiveBayes: property ExpandedPredictorNames

Expanded predictor variable names

A cell array of character vectors naming the predictors as the model
sees them. It equals PredictorNames unless a categorical
predictor has been expanded into indicator variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Expanded predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
ClassificationNaiveBayes.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 367
ClassificationNaiveBayes: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationNaiveBayes.Kernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 225
ClassificationNaiveBayes: property Kernel

Kernel smoothing functions

A cell array with one entry per predictor naming the smoothing kernel
used by a 'kernel' predictor, and empty for every other. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Kernel smoothing functions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNaiveBayes.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 584
ClassificationNaiveBayes: property ModelParameters

What was fitted, and how

A structure carrying DistributionNames , Kernel ,
Support , Width , StandardizeData ,
Version , Method and Type .

It records the arguments as they were given , where the
properties of the same name record what they were resolved to: a model
fitted with no 'DistributionNames' argument reports the single
name 'normal' here and one name per predictor there. The
kernel settings are filled in with their defaults when a kernel density
was asked for, and left empty when none was. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
What was fitted, and how



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationNaiveBayes.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
ClassificationNaiveBayes: property Mu

Predictor means

The means used to center the predictors, when the model standardizes
them, and empty otherwise. These are not the class conditional
means, which are held in DistributionParameters . This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNaiveBayes.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
ClassificationNaiveBayes: property NumObservations

Number of observations

A positive integer specifying the number of observations used to train
the model, after any row holding a missing value has been dropped. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNaiveBayes.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 249
ClassificationNaiveBayes: property PredictorNames

Predictor variable names

A cell array of character vectors naming the predictors, in the order in
which they appear in X . The default names are 'x1' ,
'x2' , and so on. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationNaiveBayes.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 328
ClassificationNaiveBayes: property Prior

Class prior probabilities

A numeric row vector with one entry per class, in the order of
ClassNames , summing to one. It may be assigned after fitting,
as a numeric vector, as a structure carrying ClassNames and
ClassProbs , or as 'empirical' or 'uniform' .
Assigning it re-derives W .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Class prior probabilities



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationNaiveBayes.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 165
ClassificationNaiveBayes: property ResponseName

Response variable name

A character vector naming the response variable, 'Y' by default.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationNaiveBayes.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 375
ClassificationNaiveBayes: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the model. It is empty, [] , when every observation was
used, so a non-empty value means that rows holding missing values were
dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNaiveBayes.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 281
ClassificationNaiveBayes: property ScoreTransform

Score transformation

A character vector naming the function applied to the posterior returned
by predict , or a function handle taking and returning a matrix of
the same size. The default, 'none' , leaves the posterior
untouched.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Score transformation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationNaiveBayes.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
ClassificationNaiveBayes: property Sigma

Predictor standard deviations

The standard deviations used to scale the predictors, when the model
standardizes them, and empty otherwise. These are not the class
conditional standard deviations, which are held in
DistributionParameters . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNaiveBayes.Support


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
ClassificationNaiveBayes: property Support

Kernel smoothing supports

A cell array with one entry per predictor giving the support of a
'kernel' predictor&rsquo;s density, and empty for every other. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Kernel smoothing supports



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationNaiveBayes.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 262
ClassificationNaiveBayes: property W

Observation weights

A numeric column vector with one entry per observation used for fitting,
summing to one. Each class contributes its prior, spread evenly over
the observations belonging to it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationNaiveBayes.Width


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 271
ClassificationNaiveBayes: property Width

Kernel smoothing bandwidths

A numeric matrix with one row per class and one column per predictor,
giving the bandwidth of each 'kernel' predictor&rsquo;s density, and
empty when no predictor uses one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Kernel smoothing bandwidths



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationNaiveBayes.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
ClassificationNaiveBayes: property X

Predictor data

A numeric matrix containing the predictor data. Each column of X
represents one predictor (variable), and each row represents one
observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationNaiveBayes.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
ClassificationNaiveBayes: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for the
corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNaiveBayes.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 394
ClassificationNaiveBayes: CMdl = compact ( obj )

Drop the training data from a trained model.

CMdl = compact ( obj ) returns a
CompactClassificationNaiveBayes object carrying the fitted
densities and everything predict needs, but not the observations
the model was fitted on. It classifies new data identically and is far
smaller to keep or to ship.

See also:
CompactClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Drop the training data from a trained model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationNaiveBayes.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 585
ClassificationNaiveBayes: CVMdl = crossval ( obj )
ClassificationNaiveBayes: CVMdl = crossval (&hellip;, name , value )

Cross-validate a trained naive Bayes model.

CVMdl = crossval ( obj ) partitions the training data
into ten folds, or into as many folds as there are observations when
there are fewer than ten, refits the model on each fold&rsquo;s training part
and returns a ClassificationPartitionedModel .

CVMdl = crossval (&hellip;, name , value ) takes
exactly one of 'KFold' , 'Holdout' , 'Leaveout'
or 'CVPartition' .

See also:
ClassificationPartitionedModel,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Cross-validate a trained naive Bayes model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNaiveBayes.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 388
ClassificationNaiveBayes: e = edge ( obj , X , Y )
ClassificationNaiveBayes: e = edge (&hellip;, 'Weights' , w )

Classification edge on new data.

e = edge ( obj , X , Y ) returns the weighted
mean of the margins, a single number summarising how confidently the
model classifies the data.

The weights are normalized within each class to that class&rsquo;s prior
before they are applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification edge on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNaiveBayes.logp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
ClassificationNaiveBayes: lp = logp ( obj , X )

Log unconditional probability density of new data.

lp = logp ( obj , X ) returns one value per
observation, the logarithm of its density under the fitted model taken
over all the classes, each weighted by its prior. A markedly low value
marks an observation the model finds unlike anything it was trained on,
whatever class it would be assigned to.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Log unconditional probability density of new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNaiveBayes.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 511
ClassificationNaiveBayes: l = loss ( obj , X , Y )
ClassificationNaiveBayes: l = loss (&hellip;, name , value )

Classification loss on new data.

l = loss ( obj , X , Y ) returns the minimum
expected misclassification cost.

l = loss (&hellip;, name , value ) takes the
following options.

Name Value
'LossFun' One of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' (default) or
'quadratic' .
'Weights' A numeric vector of observation weights,
one per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationNaiveBayes.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 394
ClassificationNaiveBayes: m = margin ( obj , X , Y )

Classification margin on new data.

m = margin ( obj , X , Y ) returns one margin
per observation: the posterior the model gives the observation&rsquo;s true
class, less the largest posterior it gives any other class. A positive
margin means the observation is classified correctly, and a larger one
means it is classified more confidently.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Classification margin on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNaiveBayes.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 627
ClassificationNaiveBayes: label = predict ( obj , XC )
ClassificationNaiveBayes: [ label , score , cost ] = predict ( obj , XC )

Classify new data with a trained ClassificationNaiveBayes object.

label = predict ( obj , XC ) returns the predicted
class label for each row of XC , which must have as many columns as
the predictor data the model was fitted on.

[ label , score , cost ] = predict ( obj ,
XC ) also returns score , the posterior probability of each
class, and cost , the expected misclassification cost of assigning
each observation to each class. The label of an observation is the
class of least expected cost.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Classify new data with a trained ClassificationNaiveBayes object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationNaiveBayes.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
ClassificationNaiveBayes: e = resubEdge ( obj )

Classification edge on the training data.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification edge on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationNaiveBayes.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 190
ClassificationNaiveBayes: l = resubLoss ( obj )
ClassificationNaiveBayes: l = resubLoss (&hellip;, name , value )

Classification loss on the training data.

Takes the same options as loss .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationNaiveBayes.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 94
ClassificationNaiveBayes: m = resubMargin ( obj )

Classification margin on the training data.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Classification margin on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationNaiveBayes.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
ClassificationNaiveBayes: label = resubPredict ( obj )
ClassificationNaiveBayes: [ label , score , cost ] = resubPredict ( obj )

Classify the training data with the trained model.

The same as calling predict on the data the model was fitted on,
with the rows that were dropped for missing values left out.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Classify the training data with the trained model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationNaiveBayes.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
ClassificationNaiveBayes: savemodel ( obj , filename )

Save a ClassificationNaiveBayes object.

savemodel ( obj , filename ) saves each property of a
ClassificationNaiveBayes object into an Octave binary file, the name of
which is specified in filename , along with an extra variable, which
defines the type classification object these variables constitute. Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcnb,
ClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Save a ClassificationNaiveBayes object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 591
statistics: ClassificationNeuralNetwork

Neural network classification

The ClassificationNeuralNetwork class implements a neural network
classifier object, which can predict responses for new data using the
predict method.

Neural network classification is a machine learning method that uses
interconnected nodes in multiple layers to learn complex patterns in data.
It processes inputs through hidden layers with activation functions to
produce classification outputs.

Create a ClassificationNeuralNetwork object by using the
fitcnet function or the class constructor.

See also:
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Neural network classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNeuralNetwork.Activations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 391
ClassificationNeuralNetwork: property Activations

Activation functions for hidden layers

A character vector or cell array of character vectors specifying the
activation functions used in the hidden layers of the neural network.
Supported activation functions include: 'linear' ,
'sigmoid' , 'relu' , 'tanh' , 'softmax' ,
'lrelu' , 'prelu' , 'elu' , and 'gelu' .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Activation functions for hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationNeuralNetwork.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 375
ClassificationNeuralNetwork: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationNeuralNetwork.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
ClassificationNeuralNetwork: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationNeuralNetwork.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 412
ClassificationNeuralNetwork: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
ClassificationNeuralNetwork.ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5145
statistics: obj = ClassificationNeuralNetwork ( X , Y )
statistics: obj = ClassificationNeuralNetwork (&hellip;, name , value )

Create a ClassificationNeuralNetwork class object containing a
neural network classification model.

obj = ClassificationNeuralNetwork ( X , Y ) returns
a ClassificationNeuralNetwork object, with X as the predictor data
and Y containing the class labels of observations in X .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables. X will be used to train the neural network model.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y can contain any type
of categorical data. Y must have the same number of rows as
X .

obj = ClassificationNeuralNetwork (&hellip;, name ,
value ) returns a ClassificationNeuralNetwork object with
parameters specified by the following name , value
paired input arguments:

Name Value
'CategoricalPredictors' The predictors whose values
are levels, as indices, as a logical vector with one element per
predictor, or as 'all' . Each is dummy coded in its place, one
column of zeros and ones per level seen in training, named as in
'x1 == 2' in ExpandedPredictorNames , and the coded columns
are not standardized. An observation holding a level the training data
did not has no score and takes the class of largest prior, as a row
missing a predictor does.
'PredictorNames' A cell array of character
vectors specifying the names of the predictors. The length of this array
must match the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the neural network model.
ClassNames are of the same type as the class labels in Y .
'ScoreTransform' A user-defined function handle
or a character vector specifying one of the following builtin functions
specifying the transformation applied to predicted classification scores.
Supported values include 'doublelogit' , 'invlogit' ,
'ismax' , 'logit' , 'none' , 'identity' ,
'sign' , 'symmetric' , 'symmetricismax' , and
'symmetriclogit' .
'Standardize' A logical scalar specifying whether
to standardize the predictor data. When true , the predictors are
centered and scaled to have zero mean and unit variance.
'LayerSizes' A positive integer vector specifying
the sizes of the fully connected layers in the neural network. The
default is 10.
'Activations' A character vector or cell array of
character vectors specifying the activation functions for the hidden
layers. Supported values include 'linear' , 'sigmoid' ,
'relu' , 'tanh' , 'softmax' , 'lrelu' ,
'prelu' , 'elu' , and 'gelu' . The default is
'relu' , whose gradient is one wherever a unit is active and so
does not shrink as it passes back through the layers, where a sigmoid
multiplies it by at most a quarter at every one.
'OutputLayerActivation' A character vector
specifying the activation function for the output layer. Supported
values are the same as for 'Activations' . The default is
'softmax' , which makes the scores a probability over the
classes and trains the network against cross entropy; any other value
trains it against the mean squared error.
'LearningRate' A positive scalar specifying the
learning rate for gradient descent. The default is 0.003. A larger
rate can drive every unit of a hidden layer negative, after which a
rectifier passes no gradient and the network stops training.
Applies only when 'Solver' is 'sgd' .
'Solver' A character vector naming the solver that
trains the network, either 'lbfgs' or 'sgd' . The
default is 'lbfgs' , which minimizes the loss over the whole
training set at once by limited-memory BFGS, as MATLAB does. It takes
no learning rate, stops on the three tolerances below, and reaches a
lower training loss in fewer passes over the data, though each of its
iterations costs several passes where an epoch costs one.
'sgd' visits the samples one at a time and steps down the
gradient of each, running for 'IterationLimit' epochs; it was
the default before version 1.9.0.
'GradientTolerance' A nonnegative scalar. Training
stops once the gradient&rsquo;s infinity norm falls to or below it, which is
the quantity MATLAB tests too. The default is 1e-6 . Applies
only when 'Solver' is 'lbfgs' .
'StepTolerance' A nonnegative scalar. Training
stops once the step&rsquo;s infinity norm falls to or below it, which is the
quantity MATLAB tests too. The default is 1e-6 . Applies only
when 'Solver' is 'lbfgs' .
'LossTolerance' A real scalar. Training stops once
the training loss falls to or below it. The test is on the loss
itself and not on its change, matching MATLAB; pass -Inf to
switch it off. The default is 1e-6 . Applies only when
'Solver' is 'lbfgs' .
'IterationLimit' A positive integer specifying
the maximum number of training iterations. The default is 1000.
Under 'sgd' this counts epochs, under
'lbfgs' solver iterations.
'DisplayInfo' A logical scalar specifying whether
to display training information. The default is false .

See also:
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 99
Create a ClassificationNeuralNetwork class object containing a neural network classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationNeuralNetwork.ConvergenceInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 749
ClassificationNeuralNetwork: property ConvergenceInfo

Training convergence information

A structure containing convergence information of the neural network
classifier model with the following fields:

Accuracy - The prediction accuracy at each iteration
during training
TrainingLoss - The loss value recorded at each iteration
during training
Time - The cumulative time taken for all iterations in
seconds

This property is read-only.

Under 'lbfgs' the structure carries Gradient and
Step , the two quantities the solver measured to decide it had
converged, and ConvergenceCriterion , naming the test that
stopped it. It carries no Accuracy : MATLAB reports none, and
measuring it would cost a pass over the whole training set at every
iteration.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Training convergence information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNeuralNetwork.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 786
ClassificationNeuralNetwork: property Cost

Cost of misclassification

A numeric matrix with one row and one column per class, where
Cost(i,j) is the cost of classifying an observation of class
i as class j . The default has zeros on the diagonal and
ones elsewhere. Change it on a trained model with dot notation, as
in obj .Cost = cost .

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes are in. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNeuralNetwork.DisplayInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 185
ClassificationNeuralNetwork: property DisplayInfo

Display training information flag

A boolean flag indicating whether to print information during training.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Display training information flag



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
ClassificationNeuralNetwork.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
ClassificationNeuralNetwork: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
ClassificationNeuralNetwork.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 370
ClassificationNeuralNetwork: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationNeuralNetwork.IterationLimit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 207
ClassificationNeuralNetwork: property IterationLimit

Maximum number of training iterations

A positive integer value defining the maximum number of epochs for
training the model. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Maximum number of training iterations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNeuralNetwork.LayerBiases


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 240
ClassificationNeuralNetwork: property LayerBiases

Learned bias of each fully connected layer

A cell array holding one column vector per layer, the output layer
included, with one entry per neuron of that layer. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Learned bias of each fully connected layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationNeuralNetwork.LayerSizes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 480
ClassificationNeuralNetwork: property LayerSizes

Sizes of fully connected layers

A positive integer vector specifying the sizes of the fully connected
layers in the neural network model. The i-th element of
LayerSizes is the number of outputs in the i-th fully connected
layer of the neural network model. LayerSizes does not include
the size of the final fully connected layer. This layer always has K
outputs, where K is the number of classes in Y. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Sizes of fully connected layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNeuralNetwork.LayerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 291
ClassificationNeuralNetwork: property LayerWeights

Learned weights of each fully connected layer

A cell array holding one weight matrix per layer, the output layer
included. LayerWeights{i} has one row per neuron of layer
i and one column per input it receives. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Learned weights of each fully connected layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNeuralNetwork.LearningRate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
ClassificationNeuralNetwork: property LearningRate

Learning rate for gradient descent

A positive scalar value defining the learning rate used by the gradient
descent algorithm during training. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Learning rate for gradient descent



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationNeuralNetwork.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1174
ClassificationNeuralNetwork: property ModelParameters

Neural network model parameters

A structure holding the fit as it was asked for: LayerSizes ,
Activations , OutputLayerActivation ,
LayerWeightsInitializers , Solver ,
LearningRate , IterationLimit ,
GradientTolerance , LossTolerance ,
StepTolerance , DisplayInfo , StandardizeData ,
and the Version , Method and Type tags.

What came out of the fit is elsewhere: the LayerWeights and
LayerBiases properties hold the network, TrainingHistory
the series and ConvergenceInfo where it stopped.

LayerWeightsInitializers names the scheme each layer&rsquo;s weights
were drawn with, the output layer last: 'he' for a rectifying
activation and 'glorot' for a symmetric one. It is a report,
not a setting, the engine choosing per layer from the activation and
offering no way to override it.

OutputLayerActivation , Solver and LearningRate
are this package&rsquo;s own; MATLAB has no counterpart for them. The fields
it reports that this class does not accept as arguments
( Lambda , the validation set and its patience and frequency,
InitialStepSize and the two initializer settings) are absent.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Neural network model parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationNeuralNetwork.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 410
ClassificationNeuralNetwork: property Mu

Predictor means

A numeric vector containing the means of the predictors used for
standardization. Empty when the predictor data were not standardized.
This property is read-only.

Only observations with no missing predictor enter the estimate, and
they are weighted so that each class keeps the share of the
observation weight it carried before any row was set aside.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationNeuralNetwork.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 250
ClassificationNeuralNetwork: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the ClassificationNeuralNetwork model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationNeuralNetwork.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
ClassificationNeuralNetwork: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationNeuralNetwork model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationNeuralNetwork.OutputLayerActivation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 449
ClassificationNeuralNetwork: property OutputLayerActivation

Activation function for output layer

A character vector specifying the activation function of the output layer
of the neural network. Supported activation functions are the same as
for the Activations property. The default, softmax ,
reports a probability over the classes; the network is then trained
against cross entropy rather than the mean squared error. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Activation function for output layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationNeuralNetwork.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 267
ClassificationNeuralNetwork: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationNeuralNetwork.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 623
ClassificationNeuralNetwork: property Prior

Prior probability of each class

A numeric vector with one entry per class, in the order of
ClassNames , summing to one. It defaults to the relative
frequency of each class in the training data. This property is
read-only, as MATLAB documents it; pass 'Prior' to
fitcnet to set it.

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNeuralNetwork.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
ClassificationNeuralNetwork: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationNeuralNetwork.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 406
ClassificationNeuralNetwork: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the ClassificationNeuralNetwork model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationNeuralNetwork.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1007
ClassificationNeuralNetwork: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationNeuralNetwork.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 441
ClassificationNeuralNetwork: property Sigma

Predictor standard deviations

A numeric vector containing the standard deviations of the predictors
used for standardization. Empty when the predictor data were not
standardized.
This property is read-only.

Only observations with no missing predictor enter the estimate, and
they are weighted so that each class keeps the share of the
observation weight it carried before any row was set aside.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationNeuralNetwork.Solver


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 277
ClassificationNeuralNetwork: property Solver

Solver used for training

A character vector specifying the solver algorithm used to train the
neural network model, either 'Gradient Descent' for the
stochastic solver or 'LBFGS' for the full-batch one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Solver used for training



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationNeuralNetwork.TrainingHistory


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 466
ClassificationNeuralNetwork: property TrainingHistory

Iteration by iteration record of training

A table with one row per iteration, holding the iteration number, the
training loss and the training accuracy recorded at it. This property
is read-only.

The columns follow the solver. Under 'sgd' they are
Iteration and TrainingLoss , with TrainingAccuracy
for a classifier. Under 'lbfgs' they are Iteration ,
TrainingLoss , Gradient and Step , as MATLAB&rsquo;s are.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Iteration by iteration record of training



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNeuralNetwork.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 385
ClassificationNeuralNetwork: property W

Observation weights

A numeric column vector with one entry per training observation. It
defaults to a uniform weight for every observation. This property is
read-only.

Each class carries its prior spread evenly over its own observations,
so an observation of a class weighs Prior for that class
divided by the number of observations it holds.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNeuralNetwork.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 242
ClassificationNeuralNetwork: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationNeuralNetwork.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 319
ClassificationNeuralNetwork: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationNeuralNetwork.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 289
ClassificationNeuralNetwork: CVMdl = compact ( obj )

Create a CompactClassificationNeuralNetwork object.

CVMdl = compact ( obj ) creates a compact version of the
ClassificationNeuralNetwork object, obj .

See also:
fitcnet,
ClassificationNeuralNetwork,
CompactClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Create a CompactClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationNeuralNetwork.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1079
ClassificationNeuralNetwork: CVMdl = crossval ( obj )
ClassificationNeuralNetwork: CVMdl = crossval (&hellip;, Name , Value )

Cross Validate a Neural Network classification object.

CVMdl = crossval ( obj ) returns a cross-validated model
object, CVMdl , from a trained model, obj , using 10-fold
cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv , where
isa ( cv , "cvpartition") = 1.

See also:
fitcnet,
ClassificationNeuralNetwork,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Cross Validate a Neural Network classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNeuralNetwork.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 583
ClassificationNeuralNetwork: e = edge ( obj , X , Y )
ClassificationNeuralNetwork: e = edge (&hellip;, "Weights" , w )

Classification edge of a neural network classifier.

e = edge ( obj , X , Y ) returns the mean of
the classification margins over the rows of X .

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, w holding one weight per row of X .
The weights are normalised to sum to one before they are applied.

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.margin,
ClassificationNeuralNetwork.loss,
ClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Classification edge of a neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationNeuralNetwork.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1208
ClassificationNeuralNetwork: L = loss ( obj , X , Y )
ClassificationNeuralNetwork: L = loss (&hellip;, name , value )

Classification loss of a neural network classifier.

L = loss ( obj , X , Y ) returns the
proportion of the rows of X the model misclassifies against the
true labels Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss. Supported values are
"mincost" , the default, "binodeviance" ,
"classifcost" , "classiferror" , "crossentropy" ,
"exponential" , "hinge" , "logit" and
"quadratic" . "mincost" assigns each observation to
the class of least expected cost and charges what that assignment
costs, so it reads the scores as a posterior; "classifcost"
charges what the model&rsquo;s own prediction costs. "crossentropy"
is defined for a network only. Note that the default differs from the
other classifiers in this package, which default to
"classiferror" , and follows MATLAB&rsquo;s for this class.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.margin,
ClassificationNeuralNetwork.edge,
ClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Classification loss of a neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationNeuralNetwork.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 541
ClassificationNeuralNetwork: m = margin ( obj , X , Y )

Classification margin of a neural network classifier.

m = margin ( obj , X , Y ) returns a column
vector holding, for each row of X , the score the model gives its
true class in Y less the largest score it gives any other class.
A positive margin means the observation is classified correctly, and
the larger it is the more confidently so.

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.edge,
ClassificationNeuralNetwork.loss,
ClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Classification margin of a neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1233
ClassificationNeuralNetwork: label = predict ( obj , XC )
ClassificationNeuralNetwork: [ label , score ] = predict ( obj , XC )

Classify new data points into categories using the neural network
classification model from a ClassificationNeuralNetwork object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
predictor data in obj.X and corresponding labels, obj.Y ,
stored in the ClassificationNeuralNetwork model, obj .

obj must be a ClassificationNeuralNetwork class object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the neural network
model in obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the predicted class scores or
posterior probabilities for each instance of the corresponding unique
classes.

The score matrix contains the classification scores for each class.
For each observation in XC , the predicted class label is the one
with the highest score among all classes. If the ScoreTransform
property is set to a transformation function, the scores are transformed
accordingly before being returned.

See also:
ClassificationNeuralNetwork,
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 129
Classify new data points into categories using the neural network classification model from a ClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationNeuralNetwork.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
ClassificationNeuralNetwork: e = resubEdge ( obj )

Classification edge of a neural network classifier on its training
data.

e = resubEdge ( obj ) is edge applied to the
observations the model was fitted on, weighted by obj.W .

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Classification edge of a neural network classifier on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationNeuralNetwork.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
ClassificationNeuralNetwork: L = resubLoss ( obj )
ClassificationNeuralNetwork: L = resubLoss (&hellip;, name , value )

Classification loss of a neural network classifier on its training
data.

L = resubLoss ( obj ) is loss applied to the
observations the model was fitted on, weighted by obj.W . It
takes the same "LossFun" name-value pair.

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Classification loss of a neural network classifier on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationNeuralNetwork.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 291
ClassificationNeuralNetwork: m = resubMargin ( obj )

Classification margin of a neural network classifier on its training
data.

m = resubMargin ( obj ) is margin applied to
the observations the model was fitted on.

See also:
ClassificationNeuralNetwork,
ClassificationNeuralNetwork.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 74
Classification margin of a neural network classifier on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationNeuralNetwork.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 751
ClassificationNeuralNetwork: label = resubPredict ( obj )
ClassificationNeuralNetwork: [ label , score ] = resubPredict ( obj )

Classify the training data using the trained neural network
classification object.

label = resubPredict ( obj ) returns the vector of
labels predicted for the corresponding instances in the training data,
using the predictor data in obj.X and corresponding labels,
obj.Y , stored in the neural network classification model,
obj .

obj must be a ClassificationNeuralNetwork class object.

[ label , score ] = resubPredict ( obj ) also
returns score , which contains the predicted class scores or
posterior probabilities for each instance of the corresponding unique
classes.

See also:
ClassificationNeuralNetwork,
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 82
Classify the training data using the trained neural network classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationNeuralNetwork.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 512
ClassificationNeuralNetwork: savemodel ( obj , filename )

Save a ClassificationNeuralNetwork object.

savemodel ( obj , filename ) saves each property of a
ClassificationNeuralNetwork object into an Octave binary file, the name
of which is specified in filename , along with an extra variable,
which defines the type classification object these variables constitute.
Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcnet,
ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Save a ClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationPartitionedECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 778
statistics: ClassificationPartitionedECOC

A cross-validated multiclass model built from binary learners.

Each fold holds out part of the data, fits an error correcting output codes
model on the rest, and answers the part it held out, so every observation
is classified by a model that never saw it.

It comes from crossval on a ClassificationECOC , and from
fitcecoc given any of 'KFold' , 'Holdout' ,
'Leaveout' or 'CVPartition' .

This is the one cross-validated class in the package that is not the
general ClassificationPartitionedModel . It carries
CodingMatrix , BinaryLoss and BinaryY , three things
the general class has nowhere to put and without which a fold&rsquo;s scores
cannot be decoded at all.

See also:
fitcecoc,
ClassificationECOC,
CompactClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
A cross-validated multiclass model built from binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationPartitionedECOC.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 129
ClassificationPartitionedECOC: property BinEdges

The bin edges of the predictors, always empty here. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
The bin edges of the predictors, always empty here.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedECOC.BinaryLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 131
ClassificationPartitionedECOC: property BinaryLoss

The loss the binary scores of a fold are read with. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
The loss the binary scores of a fold are read with.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedECOC.BinaryY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 157
ClassificationPartitionedECOC: property BinaryY

What each observation was to each binary learner, an NxL matrix
of -1, 0 and +1. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 80
What each observation was to each binary learner, an NxL matrix of -1, 0 and +1.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationPartitionedECOC.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
ClassificationPartitionedECOC: property CategoricalPredictors

The columns holding categorical predictors, empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
The columns holding categorical predictors, empty when none is.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedECOC.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 106
ClassificationPartitionedECOC: property ClassNames

The distinct class labels. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
The distinct class labels.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
ClassificationPartitionedECOC.ClassificationPartitionedECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
ClassificationPartitionedECOC: obj = ClassificationPartitionedECOC ( Mdl , Partition )

Create a ClassificationPartitionedECOC object.

Mdl is the ClassificationECOC to cross validate and
Partition the cvpartition saying which rows each fold
holds out. The documented way to reach this constructor is
crossval .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Create a ClassificationPartitionedECOC object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedECOC.CodingMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationPartitionedECOC: property CodingMatrix

The coding design every fold was fitted on, a KxL matrix. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
The coding design every fold was fitted on, a KxL matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationPartitionedECOC.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 104
ClassificationPartitionedECOC: property Cost

The cost of misclassification. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The cost of misclassification.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationPartitionedECOC.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
ClassificationPartitionedECOC: property CrossValidatedModel

The kind of model that was cross-validated, 'ECOC' here. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
The kind of model that was cross-validated, 'ECOC' here.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedECOC.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
ClassificationPartitionedECOC: property KFold

The number of folds. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
The number of folds.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationPartitionedECOC.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationPartitionedECOC: property ModelParameters

A structure of the options the folds were fitted with. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
A structure of the options the folds were fitted with.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationPartitionedECOC.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 117
ClassificationPartitionedECOC: property NumObservations

The number of observations used. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
The number of observations used.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedECOC.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
ClassificationPartitionedECOC: property Partition

The cvpartition object that says which rows each fold held out.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
The cvpartition object that says which rows each fold held out.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedECOC.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
ClassificationPartitionedECOC: property PredictorNames

The names of the predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
The names of the predictors.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedECOC.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 111
ClassificationPartitionedECOC: property Prior

The prior probability of each class. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
The prior probability of each class.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedECOC.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
ClassificationPartitionedECOC: property ResponseName

The name of the response variable. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
The name of the response variable.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedECOC.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 207
ClassificationPartitionedECOC: property ScoreTransform

The transform applied to the assembled out-of-fold scores. The folds
never carry it: it is applied once to what they return, which is what
R2024a does.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
The transform applied to the assembled out-of-fold scores.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedECOC.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
ClassificationPartitionedECOC: property Trained

The models the folds were fitted to

A cell column with one CompactClassificationECOC per fold, the
training data having no place in a model that only ever answers the
rows it did not see. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
The models the folds were fitted to



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationPartitionedECOC.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
ClassificationPartitionedECOC: property W

The observation weights. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
The observation weights.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationPartitionedECOC.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
ClassificationPartitionedECOC: property X

The predictor data the folds were fitted on. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
The predictor data the folds were fitted on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationPartitionedECOC.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 113
ClassificationPartitionedECOC: property Y

The class labels the folds were fitted on. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
The class labels the folds were fitted on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedECOC.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 173
ClassificationPartitionedECOC: e = kfoldEdge ( obj )

Out-of-fold classification edge, the weighted mean of the margins.

See also:
ClassificationPartitionedECOC.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Out-of-fold classification edge, the weighted mean of the margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedECOC.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 355
ClassificationPartitionedECOC: L = kfoldLoss ( obj )
ClassificationPartitionedECOC: L = kfoldLoss (&hellip;, name , value )

Out-of-fold classification loss.

Name Value
'LossFun' 'classiferror' (default),
'classifcost' , 'mincost' , 'binodeviance' ,
'exponential' , 'hinge' , 'logit' or
'quadratic' .

See also:
ClassificationPartitionedECOC.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Out-of-fold classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedECOC.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
ClassificationPartitionedECOC: m = kfoldMargin ( obj )

Out-of-fold classification margin of every observation.

See also:
ClassificationPartitionedECOC.kfoldPredict,
ClassificationPartitionedECOC.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Out-of-fold classification margin of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedECOC.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 507
ClassificationPartitionedECOC: label = kfoldPredict ( obj )
ClassificationPartitionedECOC: [ label , NegLoss ] = kfoldPredict ( obj )

Out-of-fold class of every observation.

Each observation is classified by the fold that held it out, so the
labels are out-of-sample. An observation no fold held out, which
under a holdout partition is most of them, comes back missing rather
than classified, and its NegLoss row comes back NaN .

See also:
ClassificationPartitionedECOC,
CompactClassificationECOC.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Out-of-fold class of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationPartitionedECOC.kfoldfun


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 331
ClassificationPartitionedECOC: vals = kfoldfun ( obj , fun )

Apply a function to every fold.

fun is called once per fold as
fun ( CMdl , Xtrain , Ytrain , Wtrain ,
Xtest , Ytest , Wtest ) and must return a numeric row
of the same length every time. vals has one row per fold.

See also:
ClassificationPartitionedECOC.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Apply a function to every fold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 593
statistics: ClassificationPartitionedEnsemble

Cross-validated ensemble of decision trees for classification

A ClassificationPartitionedEnsemble object holds one ensemble per
fold of a partition, each fitted on the observations the fold keeps for
training, and answers for every observation with the ensemble of the fold
that held it out.

Create one with fitcensemble given a cross-validation option, or
with the crossval method of a ClassificationEnsemble or
ClassificationBaggedEnsemble .

See also:
fitcensemble,
ClassificationEnsemble.crossval,
CompactClassificationEnsemble,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Cross-validated ensemble of decision trees for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 124
ClassificationPartitionedEnsemble: property BinEdges

Bin edges of the predictors

Always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
ClassificationPartitionedEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
ClassificationPartitionedEnsemble: property CategoricalPredictors

Indices of categorical predictors

Always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedEnsemble.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 105
ClassificationPartitionedEnsemble: property ClassNames

Names of the classes

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
ClassificationPartitionedEnsemble.ClassificationPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
ClassificationPartitionedEnsemble: CVMdl = ClassificationPartitionedEnsemble ( Mdl , Partition )

Cross-validate a classification ensemble.

Mdl is the ensemble to cross-validate and Partition a
cvpartition of its observations. The documented ways in are
fitcensemble and crossval .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Cross-validate a classification ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationPartitionedEnsemble.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
ClassificationPartitionedEnsemble: property Cost

Misclassification costs

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Misclassification costs



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
ClassificationPartitionedEnsemble.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 192
ClassificationPartitionedEnsemble: property CrossValidatedModel

Method of the cross-validated ensemble

The Method of the ensemble, such as 'AdaBoostM1' or
'Bag' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Method of the cross-validated ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedEnsemble.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
ClassificationPartitionedEnsemble: property KFold

Number of folds

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationPartitionedEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
ClassificationPartitionedEnsemble: property ModelParameters

Parameters of the cross-validation

A structure with the fields Type , Method ,
'PartitionedEnsemble' , LearnerTemplates , the
ModelParameters of the ensemble the folds were fitted as, and
NLearn , the number of folds. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Parameters of the cross-validation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
ClassificationPartitionedEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
ClassificationPartitionedEnsemble: property NumObservations

Number of observations

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationPartitionedEnsemble.NumTrainedPerFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
ClassificationPartitionedEnsemble: property NumTrainedPerFold

Number of learners in each fold

A row vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Number of learners in each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedEnsemble.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
ClassificationPartitionedEnsemble: property Partition

The partition of the observations

A cvpartition object. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
The partition of the observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationPartitionedEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
ClassificationPartitionedEnsemble: property PredictorNames

Names of the predictors

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedEnsemble.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 114
ClassificationPartitionedEnsemble: property Prior

Prior probabilities of the classes

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
ClassificationPartitionedEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationPartitionedEnsemble.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
ClassificationPartitionedEnsemble: property ScoreTransform

Transform applied to the out-of-fold scores

The folds carry none; this one is applied once to the scores they
return.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the out-of-fold scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedEnsemble.Trainable


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
ClassificationPartitionedEnsemble: property Trainable

The full ensemble of each fold

A column cell array with one ClassificationEnsemble or
ClassificationBaggedEnsemble per fold, which resume
grows. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The full ensemble of each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 184
ClassificationPartitionedEnsemble: property Trained

The compact ensemble of each fold

A column cell array with one CompactClassificationEnsemble per
fold. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
The compact ensemble of each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
ClassificationPartitionedEnsemble: property W

Observation weights

The weights of the ensemble that was cross-validated. The losses and
edges weigh the held-out observations by them. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
ClassificationPartitionedEnsemble: property X

Predictor data

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 88
ClassificationPartitionedEnsemble: property Y

Class labels

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedEnsemble.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 371
ClassificationPartitionedEnsemble: e = kfoldEdge ( obj )
ClassificationPartitionedEnsemble: e = kfoldEdge (&hellip;, name , value )

Cross-validated classification edge.

The weighted mean of the out-of-fold margins, weighted by W .
'Folds' and 'Mode' are taken as by kfoldLoss .

See also:
ClassificationPartitionedEnsemble,
ClassificationPartitionedEnsemble.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Cross-validated classification edge.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedEnsemble.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 786
ClassificationPartitionedEnsemble: L = kfoldLoss ( obj )
ClassificationPartitionedEnsemble: L = kfoldLoss (&hellip;, name , value )

Cross-validated classification loss.

L is the loss of the out-of-fold scores, the held-out observations
weighted by W , those without scores left out.

Name-Value arguments:

Name Value
'Folds' The folds to use, pooled. The default
is all of them.
'LossFun' A loss
CompactClassificationEnsemble.loss accepts. The default is
'classiferror' .
'Mode' 'average' (default) for one loss
over the observations of every fold used, 'individual' for a
column with the loss of each fold, or 'cumulative' for a column
whose element t uses the first t learners of every fold.

See also:
ClassificationPartitionedEnsemble,
ClassificationPartitionedEnsemble.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Cross-validated classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationPartitionedEnsemble.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClassificationPartitionedEnsemble: m = kfoldMargin ( obj )

Cross-validated classification margins.

m holds each observation&rsquo;s margin under its out-of-fold scores,
NaN for one no fold held out.

See also:
ClassificationPartitionedEnsemble,
ClassificationPartitionedEnsemble.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cross-validated classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedEnsemble.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 567
ClassificationPartitionedEnsemble: label = kfoldPredict ( obj )
ClassificationPartitionedEnsemble: [ label , scores ] = kfoldPredict ( obj )

Classify each observation with the fold that held it out.

scores holds each observation&rsquo;s scores from the ensemble of the
fold that held it out, after ScoreTransform , and label
the class of highest score. An observation no fold held out, as under
a holdout partition, has NaN scores and the class of greatest
prior probability.

See also:
ClassificationPartitionedEnsemble,
ClassificationPartitionedEnsemble.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Classify each observation with the fold that held it out.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedEnsemble.kfoldfun


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 348
ClassificationPartitionedEnsemble: vals = kfoldfun ( obj , fun )

Apply a function to each fold.

fun is called once per fold as
fun (CMP, Xtrain, Ytrain, Wtrain, Xtest, Ytest, Wtest) ,
CMP being the fold&rsquo;s compact ensemble and the weights those of
W , and must return a row. vals stacks the rows.

See also:
ClassificationPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Apply a function to each fold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 385
ClassificationPartitionedEnsemble: CVMdl = resume ( obj , NumLearningCycles )
ClassificationPartitionedEnsemble: CVMdl = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more learners in every fold.

Each fold&rsquo;s ensemble is resumed, as ClassificationEnsemble.resume
does, by NumLearningCycles learners.

See also:
ClassificationPartitionedEnsemble,
ClassificationEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Grow more learners in every fold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 925
statistics: ClassificationPartitionedKernel

Cross-validated Gaussian kernel binary classifier.

A ClassificationPartitionedKernel object holds one
ClassificationKernel per fold of a partition, each fitted to the
observations the fold trains on. Every kfold method predicts each
observation with the fold that held it out , so the estimate it
returns is an out-of-sample one.

A ClassificationKernel stores no copy of its training data and so
has no resubstitution methods and no compact form. This class is
what takes their place: cross-validation is the way a linear model is
asked how it would do on data it has not seen.

When the fold models carry a whole regularization path, every method
returns one column per strength, in the order of the 'Lambda'
that was asked for.

Create one with fitclinear and a cross-validation option, or
directly.

See also:
fitclinear,
ClassificationKernel,
ClassificationPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Cross-validated Gaussian kernel binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
ClassificationPartitionedKernel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationPartitionedKernel: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedKernel.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClassificationPartitionedKernel: property ClassNames

Names of the two classes

A column of the same type as the response, shared by every fold.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Names of the two classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
ClassificationPartitionedKernel.ClassificationPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1069
ClassificationPartitionedKernel: obj = ClassificationPartitionedKernel ( X , Y )
ClassificationPartitionedKernel: obj = ClassificationPartitionedKernel (&hellip;, name , value )

Cross-validate a linear binary classifier.

obj = ClassificationPartitionedKernel ( X , Y )
partitions the data into ten stratified folds and fits a
ClassificationKernel to each.

obj = ClassificationPartitionedKernel (&hellip;,
name , value ) takes one of 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' to say
how to partition, and any option ClassificationKernel takes to
say how to fit. 'CrossVal' is accepted and has no effect
here, this class being cross-validated by construction.

The classes, the prior and the cost are resolved once over the whole
data and handed to every fold. Anything left as 'auto' is
not: each fold resolves 'Lambda' and 'KernelScale'
against its own training rows, so ten folds of a hundred
observations each get a Lambda of one ninetieth rather than
one hundredth. Both are MATLAB&rsquo;s behaviour, measured.

See also:
fitclinear,
ClassificationKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Cross-validate a linear binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationPartitionedKernel.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
ClassificationPartitionedKernel: property Cost

Cost of misclassifying an observation

A square numeric matrix with one row and one column per class. It is
handed to every fold rather than re-derived by each. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Cost of misclassifying an observation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationPartitionedKernel.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClassificationPartitionedKernel: property CrossValidatedModel

Name of the model that was cross-validated

Always 'Linear' , the short name MATLAB uses. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Name of the model that was cross-validated



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedKernel.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
ClassificationPartitionedKernel: property KFold

Number of folds

A positive integer scalar. A holdout partition has one fold and a
leave-one-out partition has as many as there are observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationPartitionedKernel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1155
ClassificationPartitionedKernel: property ModelParameters

What was cross-validated, and how

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class, with
LearnerTemplates naming the backing. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedKernel' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
What was cross-validated, and how



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationPartitionedKernel.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 221
ClassificationPartitionedKernel: property NumObservations

Number of observations the partition covers

A positive integer scalar, counting the rows that survived the removal
of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Number of observations the partition covers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedKernel.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 155
ClassificationPartitionedKernel: property Partition

The partition itself

A cvpartition object over the retained observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
The partition itself



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedKernel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
ClassificationPartitionedKernel: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedKernel.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 321
ClassificationPartitionedKernel: property Prior

Prior probability of each class

A numeric row vector summing to one, in the order of
ClassNames . Like the cost it is the parent&rsquo;s and is handed to
every fold, so a fold of an unbalanced problem does not quietly adopt
a prior of its own. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedKernel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
ClassificationPartitionedKernel: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedKernel.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 460
ClassificationPartitionedKernel: property ScoreTransform

Transformation applied to the predicted scores

A character vector naming a transformation, or the text of the
function handle that was supplied, which may be assigned after the
model is built. It is applied once to the assembled scores and is
not handed to the folds. A transform the learner implies, as
'logistic' implies 'logit' , does stay with the folds,
and this one is then applied on top of it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Transformation applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedKernel.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
ClassificationPartitionedKernel: property Trained

The models fitted to the folds

A cell column with one ClassificationKernel per fold, each
fitted to the observations its fold trains on. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The models fitted to the folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationPartitionedKernel.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 203
ClassificationPartitionedKernel: property W

Observation weights

An Nx1 numeric vector summing to one, normalized within each
class to that class&rsquo;s cost-adjusted prior. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationPartitionedKernel.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
ClassificationPartitionedKernel: property Y

Response of the retained observations

In the type it was supplied in. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Response of the retained observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedKernel.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 384
ClassificationPartitionedKernel: e = kfoldEdge ( obj )
ClassificationPartitionedKernel: e = kfoldEdge (&hellip;, name , value )

Weighted mean of the out-of-fold classification margins.

e = kfoldEdge (&hellip;, name , value ) takes
'Folds' , a subset of the folds to average over, and
'Mode' , either 'average' , the default, or
'individual' , which returns one row per fold instead.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Weighted mean of the out-of-fold classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedKernel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 435
ClassificationPartitionedKernel: l = kfoldLoss ( obj )
ClassificationPartitionedKernel: l = kfoldLoss (&hellip;, name , value )

Out-of-fold classification loss.

l = kfoldLoss ( obj ) returns the out-of-fold
misclassification rate.

l = kfoldLoss (&hellip;, name , value ) takes
'LossFun' , one of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' and
'quadratic' ; 'Folds' ; and 'Mode' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Out-of-fold classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedKernel.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
ClassificationPartitionedKernel: m = kfoldMargin ( obj )

Out-of-fold classification margin of every observation.

The score the out-of-fold model gives the true class, less the score
it gives the other one. An observation no fold held out comes back
NaN .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Out-of-fold classification margin of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedKernel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 435
ClassificationPartitionedKernel: labels = kfoldPredict ( obj )
ClassificationPartitionedKernel: [ labels , scores ] = kfoldPredict ( obj )

Out-of-fold class of every observation.

Each observation is classified by the fold that held it out, so the
labels are out-of-sample. An observation that no fold held out, which
under a holdout partition is most of them, comes back missing rather
than classified, and its scores come back NaN .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Out-of-fold class of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationPartitionedLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 916
statistics: ClassificationPartitionedLinear

Cross-validated linear binary classifier.

A ClassificationPartitionedLinear object holds one
ClassificationLinear per fold of a partition, each fitted to the
observations the fold trains on. Every kfold method predicts each
observation with the fold that held it out , so the estimate it
returns is an out-of-sample one.

A ClassificationLinear stores no copy of its training data and so
has no resubstitution methods and no compact form. This class is
what takes their place: cross-validation is the way a linear model is
asked how it would do on data it has not seen.

When the fold models carry a whole regularization path, every method
returns one column per strength, in the order of the 'Lambda'
that was asked for.

Create one with fitclinear and a cross-validation option, or
directly.

See also:
fitclinear,
ClassificationLinear,
ClassificationPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Cross-validated linear binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
ClassificationPartitionedLinear.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationPartitionedLinear: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedLinear.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClassificationPartitionedLinear: property ClassNames

Names of the two classes

A column of the same type as the response, shared by every fold.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Names of the two classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
ClassificationPartitionedLinear.ClassificationPartitionedLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1039
ClassificationPartitionedLinear: obj = ClassificationPartitionedLinear ( X , Y )
ClassificationPartitionedLinear: obj = ClassificationPartitionedLinear (&hellip;, name , value )

Cross-validate a linear binary classifier.

obj = ClassificationPartitionedLinear ( X , Y )
partitions the data into ten stratified folds and fits a
ClassificationLinear to each.

obj = ClassificationPartitionedLinear (&hellip;,
name , value ) takes one of 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' to say
how to partition, and any option ClassificationLinear takes to
say how to fit. 'CrossVal' is accepted and has no effect
here, this class being cross-validated by construction.

The classes, the prior and the cost are resolved once over the whole
data and handed to every fold. Anything left as 'auto' is
not: each fold resolves 'Lambda' against its own training
rows, so ten folds of a hundred observations each get one ninetieth
rather than one hundredth. Both are MATLAB&rsquo;s behaviour, measured.

See also:
fitclinear,
ClassificationLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Cross-validate a linear binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationPartitionedLinear.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
ClassificationPartitionedLinear: property Cost

Cost of misclassifying an observation

A square numeric matrix with one row and one column per class. It is
handed to every fold rather than re-derived by each. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Cost of misclassifying an observation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationPartitionedLinear.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClassificationPartitionedLinear: property CrossValidatedModel

Name of the model that was cross-validated

Always 'Linear' , the short name MATLAB uses. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Name of the model that was cross-validated



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedLinear.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
ClassificationPartitionedLinear: property KFold

Number of folds

A positive integer scalar. A holdout partition has one fold and a
leave-one-out partition has as many as there are observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationPartitionedLinear.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1155
ClassificationPartitionedLinear: property ModelParameters

What was cross-validated, and how

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class, with
LearnerTemplates naming the backing. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedLinear' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
What was cross-validated, and how



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
ClassificationPartitionedLinear.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 221
ClassificationPartitionedLinear: property NumObservations

Number of observations the partition covers

A positive integer scalar, counting the rows that survived the removal
of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Number of observations the partition covers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedLinear.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 155
ClassificationPartitionedLinear: property Partition

The partition itself

A cvpartition object over the retained observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
The partition itself



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedLinear.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
ClassificationPartitionedLinear: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationPartitionedLinear.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 321
ClassificationPartitionedLinear: property Prior

Prior probability of each class

A numeric row vector summing to one, in the order of
ClassNames . Like the cost it is the parent&rsquo;s and is handed to
every fold, so a fold of an unbalanced problem does not quietly adopt
a prior of its own. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedLinear.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
ClassificationPartitionedLinear: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedLinear.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 460
ClassificationPartitionedLinear: property ScoreTransform

Transformation applied to the predicted scores

A character vector naming a transformation, or the text of the
function handle that was supplied, which may be assigned after the
model is built. It is applied once to the assembled scores and is
not handed to the folds. A transform the learner implies, as
'logistic' implies 'logit' , does stay with the folds,
and this one is then applied on top of it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Transformation applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedLinear.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
ClassificationPartitionedLinear: property Trained

The models fitted to the folds

A cell column with one ClassificationLinear per fold, each
fitted to the observations its fold trains on. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The models fitted to the folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationPartitionedLinear.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 203
ClassificationPartitionedLinear: property W

Observation weights

An Nx1 numeric vector summing to one, normalized within each
class to that class&rsquo;s cost-adjusted prior. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationPartitionedLinear.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
ClassificationPartitionedLinear: property Y

Response of the retained observations

In the type it was supplied in. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Response of the retained observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedLinear.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 384
ClassificationPartitionedLinear: e = kfoldEdge ( obj )
ClassificationPartitionedLinear: e = kfoldEdge (&hellip;, name , value )

Weighted mean of the out-of-fold classification margins.

e = kfoldEdge (&hellip;, name , value ) takes
'Folds' , a subset of the folds to average over, and
'Mode' , either 'average' , the default, or
'individual' , which returns one row per fold instead.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Weighted mean of the out-of-fold classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedLinear.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 435
ClassificationPartitionedLinear: l = kfoldLoss ( obj )
ClassificationPartitionedLinear: l = kfoldLoss (&hellip;, name , value )

Out-of-fold classification loss.

l = kfoldLoss ( obj ) returns the out-of-fold
misclassification rate.

l = kfoldLoss (&hellip;, name , value ) takes
'LossFun' , one of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' and
'quadratic' ; 'Folds' ; and 'Mode' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Out-of-fold classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedLinear.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 319
ClassificationPartitionedLinear: m = kfoldMargin ( obj )

Out-of-fold classification margin of every observation.

The score the out-of-fold model gives the true class, less the score
it gives the other one. An observation no fold held out comes back
NaN . With L regularization strengths m has one
column per strength.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Out-of-fold classification margin of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
ClassificationPartitionedLinear.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 525
ClassificationPartitionedLinear: labels = kfoldPredict ( obj )
ClassificationPartitionedLinear: [ labels , scores ] = kfoldPredict ( obj )

Out-of-fold class of every observation.

Each observation is classified by the fold that held it out, so the
labels are out-of-sample. An observation that no fold held out, which
under a holdout partition is most of them, comes back missing rather
than classified, and its scores come back NaN .

With L regularization strengths labels has one column per
strength and scores is Nx2xL .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Out-of-fold class of every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 407
statistics: ClassificationPartitionedModel

Cross-validated classification model

The ClassificationPartitionedModel class stores cross-validated
classification models trained on different partitions of the data.
It can predict responses for observations not used for training using
the kfoldPredict method.

Create a ClassificationPartitionedModel object by using the
crossval function.

See also:
crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Cross-validated classification model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedModel.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 498
ClassificationPartitionedModel: property BinEdges

Bin edges

A cell array with one entry per predictor, holding that predictor&rsquo;s
bin edges where the learner discretized it before fitting. It is
carried over from the model that was cross validated, and is empty
whenever that model did no binning, which is every learner this package
implements: MATLAB fills it only for its GAM, which bins because it is
built from boosted trees where ours is built from splines.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Bin edges



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
ClassificationPartitionedModel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
ClassificationPartitionedModel: property CategoricalPredictors

Indices of categorical predictors

A vector of positive integers specifying the indices of categorical
predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationPartitionedModel.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
ClassificationPartitionedModel: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
ClassificationPartitionedModel.ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 451
ClassificationPartitionedModel: this = ClassificationPartitionedModel ( Mdl , Partition )

Create a ClassificationPartitionedModel class object for
cross-validation of classification models.

this = ClassificationPartitionedModel ( Mdl ,
Partition ) returns a ClassificationPartitionedModel object, with
Mdl as the trained classification model object and
Partition as the partitioning object obtained using
cvpartition
function.

See also:
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 99
Create a ClassificationPartitionedModel class object for cross-validation of classification models.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationPartitionedModel.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1438
ClassificationPartitionedModel: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

Assigning Cost rebuilds it on every fold in Trained , so
kfoldPredict and kfoldLoss answer under the new costs. It
is refused on a cross-validated ClassificationSVM , whose costs
enter the box constraint while it is being fitted: a model already fitted
under one cost matrix cannot be made to describe another.

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
ClassificationPartitionedModel.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 370
ClassificationPartitionedModel: property CrossValidatedModel

Cross-validated model class

A character vector holding the short name of the learner that was
cross validated, as MATLAB reports it: 'Discriminant' ,
'GAM' , 'KNN' , 'NeuralNetwork' or
'SVM' . It is not the class name of that learner, and the
regression side uses the same names. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Cross-validated model class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationPartitionedModel.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
ClassificationPartitionedModel: property KFold

Number of cross-validated folds

A positive integer value specifying the number of cross-validated folds.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Number of cross-validated folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedModel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1094
ClassificationPartitionedModel: property ModelParameters

Model parameters

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedModel' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Model parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
ClassificationPartitionedModel.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
ClassificationPartitionedModel: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the cross-validated model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationPartitionedModel.NumTrainedPerFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 728
ClassificationPartitionedModel: property NumTrainedPerFold

How many trees each fold fitted

A scalar structure with fields PredictorTrees and
InteractionTrees , each a row with one entry per fold, for a
generalized additive model backing, and empty for every other.

It reports what each fold actually fitted, which the budget in
ModelParameters does not: a phase stops early when it can no
longer improve the fit, and the folds need not stop at the same place.

MATLAB carries this on its per-learner partitioned GAM classes, which
this package deliberately does not have (see crossval ), so like
IsStandardDeviationFit it is declared here for every backing
and left empty where it does not apply.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
How many trees each fold fitted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedModel.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
ClassificationPartitionedModel: property Partition

Partition configuration

A cvpartition object specifying the partition configuration used
for cross-validation. This field stores the cvpartition instance that
describes how the data was split into training and validation sets.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Partition configuration



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationPartitionedModel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 270
ClassificationPartitionedModel: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationPartitionedModel.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 669
ClassificationPartitionedModel: property Prior

Prior probability for each class

A numeric vector specifying the prior probabilities for each class. The
order of the elements in Prior corresponds to the order of the
classes in ClassNames .

It may be assigned only on a cross-validated
ClassificationDiscriminant or ClassificationNaiveBayes ,
the two learners that score from the priors they are given rather than
consuming them while they fit: the discriminant re-derives its
coefficients from them and the naive Bayes weights its class densities
by them. Every other learner cannot revisit them afterwards.
Assigning it rebuilds the priors on every fold in Trained .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedModel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
ClassificationPartitionedModel: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
ClassificationPartitionedModel.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 182
ClassificationPartitionedModel: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationPartitionedModel.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
ClassificationPartitionedModel: property Trained

Models trained on each fold

A cell array of models trained on each fold. Each cell contains a model
trained on the minus-one fold of the data (all but one fold used for
training and the remaining fold used for validation). This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Models trained on each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationPartitionedModel.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClassificationPartitionedModel: property W

Observation weights

A numeric column vector with one entry per observation, carried over
from the model that was cross validated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationPartitionedModel.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
ClassificationPartitionedModel: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationPartitionedModel.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 322
ClassificationPartitionedModel: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedModel.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 898
ClassificationPartitionedModel: e = kfoldEdge ( obj )
ClassificationPartitionedModel: e = kfoldEdge (&hellip;, name , value )

Classification edge of the cross-validated observations.

e = kfoldEdge ( obj ) returns the mean of the
classification margins over every cross-validated observation, which is
the mean of kfoldMargin ( obj ) .

obj must be a ClassificationPartitionedModel object.

e = kfoldEdge (&hellip;, name , value ) accepts
the following Name-Value pairs.

Name Value
'Mode' 'average' , the default, which returns
one number over the observations of every fold asked for, or
'individual' , which returns one number per fold.
'Folds' A vector of fold indices to restrict the
edge to. It defaults to every fold.

The observations of a selection are weighted uniformly and normalized
over that selection, so a subset of folds is an average rather than a
sum, exactly as kfoldLoss does.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Classification edge of the cross-validated observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationPartitionedModel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1104
ClassificationPartitionedModel: L = kfoldLoss ( obj )
ClassificationPartitionedModel: L = kfoldLoss (&hellip;, name , value )

Compute the cross-validated classification loss.

L = kfoldLoss ( obj ) returns the fraction of
observations the folds misclassify, each answered for by the fold&rsquo;s
model that did not see it, which is what kfoldPredict returns.

obj must be a ClassificationPartitionedModel object.

L = kfoldLoss (&hellip;, name , value ) accepts
the following Name-Value pairs.

Name Value
'LossFun' 'classiferror' , the default,
'classifcost' , 'mincost' , or a function handle called
as
lossfun ( C , S , W , Cost ) , where
C is a logical matrix with one true per row marking the true
class, S the scores, W the weights and Cost the
misclassification cost.
'Mode' 'average' , the default, which returns
one number over the observations of every fold asked for, or
'individual' , which returns one number per fold.
'Folds' A vector of fold indices to restrict the
loss to. It defaults to every fold.

See also:
ClassificationPartitionedModel,
ClassificationPartitionedModel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Compute the cross-validated classification loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
ClassificationPartitionedModel.kfoldMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 723
ClassificationPartitionedModel: m = kfoldMargin ( obj )

Classification margins of the cross-validated observations.

m = kfoldMargin ( obj ) returns an Nx1 vector
holding, for every observation, the score its own fold&rsquo;s model gave the
true class less the largest score that model gave any other class. A
larger margin is a more confident correct answer and a negative one is
a misclassification. Every observation is scored by the fold that held
it out, so no model answers for a row it was trained on.

obj must be a ClassificationPartitionedModel object.

Where the fold that held an observation out produced no score for it,
the margin is NaN . This method takes no optional arguments,
as MATLAB&rsquo;s does not.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Classification margins of the cross-validated observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
ClassificationPartitionedModel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2149
ClassificationPartitionedModel: label = kfoldPredict ( this )
ClassificationPartitionedModel: [ label , score , cost ] = kfoldPredict ( this )

Predict responses for observations not used for training in a
cross-validated classification model.

[label, Score, Cost] = kfoldPredict ( this )
returns the predicted class labels, classification scores, and
classification costs for the data used
to train the cross-validated model this .

this is a ClassificationPartitionedModel object.
The function predicts the response for each observation that was
held out during training in the cross-validation process.

An observation that no fold held out is not predicted at all: its
scores and costs are NaN and its label is missing, an empty
character vector for a cell array of strings and NaN for a
numeric response. Under a 'Holdout' partition that is every
observation outside the holdout set. This differs from
MATLAB , which reports NaN scores for those rows as we do but
labels every one of them with the first class, whatever their
response: that label is the least-cost class of a row of NaN
costs rather than a prediction any model made, and naming a class for
an observation nothing scored would be wrong. A logical response has
no missing value to give, so those rows stay false .

Output Description
label Predicted class labels, returned as a
vector or cell array. The type of label matches the type of
Y in the original training data. Each element of label
corresponds to the predicted class
label for the corresponding row in X .
Score Classification scores, returned as a
numeric matrix. Each row of Score corresponds to an observation,
and each column corresponds to a class. The value in row i and
column j is the
classification score for class j for observation i .
Cost Classification costs, returned as a
numeric matrix. Each row of Cost corresponds to an observation,
and each column corresponds to a class. The value in row i
and column j is the classification cost for class j for
observation i . This output is optional and only returned if
requested.

See also:
ClassificationKNN,
ClassificationSVM,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 99
Predict responses for observations not used for training in a cross-validated classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationPartitionedModel.kfoldfun


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 930
ClassificationPartitionedModel: vals = kfoldfun ( obj , fun )

Apply a function to each fold of a cross-validated model.

vals = kfoldfun ( obj , fun ) calls fun once
per fold and returns a K&times;M numeric matrix whose row k is
what fun returned for fold k .

fun is a function handle taking seven inputs and returning a
numeric vector of the same length every time it is called:

testvals = fun ( M , Xtrain , Ytrain , Wtrain , &hellip;
Xtest , Ytest , Wtest )

M is the model the fold was fitted with, taken from
obj .Trained{k} ; Xtrain , Ytrain and
Wtrain are the predictors, response and weights of the
observations that fold was trained on, and Xtest , Ytest and
Wtest those of the observations it held out.

See also:
ClassificationPartitionedModel,
ClassificationPartitionedModel.kfoldPredict,
ClassificationPartitionedModel.kfoldLoss,
ClassificationPartitionedModel.kfoldMargin,
ClassificationPartitionedModel.kfoldEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Apply a function to each fold of a cross-validated model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 709
statistics: ClassificationSVM

Support Vector Machine classification

The ClassificationSVM class implements a Support Vector Machine
classifier object for one-class or two-class problems, which can predict
responses for new data using the predict method.

Support Vector Machine classification is a supervised learning method used
for classification tasks. It works by finding the optimal hyperplane that
separates classes in the feature space with the maximum margin. For
non-linearly separable data, it uses kernel functions to map data to a
higher-dimensional space where separation is possible.

Create a ClassificationSVM object by using the fitcsvm
function or the class constructor.

See also:
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Support Vector Machine classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationSVM.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
ClassificationSVM: property Alpha

Trained classifier coefficients

The coefficients of the trained SVM classifier specified as an s&times;1
numeric vector, where s is the number of support vectors equal to
sum (obj.IsSupportVector) . They are the magnitudes of the dual
coefficients and are never negative; the class each belongs to is given
by the corresponding entry of SupportVectorLabels .
Alpha is populated for every kernel function. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Trained classifier coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationSVM.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 493
ClassificationSVM: property Beta

Linear predictor coefficients

The linear predictor coefficients specified as a p&times;1 numeric
vector, where p is the number of predictors. Beta is
the primal representation of the fitted hyperplane and exists only when
the SVM classifier was trained with a 'linear' kernel function;
for any other kernel there is no such representation and Beta is
empty. It equals
obj.SupportVectors' * (obj.Alpha .* obj.SupportVectorLabels) .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Linear predictor coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationSVM.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 109
ClassificationSVM: property Bias

Bias term

The bias term specified as a scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Bias term



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationSVM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 365
ClassificationSVM: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationSVM.BoxConstraints


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 397
ClassificationSVM: property BoxConstraints

Box constraints

A numeric column vector with one entry per observation, holding the
box constraint the fit applied to it. It is BoxConstraint for
every observation unless Prior or Cost reweighted the
classes, in which case each class is scaled by the weight it carried
into the fit, normalized so the weights average to one. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Box constraints



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationSVM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
ClassificationSVM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationSVM.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
ClassificationSVM: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y , sorted or in the order given by
the 'ClassNames' option. This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationSVM.ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4023
statistics: obj = ClassificationSVM ( X , Y )
statistics: obj = ClassificationSVM (&hellip;, name , value )

Create a ClassificationSVM class object containing a Support
Vector Machine classification model for one-class or two-class problems.

obj = ClassificationSVM ( X , Y ) returns a
ClassificationSVM object, with X as the predictor data and Y
containing the class labels of observations in X .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables. X will be used to train the SVM model.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y can be either
numeric, logical, or cell array of character vectors. It must have same
numbers of rows as X .

obj = ClassificationSVM (&hellip;, name , value )
returns a ClassificationSVM object with parameters specified by the
following name , value paired input arguments:

Name Value
'CategoricalPredictors' The predictors whose values
are levels, as indices, as a logical vector with one element per
predictor, or as 'all' . Each is dummy coded in its place, one
column of zeros and ones per level seen in training, named as in
'x1 == 2' in ExpandedPredictorNames , and the coded columns
are not standardized. An observation holding a level the training data
did not has no score and takes the class of largest prior, as a row
missing a predictor does.
'PredictorNames' A cell array of character
vectors specifying the names of the predictors. The length of this array
must match the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the SVM model. ClassNames are
of the same type as the class labels in Y .
The model keeps the classes in this order; by default they are sorted.
'ScoreTransform' A user-defined function handle
or a character vector specifying one of the following builtin functions
specifying the transformation applied to predicted classification scores.
Supported values include 'doublelogit' , 'invlogit' ,
'ismax' , 'logit' , 'none' , 'identity' ,
'sign' , 'symmetric' , 'symmetricismax' , and
'symmetriclogit' .
'Standardize' A logical scalar specifying whether
to standardize the predictor variables. Default is false .
'SVMtype' A character vector specifying the type
of SVM to use. Supported values are 'c_svc' (C-support vector
classification), 'nu_svc' (nu-support vector classification), and
'one_class_svm' (one-class SVM).
'KernelFunction' A character vector specifying
the kernel function to use. Supported values are 'linear' ,
'rbf' or 'gaussian' , 'polynomial' , and
'sigmoid' .
'PolynomialOrder' A positive integer specifying
the order of the polynomial kernel function. Default is 3.
'KernelScale' A positive scalar specifying the
kernel scale parameter. Default is 1.
'KernelOffset' A non-negative scalar specifying
the kernel offset parameter. Default is 0.
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . Each observation&rsquo;s box constraint is
n times BoxConstraint times its weight, the weights scaled
so that each class carries its prior times the cost of misclassifying it.
An empirical prior sums the weights per class, standardization uses
weighted means and standard deviations, and a row of zero weight is left
out.
'BoxConstraint' A positive scalar specifying the
box constraint parameter. Default is 1.
'Nu' A positive scalar in the range (0,1]
specifying the nu parameter for nu-SVM and one-class SVM. Default is 0.5.
'CacheSize' A positive scalar specifying the
cache size in MB. Default is 1000.
'Tolerance' A positive scalar specifying the
tolerance of termination criterion. Default is 1e-6.
'Shrinking' Either 0 or 1 specifying whether to
use the shrinking heuristics. Default is 1.
'OutlierFraction' A positive scalar in the range
[0,1) specifying the fraction of outliers for one-class SVM.

See also:
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 133
Create a ClassificationSVM class object containing a Support Vector Machine classification model for one-class or two-class problems.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationSVM.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 250
ClassificationSVM: property Cost

Cost of misclassification

A numeric square matrix, where Cost(i,j) is the cost of
classifying an observation of class i as class j . It
defaults to zero on the diagonal and one elsewhere. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationSVM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 262
ClassificationSVM: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
ClassificationSVM.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 360
ClassificationSVM: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationSVM.IsSupportVector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 277
ClassificationSVM: property IsSupportVector

Support vector indicator

An N&times;1 logical vector that flags whether a corresponding
observation in the predictor data matrix is a Support Vector. N
is the number of observations in the training data. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Support vector indicator



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationSVM.KernelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 372
ClassificationSVM: property KernelParameters

Parameters of the kernel function

A structure with fields Function and Scale , and
Order for a polynomial kernel. Function names the
kernel as MATLAB names it, so a radial basis kernel reports
'gaussian' whichever spelling was given; the kernel the fit was
handed is unchanged in ModelParameters . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Parameters of the kernel function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationSVM.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 734
ClassificationSVM: property ModelParameters

SVM training parameters

A structure holding the parameters the fit was given. The engine is
LIBSVM and the record is LIBSVM&rsquo;s, so SVMtype names its
formulation and Tolerance and Shrinking are its own
controls; the parameters MathWorks reports for its SMO and ISDA
solvers are absent, this class running neither.

KernelPolynomialOrder belongs to the polynomial kernel alone
and is empty under every other, as it is in MATLAB.

A structure containing the parameters used to train the SVM model with
the following fields: SVMtype , BoxConstraint ,
CacheSize , KernelScale , KernelOffset ,
KernelFunction , PolynomialOrder , Nu ,
Tolerance , and Shrinking . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
SVM training parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationSVM.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 439
ClassificationSVM: property Mu

Predictor means

A numeric vector of the same length as the columns in X containing
the means of predictor variables. If the predictor variables have not
been standardized, then Mu is empty. This property is read-only.

Only observations with no missing predictor enter the estimate, and
they are weighted so that each class keeps the share of the
observation weight it carried before any row was set aside.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationSVM.Nu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClassificationSVM: property Nu

Nu parameter for one-class learning

A positive scalar, and empty unless the model is a one-class learner,
which is what MATLAB reports. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Nu parameter for one-class learning



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationSVM.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
ClassificationSVM: property NumObservations

Number of observations

A positive integer value specifying the number of observations in the
training dataset used for training the ClassificationSVM model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationSVM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
ClassificationSVM: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationSVM model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationSVM.OutlierFraction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 539
ClassificationSVM: property OutlierFraction

Expected fraction of outliers in the training data

A scalar in [0, 1) , zero unless one was asked for.

Deviation from MATLAB. The value is reported as it was given,
but it reaches the fit by a different route: MATLAB removes outliers
iteratively and reports Solver as 'ISDA' , where a
nonzero fraction here selects LIBSVM&rsquo;s \nu -SVC, in which
\nu bounds the fraction of margin errors. The two agree on what
the number means and not on how the fit reaches it. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Expected fraction of outliers in the training data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationSVM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
ClassificationSVM: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationSVM.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 546
ClassificationSVM: property Prior

Prior probabilities of the classes

A numeric row vector with one entry per class, in the order of
ClassNames , summing to one. It defaults to the class
frequencies of the training data. This property is read-only.

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationSVM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 161
ClassificationSVM: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationSVM.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
ClassificationSVM: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the ClassificationSVM model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationSVM.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 997
ClassificationSVM: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationSVM.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 473
ClassificationSVM: property Sigma

Predictor standard deviations

A numeric vector of the same length as the columns in X containing
the standard deviations of predictor variables. If the predictor
variables have not been standardized, then Sigma is empty.
This property is read-only.

Only observations with no missing predictor enter the estimate, and
they are weighted so that each class keeps the share of the
observation weight it carried before any row was set aside.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationSVM.SupportVectorLabels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 500
ClassificationSVM: property SupportVectorLabels

Support vector class labels

The support vector class labels specified as an s&times;1 numeric
vector, where s is the number of support vectors equal to
sum (obj.IsSupportVector) . A value of +1 in
SupportVectorLabels indicates that the corresponding support
vector
belongs to the positive class (ClassNames{2}) . A value of -1
indicates that the corresponding support vector belongs to the negative
class (ClassNames{1}) . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Support vector class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationSVM.SupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 321
ClassificationSVM: property SupportVectors

Support vectors

The support vectors of the trained SVM classifier specified an s&times;p
numeric matrix, where s is the number of support vectors equal to
sum (obj.IsSupportVector) , and p is the number of
predictor
variables in the predictor data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Support vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationSVM.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 320
ClassificationSVM: property W

Observation weights

A numeric column vector with one entry per training observation,
normalized to sum to one, as MATLAB reports it. This property is
read-only.

Each class carries its prior, spread over its own observations in
proportion to the 'Weights' given, or evenly when none were.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationSVM.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
ClassificationSVM: property X

Predictor data

A numeric matrix containing the unstandardized predictor data. Each
column of X represents one predictor (variable), and each row
represents one observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
ClassificationSVM.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
ClassificationSVM: property Y

Class labels

Specified as a logical or numeric column vector, or as a character array
or a cell array of character vectors with the same number of rows as the
predictor data. Each row in Y is the observed class label for
the corresponding row in X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationSVM.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
ClassificationSVM: CVMdl = compact ( obj )

Create a CompactClassificationSVM object.

CVMdl = compact ( obj ) creates a compact version of the
ClassificationSVM object, obj .

See also:
fitcsvm,
ClassificationSVM,
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create a CompactClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationSVM.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1057
ClassificationSVM: CVMdl = crossval ( obj )
ClassificationSVM: CVMdl = crossval (&hellip;, name , value )

Cross Validate a Support Vector Machine classification object.

CVMdl = crossval ( obj ) returns a cross-validated model
object, CVMdl , from a trained model, obj , using 10-fold
cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv , where
isa ( cv , "cvpartition") = 1.

See also:
fitcsvm,
ClassificationSVM,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Cross Validate a Support Vector Machine classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
ClassificationSVM.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 625
ClassificationSVM: obj = discardSupportVectors ( obj )

Discard the support vectors of a linear SVM model.

obj = discardSupportVectors ( obj ) empties
Alpha , SupportVectors and
SupportVectorLabels , leaving Beta and Bias to
decide every prediction. A linear kernel needs nothing else, so the
returned model predicts what it predicted before while carrying one
vector in place of many.

The kernel must be linear. Under any other the support vectors are
part of the decision function and cannot be dropped. Discarding twice
is not an error and changes nothing.

See also:
fitcsvm,
ClassificationSVM,
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Discard the support vectors of a linear SVM model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationSVM.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 599
ClassificationSVM: e = edge ( obj , X , Y )
ClassificationSVM: e = edge (&hellip;, "Weights" , w )

Classification edge, the mean of the classification margins.

e = edge ( obj , X , Y ) reduces the vector
that margin returns to a single number, the mean margin over the
rows of X . It says how far the model puts the true class ahead of
its nearest rival on average, so a larger edge is a better model, and
unlike a loss it is not bounded above and rewards confidence rather than
bare correctness.

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge, the mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
ClassificationSVM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1890
ClassificationSVM: L = loss ( obj , X , Y )
ClassificationSVM: L = loss (&hellip;, name , value )

Compute loss for a trained ClassificationSVM object.

L = loss ( obj , X , Y ) computes the loss,
L , using the default loss function 'classiferror' .

obj is a ClassificationSVM object trained on
X and Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

L = loss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Compute loss for a trained ClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationSVM.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 814
ClassificationSVM: m = margin ( obj , X , Y )

Classification margins for Support Vector Machine classifier.

m = margin ( obj , X , Y ) returns
the classification margins for obj with data X and
classification Y . m is a numeric vector of length size (X,1).

obj is a ClassificationSVM object trained on X
and Y .

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

The classification margin for each observation is the difference between
the classification score for the true class and the maximal
classification score for the false classes.

See also:
fitcsvm,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margins for Support Vector Machine classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationSVM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1698
ClassificationSVM: label = predict ( obj , XC )
ClassificationSVM: [ label , score ] = predict ( obj , XC )
ClassificationSVM: [ label , score , cost ] = predict ( obj , XC )

Classify new data points into categories using the Support Vector Machine
classification model from a ClassificationSVM object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
predictor data in obj.X and corresponding labels, obj.Y ,
stored in the ClassificationSVM model, obj . For one-class SVM
model, +1 or -1 is returned.

obj must be a ClassificationSVM class object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the SVM model in
obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the decision values for each
prediction. A ScoreTransform assigned to obj is applied
to them, so score holds whatever that transform returns. Posterior
probabilities need a transform fitted to the model, which this package
does not compute yet.

Deviation from MATLAB. cost is the expected cost of
each assignment, sum_j P(j) Cost(j,k) . An SVM score is a
signed distance to the boundary and not a posterior, so the only
distribution available is the one concentrated on the predicted class
and cost is the row of Cost belonging to it. MATLAB
returns the column instead, which is the same matrix read the
wrong way and contradicts its own ClassificationKNN ,
ClassificationDiscriminant and ClassificationNaiveBayes
on any asymmetric cost matrix; the two agree wherever Cost is
symmetric, the default included. Measured on R2024a.

See also:
ClassificationSVM,
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
Classify new data points into categories using the Support Vector Machine classification model from a ClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationSVM.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 210
ClassificationSVM: e = resubEdge ( obj )

Classification edge of the model on its own training data.

e = resubEdge ( obj ) is edge applied to the
observations the model was fitted on, the mean of resubMargin .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Classification edge of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationSVM.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1640
ClassificationSVM: L = resubLoss ( obj )
ClassificationSVM: L = resubLoss (&hellip;, name , value )

Compute resubstitution loss for a trained ClassificationSVM object.

L = resubLoss ( obj ) computes the resubstitution loss,
L , using the default loss function 'classiferror' .

obj is a ClassificationSVM object trained on
X and Y .

L = resubLoss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
Compute resubstitution loss for a trained ClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationSVM.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
ClassificationSVM: m = resubMargin ( obj )

Classification margins of the model on its own training data.

m = resubMargin ( obj ) is margin applied to the
observations the model was fitted on, one number per observation. Being
a resubstitution quantity it is optimistic by construction.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margins of the model on its own training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationSVM.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1540
ClassificationSVM: label = resubPredict ( obj )
ClassificationSVM: [ label , score ] = resubPredict ( obj )
ClassificationSVM: [ label , score , cost ] = resubPredict ( obj )

Classify the training data using the trained Support Vector Machine
classification object.

label = resubPredict ( obj ) returns the vector of
labels predicted for the corresponding instances in the training data,
using the predictor data in obj.X and corresponding labels,
obj.Y , stored in the Support Vector Machine classification model,
obj . For one-class model, +1 or -1 is returned.

obj must be a ClassificationSVM class object.

[ label , scores ] = resubPredict ( obj also
returns scores , which contains the decision values for each
prediction. A ScoreTransform assigned to obj is applied
to them, so scores holds whatever that transform returns. Posterior
probabilities need a transform fitted to the model, which this package
does not compute yet.

Deviation from MATLAB. cost is the expected cost of
each assignment, sum_j P(j) Cost(j,k) . An SVM score is a
signed distance to the boundary and not a posterior, so the only
distribution available is the one concentrated on the predicted class
and cost is the row of Cost belonging to it. MATLAB
returns the column instead, which is the same matrix read the
wrong way and contradicts its own ClassificationKNN ,
ClassificationDiscriminant and ClassificationNaiveBayes
on any asymmetric cost matrix; the two agree wherever Cost is
symmetric, the default included. Measured on R2024a.

See also:
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
Classify the training data using the trained Support Vector Machine classification object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationSVM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 472
ClassificationSVM: savemodel ( obj , filename )

Save a ClassificationSVM object.

savemodel ( obj , filename ) saves each property of a
ClassificationSVM object into an Octave binary file, the name of which is
specified in filename , along with an extra variable, which defines
the type classification object these variables constitute. Use
loadmodel in order to load a classification object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitcsvm,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Save a ClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
ClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1632
statistics: ClassificationTree

Binary decision tree for classification

The ClassificationTree class implements a CART binary decision
tree. Growth splits each node on the single predictor and cut point
that lower the impurity of the response the most, and stops when a node
is pure, too small to be a parent, or has no split leaving enough
observations on both sides. The grown tree is then optionally reduced,
first by merging the leaves that buy no accuracy and then by cost
complexity pruning, which orders the branch nodes by how little risk
their subtrees remove and records that order so a subtree of any size
can be recovered afterwards with prune .

Create a ClassificationTree object by using the fitctree
function or the class constructor.

The fit is carried out by the compiled engine treetrain and
predictions by treepredict , which the regression tree shares.

An observation missing the predictor a node cuts on descends to neither
child. It is counted in that node and in every node above it, and
predict stops it there and gives it that node&rsquo;s answer, so a row
is never sent down a branch on evidence it does not carry.

A categorical predictor is split into two sets of levels, and an
observation whose level a node did not see stops there, as one missing
the predictor does.

What this class does not do yet. Surrogate splits and the
'twoing' split criterion are not implemented, and an option
asking for one of them is refused rather than quietly ignored. The six
Surrogate properties are therefore always empty, as they are in
MATLAB without surrogate splits.

See also:
fitctree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Binary decision tree for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
ClassificationTree: property BinEdges

Bin edges of the predictors

A cell array with one column vector of bin edges per predictor, empty
unless the predictors were binned before fitting. Binning is not
implemented, so this is always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationTree.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
ClassificationTree: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices into X , naming the predictors
treated as categorical, empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationTree.CategoricalSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
ClassificationTree: property CategoricalSplit

Categorical splits of the tree

A Nx2 cell array with one row per categorical split, in node
order, holding the levels sent left and the levels sent right. It is
empty when no split is categorical. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categorical splits of the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.Children


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
ClassificationTree: property Children

Child nodes of each node

A NumNodesx2 matrix naming the left and the right child of each
node. A leaf carries a zero in both columns. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Child nodes of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationTree.ClassCount


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 251
ClassificationTree: property ClassCount

Class counts at each node

A NumNodesxK matrix holding how many training observations of
each class reached each node. These are counts and take no notice of
the observation weights. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Class counts at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationTree.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
ClassificationTree: property ClassNames

Names of the classes

The distinct class labels, in the type the response was given in,
sorted or in the order given by the 'ClassNames' option. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationTree.ClassProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 294
ClassificationTree: property ClassProbability

Class probabilities at each node

A NumNodesxK matrix holding, for each node, the weight of each
class among the observations that reached it, as a proportion of the
node&rsquo;s total weight. The root row is the prior. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Class probabilities at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
ClassificationTree.ClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3525
ClassificationTree: obj = ClassificationTree ( X , Y )
ClassificationTree: obj = ClassificationTree (&hellip;, name , value )

Grow a binary decision tree for classification.

obj = ClassificationTree ( X , Y ) grows a tree
on the NxP numeric matrix X of predictor data and the
Nx1 response Y , and returns it as a
ClassificationTree object. Y may be a numeric or logical
vector, a character array, or a cell array of character vectors, and
the class names come back in the type it was given in.

obj = ClassificationTree (&hellip;, name ,
value ) takes the options below.

Name Value
'AlgorithmForCategorical' How a node with three or
more classes splits a categorical predictor: 'exact' ,
'pullleft' , 'pca' or 'ovabyclass' . By default
the exact search is taken when the node holds at most
'MaxNumCategories' levels, and otherwise the best split of
'ovabyclass' , 'pca' and 'pullleft' , leaving
'ovabyclass' out above four classes.
'CategoricalPredictors' The predictors whose values
are levels, as indices, as a logical vector with one element per
predictor, or as 'all' .
'ClassNames' The classes to fit, of the same type
as Y . Observations of any other class are dropped. The model
keeps the classes in this order; by default they are sorted.
'Cost' A square matrix with one row and column per
class, where element (i,j) is the cost of classifying an
observation of class i into class j , or a structure with
fields ClassNames and ClassificationCosts . The
default is 1 - eye (K) .
'MaxNumCategories' A nonnegative integer, the most
levels a node with three or more classes searches exactly by default.
The default is 10.
'MaxNumSplits' A nonnegative integer, the largest
number of branch nodes the tree may take. The default is one less
than the number of observations, which is as many as a tree can have.
'MergeLeaves' 'on' (default) or
'off' . When on, a pair of leaves whose parent is no worse
than the two of them together is merged back into that parent.
'MinLeafSize' A positive integer, the fewest
observations a leaf may hold. The default is 1. A split leaving
fewer than this on either side is not taken.
'MinParentSize' A positive integer, the fewest
observations a node must hold to be split at all. The default is 10.
The value the fit uses is max (MinParentSize, 2 * MinLeafSize) ,
since a smaller node cannot give both children a legal leaf.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'Prior' 'empirical' (default),
'uniform' , a numeric vector with one element per class, or a
structure with fields ClassNames and
ClassProbs .
'Prune' 'on' (default) or 'off' .
When on, the cost complexity pruning sequence is estimated and
reported in PruneList and PruneAlpha . The tree returned
is the unpruned one either way; prune takes a subtree out of
the sequence.
'PruneCriterion' 'error' , the only
criterion implemented.
'ResponseName' A character vector naming the
response. The default is 'Y' .
'ScoreTransform' A character vector naming a
transform to apply to the scores, or a function handle. The default
is 'none' .
'SplitCriterion' 'gdi' (default), the Gini
diversity index, or 'deviance' , the cross entropy.
'Weights' A nonnegative numeric vector with one
element per observation. The default is uniform.

On a node with three or more classes and more than
'MaxNumCategories' levels, the heuristic splits, the choice
between equally good partitions and which side each set of levels
takes may differ from MATLAB&rsquo;s.

See also:
fitctree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Grow a binary decision tree for classification.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationTree.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 462
ClassificationTree: property Cost

Misclassification cost

A square numeric matrix with one row and column per class, where
Cost(i,j) is the cost of classifying an observation of class
i into class j . It defaults to 1 - eye (K) and may
be reassigned after fitting.

Reassigning it re-derives NodeClass , NodeError and
NodeRisk , and changes what predict answers. The shape
of the tree does not follow, having been decided by the cost in force
when it was grown.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Misclassification cost



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClassificationTree.CutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 258
ClassificationTree: property CutCategories

Categories used at each branch

A NumNodesx2 cell array holding, for a node that cuts a
categorical predictor, the levels sent left and the levels sent right.
Every other entry is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categories used at each branch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.CutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
ClassificationTree: property CutPoint

Cut point of each node

A column vector holding, for each node, the value the split compares
the predictor against: an observation goes left when its value is less
than the cut point and right otherwise. A leaf and a categorical cut
carry NaN .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Cut point of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationTree.CutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
ClassificationTree: property CutPredictor

Name of the predictor each node cuts on

A cell array of character vectors with one entry per node, holding the
name of the predictor the node splits on and an empty character vector
at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Name of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationTree.CutPredictorIndex


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
ClassificationTree: property CutPredictorIndex

Index of the predictor each node cuts on

A column vector holding, for each node, the column of X the node
splits on, and zero at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Index of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationTree.CutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 296
ClassificationTree: property CutType

Type of cut at each node

A cell array of character vectors holding 'continuous' at a
branch node that cuts a numeric predictor at a point,
'categorical' at one that splits a set of levels, and an empty
character vector at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Type of cut at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationTree.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 310
ClassificationTree: property ExpandedPredictorNames

Expanded predictor names

A cell array of character vectors. It differs from
PredictorNames only when a categorical predictor has been
expanded into one column per level, which this class does not do, so
the two are always equal. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Expanded predictor names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
ClassificationTree.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
ClassificationTree: property HyperparameterOptimizationResults

Results of a hyperparameter optimization

Hyperparameter optimization is not implemented, so this is always
empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Results of a hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationTree.IsBranchNode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 190
ClassificationTree: property IsBranchNode

Which nodes are branch nodes

A logical column vector, true for each node that carries a split and
false for each leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Which nodes are branch nodes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationTree.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 484
ClassificationTree: property ModelParameters

Parameters the fit was run with

A structure recording the options the tree was grown under:
SplitCriterion , MinParent , MinLeaf ,
MaxSplits , NVarToSample , MergeLeaves ,
Prune , PruneCriterion , QEToler ,
NSurrogate , MaxCat , AlgCat ,
PredictorSelection , Method and Type .

MinParent is the value the fit used, which is
max (MinParentSize, 2 * MinLeafSize) and so may exceed the
'MinParentSize' asked for. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Parameters the fit was run with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.NodeClass


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 360
ClassificationTree: property NodeClass

Class assigned to each node

A cell array of character vectors naming, for each node, the class of
least expected misclassification cost given the node&rsquo;s class
probabilities. Under the default cost that is simply the most
probable class, with the first of the class names kept on a tie. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Class assigned to each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.NodeError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 340
ClassificationTree: property NodeError

Misclassification cost of each node

A column vector holding, for each node, the expected misclassification
cost of the class the node is assigned. Under the default cost that
is the probability that the node&rsquo;s class is wrong, one less the
largest class probability. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Misclassification cost of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationTree.NodeProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 255
ClassificationTree: property NodeProbability

Probability of reaching each node

A column vector holding, for each node, the total weight of the
observations that reached it, the weights being those in W .
The root carries one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Probability of reaching each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 486
ClassificationTree: property NodeRisk

Risk of each node

A column vector holding, for each node, the impurity of the node
weighted by the probability of reaching it, measured by whichever of
'gdi' and 'deviance' the tree was grown under.

A non-default Cost enters here rather than through the class
probabilities: the weights are scaled class by class by the total cost
of misclassifying that class, and the impurity is measured on the
scaled distribution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Risk of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.NodeSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 344
ClassificationTree: property NodeSize

Number of observations at each node

A column vector holding how many training observations reached each
node. A row missing the predictor its node cuts on is counted at that
node and at none below it, so a parent&rsquo;s size is not in general the
sum of its children&rsquo;s. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Number of observations at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.NumNodes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 296
ClassificationTree: property NumNodes

Number of nodes in the tree

A positive integer, the number of nodes the tree holds, branch nodes
and leaves together. Nodes are numbered as they are created, so a
parent always carries a lower number than either of its children.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of nodes in the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
ClassificationTree.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 274
ClassificationTree: property NumObservations

Number of observations

A positive integer, the number of observations the model was fitted
on. It counts the rows kept, so it is smaller than the number of rows
given whenever a response was missing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationTree.Parent


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 158
ClassificationTree: property Parent

Parent of each node

A column vector naming the parent of each node. The root carries a
zero. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Parent of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationTree.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClassificationTree: property PredictorNames

Names of the predictor variables

A cell array of character vectors with one name per column of
X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationTree.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 506
ClassificationTree: property Prior

Prior probability of each class

A numeric row vector with one element per class, summing to one. It
defaults to the weight each class carries in the training data, and
may be reassigned after fitting.

Reassigning it re-derives W and every node statistic that
depends on the class weights, so ClassProbability ,
NodeProbability , NodeClass , NodeError and
NodeRisk all follow. The shape of the tree does not, having
been decided by the prior in force when it was grown.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
ClassificationTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
ClassificationTree: property PruneAlpha

Cost complexity parameter of each pruning level

A column vector with one element per level of the pruning sequence,
the first of which is zero and stands for the unpruned tree. Level
L is the smallest subtree that is optimal for every complexity
parameter from PruneAlpha( L +1) up to the next one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Cost complexity parameter of each pruning level



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.PruneList


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 438
ClassificationTree: property PruneList

Pruning level of each node

A column vector holding, for each branch node, the level of the cost
complexity sequence at which it stops being a branch node, and zero at
a leaf. Pruning the tree to level L turns every node whose
level is between one and L into a leaf. It is empty when
neither 'Prune' nor 'MergeLeaves' was asked for, since
no sequence was then estimated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Pruning level of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationTree.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClassificationTree: property ResponseName

Name of the response variable

A character vector naming the response. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 390
ClassificationTree: property RowsUsed

Rows used for fitting

A logical column vector with one element per row of the predictor data
as it was given, true for each row used for fitting. It is empty,
[] , when every row was used, so a non-empty value means that
rows were dropped. Only a missing response drops a row; a row missing
some of its predictors is kept. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClassificationTree.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
ClassificationTree: property ScoreTransform

Transform applied to the scores

A character vector naming the function predict applies to the
class probabilities before returning them, or a function handle. The
default is 'none' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Transform applied to the scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
ClassificationTree.SurrogateCutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
ClassificationTree: property SurrogateCutCategories

Categories of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Categories of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationTree.SurrogateCutFlip


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
ClassificationTree: property SurrogateCutFlip

Cut assignments of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cut assignments of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationTree.SurrogateCutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
ClassificationTree: property SurrogateCutPoint

Cut points of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Cut points of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
ClassificationTree.SurrogateCutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
ClassificationTree: property SurrogateCutPredictor

Predictors of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Predictors of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClassificationTree.SurrogateCutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
ClassificationTree: property SurrogateCutType

Types of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Types of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
ClassificationTree.SurrogatePredictorAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 210
ClassificationTree: property SurrogatePredictorAssociation

Predictive measures of association of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predictive measures of association of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationTree.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 315
ClassificationTree: property W

Observation weights

A numeric column vector of the weights the fit used, one per retained
observation. They are the weights given, scaled so that the
observations of each class sum to that class&rsquo;s prior, and so that all
of them together sum to one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationTree.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 203
ClassificationTree: property X

Predictor data

A numeric matrix holding the predictor data the model was fitted on.
Each column is one predictor and each row one observation. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
ClassificationTree.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 247
ClassificationTree: property Y

Class labels

A logical or numeric column vector, a character array, or a cell array
of character vectors with one row per row of X , holding the
observed class label of each observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
Class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationTree.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 384
ClassificationTree: CMdl = compact ( obj )

Drop the training data from a trained model.

CMdl = compact ( obj ) returns a
CompactClassificationTree object carrying the tree and
everything predict needs, but not the observations the model
was fitted on. It classifies new data identically and is far smaller
to keep or to ship.

See also:
CompactClassificationTree,
ClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Drop the training data from a trained model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClassificationTree.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1051
ClassificationTree: CVMdl = crossval ( obj )
ClassificationTree: CVMdl = crossval (&hellip;, name , value )

Cross-validate a trained decision tree.

CVMdl = crossval ( obj ) partitions the training data
into ten folds, or into as many folds as there are observations when
there are fewer than ten, grows a tree on the training part of each
and returns them as a ClassificationPartitionedModel .

CVMdl = crossval (&hellip;, name , value ) takes
one of the following, and one only.

Name Value
'KFold' An integer greater than 1, the number of
folds.
'Holdout' A value between 0 and 1, the fraction of
the data held out for testing, which gives a single fold.
'Leaveout' 'on' or 'off' , one fold
per observation.
'CVPartition' A cvpartition object.

Every fold is grown with the parent&rsquo;s class names, prior, cost and
observation weights rather than being left to re-derive them from its
own rows, so a fold reports the prior of the whole data and not its own
frequencies.

See also:
ClassificationPartitionedModel,
ClassificationTree,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cross-validate a trained decision tree.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationTree.cvloss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2178
ClassificationTree: E = cvloss ( obj )
ClassificationTree: [ E , SE , Nleaf , BestLevel ] = cvloss ( obj )
ClassificationTree: [&hellip;] = cvloss (&hellip;, name , value )

Cross-validated loss of a tree and of its subtrees.

E = cvloss ( obj ) partitions the training data into
ten stratified folds, grows a tree on the training part of each, and
returns the loss of the held-out part.

[ E , SE , Nleaf , BestLevel ] = cvloss
(&hellip;) also returns SE , the standard error of E over
the folds, Nleaf , the number of leaves each subtree holds, and
BestLevel , the pruning level chosen by 'TreeSize' . Each
has one element per subtree asked for.

[&hellip;] = cvloss (&hellip;, name , value ) takes the
options below.

Name Value
'SubTrees' A vector of pruning levels in ascending
order, or 'all' for every level of the sequence. The default
is 0, the unpruned tree.
'TreeSize' 'se' (default), the smallest
subtree whose loss is within one standard error of the smallest loss,
or 'min' , the smallest subtree of least loss.
'KFold' An integer greater than 1, the number of
folds. The default is 10. A value above the number of observations
is reduced to it.

A fold&rsquo;s tree is pruned to the level its own sequence gives for the
geometric mean of the parent&rsquo;s two neighbouring complexity parameters,
which is the classical way a fold is matched to a subtree of the whole
tree. The last level takes every fold&rsquo;s tree back to its root.

Every fold is grown with the parent&rsquo;s class names, prior, cost and
observation weights, and the loss is weighed by the model&rsquo;s own
weights.

The standard error is not MATLAB&rsquo;s. This is the standard
error of the loss over the folds, which is what the name means and
which is zero when every fold answers alike, as MATLAB&rsquo;s is. Its
value is not MATLAB&rsquo;s: on the iris tree MATLAB reports 0.019956 where
the folds give 0.024343, and no formula over the fold losses, the
observation losses or the loss itself reproduces MATLAB&rsquo;s number.
E , Nleaf and BestLevel are measured and match.

See also:
ClassificationTree,
ClassificationTree.prune,
ClassificationTree.crossval,
ClassificationTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Cross-validated loss of a tree and of its subtrees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationTree.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 486
ClassificationTree: e = edge ( obj , X , Y )
ClassificationTree: e = edge (&hellip;, 'Weights' , w )

Classification edge on new data.

e = edge ( obj , X , Y ) returns the
weighted mean of the margins, a single number summarising how
confidently the model classifies the data.

The weights are normalized within each class to that class&rsquo;s prior
before they are applied.

See also:
ClassificationTree,
ClassificationTree.margin,
ClassificationTree.loss,
ClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification edge on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 609
ClassificationTree: l = loss ( obj , X , Y )
ClassificationTree: l = loss (&hellip;, name , value )

Classification loss on new data.

l = loss ( obj , X , Y ) returns the
minimum expected misclassification cost.

l = loss (&hellip;, name , value ) takes the
following options.

Name Value
'LossFun' One of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' (default) or
'quadratic' .
'Weights' A numeric vector of observation weights,
one per row of X .

See also:
ClassificationTree,
ClassificationTree.margin,
ClassificationTree.edge,
ClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClassificationTree.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 488
ClassificationTree: m = margin ( obj , X , Y )

Classification margin on new data.

m = margin ( obj , X , Y ) returns one
margin per observation: the score the model gives the observation&rsquo;s
true class, less the largest score it gives any other class. A
positive margin means the observation is classified correctly, and a
larger one means it is classified more confidently.

See also:
ClassificationTree,
ClassificationTree.edge,
ClassificationTree.loss,
ClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Classification margin on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
ClassificationTree.nodeVariableRange


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 492
ClassificationTree: r = nodeVariableRange ( obj , node )

Range of each predictor at a node.

r = nodeVariableRange ( obj , node ) returns a
structure with one field per predictor the path from the root to
node cuts on, holding the two-element range of values that reach
the node, or for a categorical predictor the levels that reach it. A
predictor the path never cuts on is unconstrained and is left out, so
the root gives a structure with no fields.

See also:
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Range of each predictor at a node.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
ClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1214
ClassificationTree: label = predict ( obj , XC )
ClassificationTree: [ label , score ] = predict (&hellip;)
ClassificationTree: [ label , score , node ] = predict (&hellip;)
ClassificationTree: [ label , score , node , cnum ] = predict (&hellip;)

Classify new data with a trained ClassificationTree object.

label = predict ( obj , XC ) sends each row of
XC down the tree and returns the class of the node it comes to
rest at. XC must have as many columns as the predictor data the
model was fitted on.

[ label , score ] = predict (&hellip;) also returns
score , an NxK matrix holding the class probabilities of
the node each row landed in, after ScoreTransform .

[ label , score , node ] = predict (&hellip;) also
returns the number of the node each row landed in, and
[ label , score , node , cnum ] = predict
(&hellip;) the index of the predicted class into ClassNames .

The label is the class of least expected misclassification cost, which
under the default Cost is the most probable class of the node.

A row missing the predictor a node cuts on is stopped at that node and
takes its answer, rather than being sent down a branch on evidence the
row does not carry.

See also:
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Classify new data with a trained ClassificationTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
ClassificationTree.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 697
ClassificationTree: imp = predictorImportance ( obj )

Estimate the importance of each predictor.

imp = predictorImportance ( obj ) returns a row
vector with one element per predictor, holding the total drop in risk
the splits on that predictor bring about, divided by the number of
branch nodes. A predictor the tree never splits on scores zero.

The drop at a branch node is its NodeRisk less the risk of its
two children and less what it holds back, so a predictor that is
chosen often, high up, and on nodes it separates well, scores
highest. The numbers are comparable
between predictors of one tree and not between trees.

See also:
ClassificationTree,
fitctree,
ClassificationTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClassificationTree.prune


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1163
ClassificationTree: obj2 = prune ( obj )
ClassificationTree: obj2 = prune ( obj , 'Level' , L )
ClassificationTree: obj2 = prune ( obj , 'Alpha' , A )
ClassificationTree: obj2 = prune ( obj , 'Nodes' , N )

Take a subtree out of the pruning sequence.

obj2 = prune ( obj ) returns the tree unchanged.

obj2 = prune ( obj , 'Level' , L ) turns
every branch node whose PruneList level is between one and
L into a leaf and discards everything below it. Level zero is
the tree itself and the largest level is the root alone. A level
above the largest prunes to the root and warns.

obj2 = prune ( obj , 'Alpha' , A ) prunes
to the smallest subtree that is optimal for the cost complexity
parameter A , which is the largest level whose PruneAlpha
does not exceed it.

obj2 = prune ( obj , 'Nodes' , N ) turns
the branch nodes named in N into leaves, along with everything
below them, and leaves the rest of the tree alone.

Pruning renumbers the nodes, so the properties of the returned tree
are those of a tree of that shape and not a subset of the original&rsquo;s.

See also:
ClassificationTree,
fitctree,
ClassificationTree.PruneList,
ClassificationTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Take a subtree out of the pruning sequence.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.resubEdge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 225
ClassificationTree: e = resubEdge ( obj )

Classification edge on the training data.

e = resubEdge ( obj ) is edge over the
training data, weighed as the fit weighed it.

See also:
ClassificationTree,
ClassificationTree.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification edge on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 430
ClassificationTree: l = resubLoss ( obj )
ClassificationTree: l = resubLoss (&hellip;, name , value )

Classification loss on the training data.

l = resubLoss ( obj ) is loss over the
training data, weighed as the fit weighed it, and takes the same
'LossFun' option. Giving 'Weights' weighs the
training data some other way instead, which MATLAB refuses rather
than honours.

See also:
ClassificationTree,
ClassificationTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Classification loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClassificationTree.resubMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
ClassificationTree: m = resubMargin ( obj )

Classification margin on the training data.

m = resubMargin ( obj ) is
margin ( obj , obj .X, obj .Y) .

See also:
ClassificationTree,
ClassificationTree.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Classification margin on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
ClassificationTree.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 325
ClassificationTree: label = resubPredict ( obj )
ClassificationTree: [ label , score , node , cnum ] = resubPredict ( obj )

Classify the training data with the model fitted to it.

label = resubPredict ( obj ) is
predict ( obj , obj .X) , and takes the same outputs.

See also:
ClassificationTree,
ClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Classify the training data with the model fitted to it.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
ClassificationTree.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 489
ClassificationTree: savemodel ( obj , filename )

Save a ClassificationTree model to a file.

savemodel ( obj , filename ) saves each property of a
ClassificationTree object into an Octave binary file, the name of
which is specified in filename , along with an extra variable,
which defines the type of classification object these variables
constitute. Use loadmodel in order to load a classification
object into Octave&rsquo;s workspace.

See also:
loadmodel,
fitctree,
ClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Save a ClassificationTree model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
ClassificationTree.view


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 405
ClassificationTree: view ( obj )

Print the tree as text.

view ( obj ) prints one line per node: a branch node names
the predictor it cuts on, the cut point, and the node each side leads
to, and a leaf names the class it assigns. A branch node&rsquo;s line ends
with the class it would assign itself, which is the answer an
observation missing that predictor gets.

See also:
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Print the tree as text.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1664
statistics: CompactClassificationDiscriminant

Compact discriminant analysis classification

The CompactClassificationDiscriminant class implements a compact
version of a linear discriminant analysis classifier object, which can
predict responses for new data using the predict method but does not
store the training data.

A CompactClassificationDiscriminant object is a compact version of a
discriminant analysis model, ClassificationDiscriminant . It does
not include the training data resulting in a smaller classifier size, which
can be used for making predictions from new data, but not for tasks such as
cross validation. It can only be created from a
ClassificationDiscriminant model by using the compact object
method.

Create a CompactClassificationDiscriminant object by using the
compact method of a ClassificationDiscriminant object.

Six discriminant types are available, in two families. The linear family,
'linear' , 'diagLinear' and 'pseudoLinear' , pools
one covariance across the classes and separates them with a hyperplane.
The quadratic family, 'quadratic' , 'diagQuadratic' and
'pseudoQuadratic' , estimates a covariance per class and separates
them with a quadric. A 'diag' type keeps only the variances,
which is the same model as a Gamma of 1, and a 'pseudo'
type inverts a singular covariance rather than refusing it.

DiscrimType may be assigned after fitting, but only within
its own family : the family is fixed when the model is fitted, because it
decides which covariances the fit has to estimate. Assigning it, or
Gamma , re-derives Sigma , LogDetSigma and
Coeffs without refitting.

See also:
fitcdiscr,
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Compact discriminant analysis classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationDiscriminant.BetweenSigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 757
CompactClassificationDiscriminant: property BetweenSigma

Between-class covariance matrix

A P -by- P matrix holding the covariance of the class means
about the overall mean, weighted by how many observations each class
contributes. With n_k observations in class k ,
p_k = n_k / n and \bar{\mu} = \sum_k p_k \mu_k , it is

BetweenSigma = sum_k n_k (Mu(k,:) - mubar)' * (Mu(k,:) - mubar)
/ (n * (1 - sum_k p_k^2))

The denominator is the unbiased one for a weighted covariance, so a
balanced fit divides by n (K-1) / K . It reads the class
sizes , not Prior : assigning a prior leaves it where it was. It
is estimated for every discriminant type, the quadratic family included,
since it describes the classes rather than the fit. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Between-class covariance matrix



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
CompactClassificationDiscriminant.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
CompactClassificationDiscriminant: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationDiscriminant.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 361
CompactClassificationDiscriminant: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y . This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationDiscriminant.Coeffs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 849
CompactClassificationDiscriminant: property Coeffs

Coefficient matrices

A K&times;K structure containing the coefficient matrices, where
K is the number of classes. If the 'FillCoeffs' parameter
was set to 'off' in the original
ClassificationDiscriminant model, then Coeffs is empty
([]) . This property is read-only.

Coeffs(i,j) contains the coefficients of the boundary between
the classes i and j in the following fields:

DiscrimType - A character vector
Class1 - ClassNames (i)
Class2 - ClassNames (j)
Const - A scalar
Linear - A vector with length as the number of predictors.
Quadratic - The quadratic family only. A PxP
matrix, or a 1xP vector for 'diagQuadratic' , following
the shape of Sigma .

The diagonal entries carry the two class names and nothing else. The
structure is rebuilt whenever DiscrimType , Gamma or
Prior is assigned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Coefficient matrices



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
CompactClassificationDiscriminant.CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 483
CompactClassificationDiscriminant: obj = CompactClassificationDiscriminant ( Mdl )
CompactClassificationDiscriminant: obj = CompactClassificationDiscriminant ()

Create a CompactClassificationDiscriminant object.

Mdl is the ClassificationDiscriminant object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Create a CompactClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationDiscriminant.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1158
CompactClassificationDiscriminant: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

This property is read-only.

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationDiscriminant.Delta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 816
CompactClassificationDiscriminant: property Delta

Delta threshold for the linear coefficients

A nonnegative scalar that eliminates predictors. A per-class linear
coefficient is set to zero when it falls below Delta , and the
comparison is made on the standardized coefficient, the
coefficient times the within-class standard deviation of its predictor.
Scaling matters here: a threshold on the raw coefficients would depend
on the units each predictor is measured in, so the same model in
centimetres and in metres would drop different predictors.

DeltaPredictor reports, per predictor, the value at which it
drops out of every class at once.

It applies to the linear family only, a quadratic discriminant having no
linear coefficients to eliminate. Assigning it rebuilds Coeffs
and changes what predict answers.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Delta threshold for the linear coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationDiscriminant.DeltaPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 489
CompactClassificationDiscriminant: property DeltaPredictor

Minimum Delta at which each predictor drops out

A row vector with one entry per predictor, the value of Delta at
which that predictor&rsquo;s coefficient is zero for every class and the
predictor leaves the model altogether. It is all zeros for the
quadratic family, which has no linear coefficients to eliminate.

This property is read-only, and it describes the fit rather than the
threshold: assigning Delta does not move it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Minimum Delta at which each predictor drops out



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactClassificationDiscriminant.DiscrimType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 803
CompactClassificationDiscriminant: property DiscrimType

Discriminant type

A character vector naming the discriminant model, one of
'linear' , 'quadratic' , 'diagLinear' ,
'diagQuadratic' , 'pseudoLinear' or
'pseudoQuadratic' . A linear type pools one covariance across
the classes; a quadratic type estimates one per class. A
'diag' type keeps only the variances, and a 'pseudo'
type inverts a singular covariance instead of refusing it.

This property may be assigned, but only within its own family :
the three linear types interchange freely and so do the three quadratic
ones, while no assignment moves a model between the two. The family is
fixed when the model is fitted, because it decides which covariances the
fit has to estimate. Assigning re-derives Sigma ,
LogDetSigma , Gamma and Coeffs .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Discriminant type



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
CompactClassificationDiscriminant.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 278
CompactClassificationDiscriminant: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationDiscriminant.Gamma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 520
CompactClassificationDiscriminant: property Gamma

Gamma regularization parameter

A scalar from 0 to 1 shrinking the covariance towards its diagonal.
Gamma and DiscrimType are one state: a value of 1 is the
diagonal type, so assigning it renames DiscrimType to
'diagLinear' or 'diagQuadratic' , and assigning a
diagonal type sets Gamma to 1.

The quadratic family admits 0 and 1 only. A value below
MinGamma is refused, since it would leave the covariance
singular. Assigning re-derives Sigma , LogDetSigma and
Coeffs .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Gamma regularization parameter



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactClassificationDiscriminant.LogDetSigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 625
CompactClassificationDiscriminant: property LogDetSigma

Logarithm of the determinant of the within-class covariance matrix

A scalar for the linear family and a Kx1 vector for the quadratic
one, one entry per class. It is computed in correlation space, as the
sum of the logarithms of the predictor variances plus the log
determinant of the correlation matrix, which is far better conditioned
than the covariance when the data are nearly collinear. A predictor
with no variance contributes nothing rather than an infinity, and the
'pseudo' types sum only over the directions that carry variance.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Logarithm of the determinant of the within-class covariance matrix



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationDiscriminant.MinGamma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 451
CompactClassificationDiscriminant: property MinGamma

Minimum value for the Gamma regularization parameter

A scalar from 0 to 1, the least regularization that leaves the
correlation matrix invertible. It is 0 when the matrix is already
invertible, and positive when the predictors are collinear, in which
case a plain 'linear' or 'quadratic' fit is raised to it
rather than failing. Assigning a Gamma below it is refused.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Minimum value for the Gamma regularization parameter



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationDiscriminant.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
CompactClassificationDiscriminant: property Mu

Class means

A K&times;P numeric matrix specifying the mean of the multivariate
normal distribution of each corresponding class, where K is the
number of classes and P is the number of predictors. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
Class means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationDiscriminant.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
CompactClassificationDiscriminant: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the CompactClassificationDiscriminant
model. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationDiscriminant.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
CompactClassificationDiscriminant: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationDiscriminant.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 569
CompactClassificationDiscriminant: property Prior

Prior probability for each class

A numeric vector specifying the prior probabilities for each class. The
order of the elements in Prior corresponds to the order of the
classes in ClassNames .

This property is read-only.

Specified as a row vector with one entry per class, in the order of
ClassNames , and rescaled to sum to one. It may be given as
'empirical' , 'uniform' , a numeric vector, or a
structure with ClassNames and ClassProbs fields, which
assigns each probability by class name rather than by position.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationDiscriminant.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
CompactClassificationDiscriminant: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationDiscriminant.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 895
CompactClassificationDiscriminant: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. This property is read-only.

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationDiscriminant.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 519
CompactClassificationDiscriminant: property Sigma

Within-class covariance

A numeric array whose shape follows DiscrimType , with P
predictors and K classes:

DiscrimType Sigma LogDetSigma
'linear' , 'pseudoLinear' PxP
scalar
'quadratic' , 'pseudoQuadratic' PxPxK
Kx1
'diagLinear' 1xP scalar
'diagQuadratic' 1xPxK Kx1

The linear family pools one covariance across the classes and the
quadratic family estimates one per class. This property is read-only,
but it is re-derived whenever DiscrimType or Gamma is
assigned.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Within-class covariance



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationDiscriminant.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 631
CompactClassificationDiscriminant: e = edge ( obj , X , Y )
CompactClassificationDiscriminant: e = edge (&hellip;, "Weights" , w )

Classification edge, the mean of the classification margins.

e = edge ( obj , X , Y ) reduces the vector
that margin returns to a single number, the mean margin over the
rows of X . It says how far the model puts the true class ahead of
its nearest rival on average, so a larger edge is a better model, and
unlike a loss it is not bounded above and rewards confidence rather than
bare correctness.

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge, the mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationDiscriminant.logp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 704
CompactClassificationDiscriminant: lp = logp ( obj , X )

Log unconditional probability density of the observations.

lp = logp ( obj , X ) returns an Nx1
vector holding, for each row of X , the natural logarithm of
P(x) = sum_k P(k) P(x|k) , the density of the observation summed
over the classes with each class weighted by its prior P(k) .
Each P(x|k) is the multivariate normal density of class
k .

obj must be a CompactClassificationDiscriminant object.

X must be an NxP numeric matrix with one column per
predictor of the trained model.

An unusually low value marks an observation the model finds unlikely
under every class, which is what makes this an outlier test rather
than a classification.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Log unconditional probability density of the observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationDiscriminant.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1945
CompactClassificationDiscriminant: L = loss ( obj , X , Y )
CompactClassificationDiscriminant: L = loss (&hellip;, name , value )

Compute loss for a trained CompactClassificationDiscriminant object.

L = loss ( obj , X , Y ) computes the loss,
L , using the default loss function 'mincost' .

obj is a CompactClassificationDiscriminant object.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of rows as X .

L = loss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Compute loss for a trained CompactClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationDiscriminant.mahal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1034
CompactClassificationDiscriminant: M = mahal ( obj , X )
CompactClassificationDiscriminant: M = mahal (&hellip;, 'ClassLabels' , labels )

Squared Mahalanobis distance to the class means.

M = mahal ( obj , X ) returns an NxK
matrix whose element (i,j) is the squared Mahalanobis distance
from observation i to the mean of class j , measured
against the covariance that class carries: the one shared covariance
for a linear discriminant and the class&rsquo;s own for a quadratic one.

obj must be a CompactClassificationDiscriminant object.

X must be an NxP numeric matrix with one column per
predictor of the trained model.

M = mahal (&hellip;, 'ClassLabels' , labels )
returns an Nx1 vector instead, holding for each observation the
distance to the mean of the class labels names for it.
labels must have one entry per row of X , each of them one
of ClassNames .

The distance is measured against the covariance the model reports, so
a regularized model is measured against its regularized covariance.
The prior does not enter it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Squared Mahalanobis distance to the class means.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationDiscriminant.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 843
CompactClassificationDiscriminant: m = margin ( obj , X , Y )

Classification margins for discriminant analysis classifier.

m = margin ( obj , X , Y ) returns
the classification margins for obj with data X and
classification Y . m is a numeric vector of length size (X,1).

obj is a CompactClassificationDiscriminant object.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of rows as X .

The classification margin for each observation is the difference between
the classification score for the true class and the maximal
classification score for the false classes.

See also:
fitcdiscr,
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification margins for discriminant analysis classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationDiscriminant.nLinearCoeffs


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 901
CompactClassificationDiscriminant: n = nLinearCoeffs ( obj )
CompactClassificationDiscriminant: n = nLinearCoeffs ( obj , delta )

Number of nonzero linear coefficients at a regularization threshold.

n = nLinearCoeffs ( obj ) returns the number of
predictors the discriminant keeps at its own Delta .

n = nLinearCoeffs ( obj , delta ) returns the
number it would keep at each threshold in delta , as a column
vector however delta is shaped.

A predictor survives a threshold when its DeltaPredictor reaches
it, the comparison including equality, so delta at exactly a
predictor&rsquo;s own value still counts it. A threshold above every
DeltaPredictor therefore leaves nothing and returns zero.

The count is taken whatever the DiscrimType , as MATLAB takes it,
even though Delta regularizes the linear types alone.

See also:
fitcdiscr,
ClassificationDiscriminant,
CompactClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Number of nonzero linear coefficients at a regularization threshold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactClassificationDiscriminant.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1433
CompactClassificationDiscriminant: label = predict ( obj , XC )
CompactClassificationDiscriminant: [ label , score , cost ] = predict ( obj , XC )

Classify new data points into categories using the discriminant
analysis model from a CompactClassificationDiscriminant object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
corresponding labels from the trained ClassificationDiscriminant ,
model, obj .

obj must be a CompactClassificationDiscriminant class
object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the discriminant
model in obj .

[ label , score , cost ] = predict ( obj ,
XC ) also returns score , which contains the predicted class
scores or posterior probabilities for each instance of the corresponding
unique classes, and cost , which is a matrix containing the expected
cost of the classifications.

The score matrix contains the posterior probabilities for each
class, calculated using the multivariate normal probability density
function and the prior probabilities of each class. These scores are
normalized to ensure they sum to 1 for each observation.

The cost matrix contains the expected classification cost for each
class, computed based on the posterior probabilities and the specified
misclassification costs.

See also:
CompactClassificationDiscriminant,
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
Classify new data points into categories using the discriminant analysis model from a CompactClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactClassificationDiscriminant.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 531
CompactClassificationDiscriminant: savemodel ( obj , filename )

Save a CompactClassificationDiscriminant object.

savemodel ( obj , filename ) saves each property of a
CompactClassificationDiscriminant object into an Octave binary file, the
name of which is specified in filename , along with an extra
variable, which defines the type classification object these variables
constitute. Use loadmodel in order to load a classification object
into Octave&rsquo;s workspace.

See also:
loadmodel,
fitcdiscr,
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Save a CompactClassificationDiscriminant object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 669
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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
A multiclass model built from binary learners, without its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationECOC.BinaryLearners


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
CompactClassificationECOC: property BinaryLearners

The trained binary learners

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.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
The trained binary learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationECOC.BinaryLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 527
CompactClassificationECOC: property BinaryLoss

The loss that turns a binary learner&rsquo;s score into a cost

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.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
The loss that turns a binary learner's score into a cost



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationECOC.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
CompactClassificationECOC: property CategoricalPredictors

The columns of the training data that held categorical predictors,
empty when none did. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 87
The columns of the training data that held categorical predictors, empty when none did.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationECOC.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
CompactClassificationECOC: property ClassNames

The class labels

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.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
The class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationECOC.CodingMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
CompactClassificationECOC: property CodingMatrix

The coding design

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.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
The coding design



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CompactClassificationECOC.CompactClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 410
CompactClassificationECOC: obj = CompactClassificationECOC ( Mdl )
CompactClassificationECOC: obj = CompactClassificationECOC ()

Create a CompactClassificationECOC object.

Mdl is the ClassificationECOC object to compact. The
documented way to reach this constructor is the compact method.

Called with no arguments it returns an object with its properties at
their defaults, which is what loadmodel fills in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Create a CompactClassificationECOC object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationECOC.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
CompactClassificationECOC: property Cost

The cost of misclassification

A KxK matrix whose (i,j) element is the cost of calling
a member of class i a member of class j .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
The cost of misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationECOC.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 253
CompactClassificationECOC: property ExpandedPredictorNames

The names of the predictors as the learners saw them. It differs from
PredictorNames only where a categorical predictor was expanded,
which this package does not do. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
The names of the predictors as the learners saw them.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationECOC.LearnerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 240
CompactClassificationECOC: property LearnerWeights

The weight each binary learner was trained on

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.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
The weight each binary learner was trained on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationECOC.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 145
CompactClassificationECOC: property PredictorNames

The names of the predictors, one per column of the training data.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
The names of the predictors, one per column of the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactClassificationECOC.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 126
CompactClassificationECOC: property Prior

The prior probability of each class, in the order of
ClassNames and summing to one.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 83
The prior probability of each class, in the order of ClassNames and summing to one.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationECOC.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
CompactClassificationECOC: property ResponseName

The name of the response variable. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
The name of the response variable.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationECOC.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
CompactClassificationECOC: property ScoreTransform

The transform applied to the predicted scores

A character vector naming one of the transforms
parseScoreTransform accepts, or a function handle.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
The transform applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationECOC.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 616
CompactClassificationECOC: obj = discardSupportVectors ( obj )

Give up the support vectors of the binary learners.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Give up the support vectors of the binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationECOC.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 399
CompactClassificationECOC: e = edge ( obj , X , Y )
CompactClassificationECOC: e = edge (&hellip;, name , value )

Classification edge of a CompactClassificationECOC .

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Classification edge of a CompactClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationECOC.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 632
CompactClassificationECOC: L = loss ( obj , X , Y )
CompactClassificationECOC: L = loss (&hellip;, name , value )

Classification loss of a CompactClassificationECOC .

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Classification loss of a CompactClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationECOC.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 600
CompactClassificationECOC: m = margin ( obj , X , Y )
CompactClassificationECOC: m = margin (&hellip;, name , value )

Classification margin of a CompactClassificationECOC .

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Classification margin of a CompactClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactClassificationECOC.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1286
CompactClassificationECOC: label = predict ( obj , XC )
CompactClassificationECOC: [ label , NegLoss ] = predict (&hellip;)
CompactClassificationECOC: [ label , NegLoss , PBScore ] = predict (&hellip;)
CompactClassificationECOC: [&hellip;] = predict (&hellip;, name , value )

Classify new data with a trained CompactClassificationECOC .

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 (&hellip;) also returns
the NxK negated average loss, the largest entry of a row naming
the class that row was given.

[ label , NegLoss , PBScore ] = predict (&hellip;)
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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Classify new data with a trained CompactClassificationECOC.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationECOC.selectModels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 436
CompactClassificationECOC: sub = selectModels ( obj , idx )

Keep a subset of the fitted regularization strengths.

sub = selectModels ( obj , idx ) narrows every
binary learner to the strengths idx names, which may be indices
into the learner&rsquo;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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Keep a subset of the fitted regularization strengths.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 558
statistics: CompactClassificationEnsemble

Compact ensemble of weak learners for classification

A CompactClassificationEnsemble object carries the trained weak
learners of a boosted or bagged ensemble and what prediction needs, but
not the observations it was fitted on. It predicts new data identically
to the ensemble it came from, and weak learners can be removed from it.

Create one with the compact method of a
ClassificationEnsemble or ClassificationBaggedEnsemble
object.

See also:
fitcensemble,
ClassificationEnsemble,
ClassificationBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Compact ensemble of weak learners for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CompactClassificationEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 194
CompactClassificationEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationEnsemble.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
CompactClassificationEnsemble: property ClassNames

Names of the classes

The classes, in the type of the response and in the order the columns
of the scores take them. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 349
CompactClassificationEnsemble: property CombineWeights

How the weak learners are combined

'WeightedSum' for a boosted ensemble, whose scores are the sum
of each learner&rsquo;s output times its weight, or 'WeightedAverage'
for a bagged one, whose scores are the weighted average of its trees&rsquo;
class probabilities. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
How the weak learners are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
CompactClassificationEnsemble.CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
CompactClassificationEnsemble: obj = CompactClassificationEnsemble ( Mdl )

Create a CompactClassificationEnsemble object.

Mdl is the ClassificationEnsemble or
ClassificationBaggedEnsemble object to compact. The documented
way to reach this constructor is the compact method.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Create a CompactClassificationEnsemble object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationEnsemble.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 194
CompactClassificationEnsemble: property Cost

Misclassification costs

A square matrix, Cost(i,j) being the cost of classifying an
observation of class i as class j . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Misclassification costs



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
CompactClassificationEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
CompactClassificationEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames , no predictor being expanded. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 135
CompactClassificationEnsemble: property NumTrained

Number of trained weak learners

A nonnegative integer. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Number of trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
CompactClassificationEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationEnsemble.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 184
CompactClassificationEnsemble: property Prior

Prior probabilities of the classes

A row vector with one probability per class, in the order of
ClassNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
CompactClassificationEnsemble: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationEnsemble.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 292
CompactClassificationEnsemble: property ScoreTransform

Transform applied to the predicted scores

A character vector naming a built-in transform, such as
'none' (default) or 'doublelogit' , or a function
handle. The labels, losses, edges and margins are computed from the
transformed scores.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Transform applied to the predicted scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 420
CompactClassificationEnsemble: property Trained

Trained weak learners

A column cell array with one compact model per learner: a
CompactClassificationTree for AdaBoostM1, AdaBoostM2, RUSBoost and
Bag, and a CompactRegressionTree for GentleBoost and LogitBoost,
which fit regression trees. MATLAB wraps those regression trees in a
classifier object of its own; here they are held as they are. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
CompactClassificationEnsemble: property TrainedWeights

Weights of the trained weak learners

A column with one weight per learner. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Weights of the trained weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
CompactClassificationEnsemble: property UsePredForLearner

Which predictors each learner uses

For the 'Subspace' method, a logical matrix with one row per
predictor and one column per learner. Empty for tree learners, as
MATLAB returns it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 473
CompactClassificationEnsemble: e = edge ( obj , X , Y )
CompactClassificationEnsemble: e = edge (&hellip;, name , value )

Classification edge of a compact ensemble.

e is the weighted mean of the margins of the rows of X , the
weights normalized so that each class carries its prior probability.
'Mode' and 'Weights' are taken as by loss , and
'Learners' and 'UseObsForLearner' as by predict .

See also:
CompactClassificationEnsemble,
CompactClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification edge of a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1204
CompactClassificationEnsemble: L = loss ( obj , X , Y )
CompactClassificationEnsemble: L = loss (&hellip;, name , value )

Classification loss of a compact ensemble.

L is the weighted loss of the scores predict gives the rows
of X against the labels Y . The weights are normalized so
that each class carries its prior probability.

Name-Value arguments:

Name Value
'LossFun' 'classiferror' (default),
'binodeviance' , 'classifcost' , 'exponential' ,
'hinge' , 'logit' , 'mincost' ,
'quadratic' , or a function handle called as
lossfun (C, S, W, Cost) , C being an NxK logical
matrix marking each row&rsquo;s class, S the scores and W the
normalized weights.
'Mode' 'ensemble' (default) for one
loss over the learners used, 'cumulative' for a column whose
element j uses the first j of them, or
'individual' for a column with the loss of each on its own.
'Weights' A nonnegative vector with one weight
per row. The default is uniform.

'Learners' and 'UseObsForLearner' are taken as by
predict . A row with NaN scores, which no learner may
score, is left out and the weights are renormalized over the rest;
edge does the same.

See also:
CompactClassificationEnsemble,
CompactClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification loss of a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationEnsemble.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 415
CompactClassificationEnsemble: m = margin ( obj , X , Y )
CompactClassificationEnsemble: m = margin (&hellip;, name , value )

Classification margins of a compact ensemble.

m holds, for each row of X , the score of its true class
less the highest score among the other classes. 'Learners'
and 'UseObsForLearner' are taken as by predict .

See also:
CompactClassificationEnsemble,
CompactClassificationEnsemble.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Classification margins of a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1297
CompactClassificationEnsemble: label = predict ( obj , X )
CompactClassificationEnsemble: [ label , scores ] = predict (&hellip;)
CompactClassificationEnsemble: [&hellip;] = predict (&hellip;, name , value )

Classify new data with a compact ensemble.

label holds the class of highest score for each row of X ,
in the type of ClassNames , and scores the NxK
scores after ScoreTransform .

The scores of a boosted ensemble are the sum over the learners of each
learner&rsquo;s weight times its output. For AdaBoostM1 the output is +1 for
the class the learner predicts and -1 for the other; for GentleBoost and
LogitBoost it is the regression tree&rsquo;s prediction for the first class and
its negative for the second; for AdaBoostM2 and RUSBoost it is the
learner&rsquo;s class probabilities. The scores of a bagged ensemble are the
average of its trees&rsquo; class probabilities. A row that no learner may
score has NaN scores and is given the class of greatest prior
probability.

Name-Value arguments:

Name Value
'Learners' A vector of indices of the learners
to use. The default is all of them.
'UseObsForLearner' An NxNumTrained
logical matrix saying which learner may score which row. The default
lets every learner score every row.

See also:
CompactClassificationEnsemble,
fitcensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classify new data with a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 575
CompactClassificationEnsemble: imp = predictorImportance ( obj )
CompactClassificationEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

imp is a row vector with one element per predictor, the average
over the trees of each tree&rsquo;s predictorImportance , weighted by
TrainedWeights . GentleBoost and LogitBoost ensembles take the
importance of their regression trees. ma , the predictive
measure of association between the predictors, is empty, the trees
growing no surrogate splits.

See also:
CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationEnsemble.removeLearners


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 288
CompactClassificationEnsemble: C = removeLearners ( obj , idx )

Remove weak learners from a compact ensemble.

C is the ensemble without the learners whose indices idx
holds, their weights and their columns of UsePredForLearner
removed with them.

See also:
CompactClassificationEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Remove weak learners from a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 966
statistics: CompactClassificationGAM

Compact generalized additive model classification

The CompactClassificationGAM class is a compact version of a
Generalized Additive Model classifier, ClassificationGAM . It does
not include the training data, resulting in a smaller classifier size that
can be used for making predictions from new data, but not for tasks such as
cross validation.

A CompactClassificationGAM object can only be created from a
ClassificationGAM model by using the compact method.

The engine that fitted the model is carried over in FitMethod ,
and the compact model predicts by the same scheme the full one did.
Under 'boostedtrees' , the default, the fit is described by
TreeModel , BinEdges and PairDetectionBinEdges .
Under 'splines' it is described by Formula ,
BaseModel , ModelwInt and IntMatrix , which MATLAB&rsquo;s
compact model does not carry. Whichever fitted the model, the other
set is empty.

See also:
ClassificationGAM,
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Compact generalized additive model classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.BaseModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 295
CompactClassificationGAM: property BaseModel

Base model parameters

A structure containing the parameters of the base model without any
interaction terms. The base model represents the generalized additive
model with only the main effects (predictor terms) included.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Base model parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactClassificationGAM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 291
CompactClassificationGAM: property BinEdges

Bin edges of the fitted shape functions

A cell array with one row vector per predictor, holding the cut points
the boosted-tree engine binned it at. It is the empty cell under the
spline engine, which does no binning. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Bin edges of the fitted shape functions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationGAM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 226
CompactClassificationGAM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector holding the column of each predictor treated as
categorical, and empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationGAM.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 352
CompactClassificationGAM: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y . This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationGAM.CompactClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 429
CompactClassificationGAM: obj = CompactClassificationGAM ( Mdl )
CompactClassificationGAM: obj = CompactClassificationGAM ()

Create a CompactClassificationGAM object.

Mdl is the ClassificationGAM object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create a CompactClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationGAM.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1203
CompactClassificationGAM: property Cost

Cost of Misclassification

A square matrix specifying the cost of misclassification of a point.
Cost(i,j) is the cost of classifying a point into class j
if its true class is i (that is, the rows correspond to the true
class and the columns correspond to the predicted class). The order of
the rows and columns in Cost corresponds to the order of the
classes in ClassNames . The number of rows and columns in
Cost is the number of unique classes in the response. By
default, Cost(i,j) = 1 if i != j , and
Cost(i,j) = 0 if i = j . In other words, the cost is 0
for correct classification and 1 for incorrect classification.

Add or change the Cost property using dot notation as in:

obj .Cost = costMatrix

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of Misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationGAM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
CompactClassificationGAM: property ExpandedPredictorNames

Names of the expanded predictor variables

A cell array of character vectors naming the predictors as the model
sees them. It matches PredictorNames unless a categorical
predictor was expanded into dummy variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of the expanded predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
CompactClassificationGAM: property FitMethod

Which engine fitted the model

Either 'boostedtrees' or 'splines' , as the model it was
compacted from was fitted. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Which engine fitted the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationGAM.Formula


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 280
CompactClassificationGAM: property Formula

Model specification formula

A character vector specifying the model formula in the form
'Y ~ terms' where Y represents the response variable and
terms specifies the predictor variables and interaction terms.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Model specification formula



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.IntMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 564
CompactClassificationGAM: property IntMatrix

Every term the model fits

A logical matrix with one row per term and one column per predictor,
true wherever the term multiplies that predictor. A row naming one
predictor is a main effect, two an interaction, and three or more a
higher-order term. This property is read-only.

It is the complete record, where Interactions reports only the
two-way terms, in the form MATLAB reports them. It is also the form
the 'Interactions' option takes back, so passing it to the
constructor rebuilds a model over the same terms.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Every term the model fits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationGAM.Interactions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 605
CompactClassificationGAM: property Interactions

Two-way interaction terms of the fitted model

A Kx2 matrix of predictor index pairs, one row per two-way term
the model carries, and zeros (0, 2) when it carries none. It
reports what was fitted rather than what was asked for, so a count of
terms, 'all' , a logical matrix and a formula all leave the same
kind of value behind. This property is read-only.

A main effect names one predictor and a higher-order term names three
or more, and neither has a two-column form, so neither appears here.
IntMatrix remains the complete record of every term fitted.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Two-way interaction terms of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.Intercept


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 204
CompactClassificationGAM: property Intercept

Intercept of the fitted model

A numeric scalar, the log-odds of the response mean, which every
additive term is measured against. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Intercept of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.ModelwInt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 275
CompactClassificationGAM: property ModelwInt

Model parameters with interactions

A structure containing the parameters of the model that includes
interaction terms. This model extends the base model by adding
interaction terms between predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Model parameters with interactions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationGAM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
CompactClassificationGAM: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the ClassificationGAM model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationGAM.PairDetectionBinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
CompactClassificationGAM: property PairDetectionBinEdges

Bin edges used to detect interactions

A cell array with one row vector per predictor, the eight
equal-frequency bins pairs were tested on, empty when the model carries
no interaction terms. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Bin edges used to detect interactions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationGAM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
CompactClassificationGAM: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationGAM.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
CompactClassificationGAM: property Prior

Prior probability for each class

A 2-element numeric vector specifying the prior probabilities for each
class. The order of the elements in Prior corresponds to the
order of the classes in ClassNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Prior probability for each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationGAM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
CompactClassificationGAM: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationGAM.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1357
CompactClassificationGAM: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1

The default is 'logit' , as in MATLAB. This model&rsquo;s raw
score is a log-odds, reported as the pair [-f, f] whose two
columns sum to zero, and the transform is what turns it into the
posterior probabilities that sum to one. Every transform therefore
composes on the log-odds and not on the probabilities, so
'none' returns the log-odds themselves.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.TreeModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 223
CompactClassificationGAM: property TreeModel

The fitted shape functions and interaction surfaces

The structure the full model reports, carried over unchanged, and
empty under the spline engine. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
The fitted shape functions and interaction surfaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationGAM.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 500
CompactClassificationGAM: e = edge ( obj , X , Y )
CompactClassificationGAM: e = edge (&hellip;, "Weights" , w )

Classification edge of a compact generalized additive model.

e = edge ( obj , X , Y ) returns the mean of
the classification margins over the rows of X .

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .

See also:
CompactClassificationGAM,
ClassificationGAM,
CompactClassificationGAM.margin,
CompactClassificationGAM.loss,
##
predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge of a compact generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 999
CompactClassificationGAM: L = loss ( obj , X , Y )
CompactClassificationGAM: L = loss (&hellip;, name , value )

Classification loss of a compact generalized additive model.

L = loss ( obj , X , Y ) returns the loss of
the model on the rows of X against the true labels Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss. Supported values are
"mincost" , the default, "binodeviance" ,
"classifcost" , "classiferror" , "exponential" ,
"hinge" , "logit" and "quadratic" .
"mincost" assigns each observation to the class of least
expected cost and charges what that assignment costs, so it reads the
scores as a posterior, which is what this model returns;
"classifcost" charges what the model&rsquo;s own prediction costs.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
CompactClassificationGAM,
ClassificationGAM,
CompactClassificationGAM.margin,
CompactClassificationGAM.edge,
##
predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification loss of a compact generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactClassificationGAM.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 524
CompactClassificationGAM: m = margin ( obj , X , Y )

Classification margin of a compact generalized additive model.

m = margin ( obj , X , Y ) returns a column
vector holding, for each row of X , the score the model gives its
true class in Y less the score it gives the other class. A
positive margin means the observation is classified correctly, and the
larger it is the more confidently so.

See also:
CompactClassificationGAM,
ClassificationGAM,
CompactClassificationGAM.edge,
CompactClassificationGAM.loss,
## predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Classification margin of a compact generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1459
CompactClassificationGAM: label = predict ( obj , XC )
CompactClassificationGAM: [ label , score ] = predict ( obj , XC )
CompactClassificationGAM: [ label , score ] = predict (&hellip;, 'IncludeInteractions' , includeInteractions )

Predict labels for new data using the Generalized Additive Model (GAM)
stored in a CompactClassificationGAM object.

label = predict ( obj , XC ) returns the predicted
labels for the data in XC based on the model stored in the
CompactClassificationGAM object, obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the predicted class scores or
posterior probabilities for each observation. Every row is predicted.
Under boosted trees a missing value adds nothing from a main effect,
and an interaction term takes the value its trees give a row missing
that predictor; under splines a row holding a missing value is scored
NaN and takes the class of largest prior.

[ label , score ] = predict ( obj , XC ,
'IncludeInteractions', includeInteractions ) allows you to specify
whether interaction terms should be included when making predictions.

obj must be a CompactClassificationGAM class object.

XC must be an M&times;P numeric matrix where each row is an
observation and each column corresponds to a predictor variable.

includeInteractions is a logical scalar indicating whether to
include interaction terms in the predictions.

See also:
CompactClassificationGAM,
ClassificationGAM,
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
Predict labels for new data using the Generalized Additive Model (GAM) stored in a CompactClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationGAM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 519
CompactClassificationGAM: savemodel ( obj , filename )

Save a CompactClassificationGAM object.

savemodel ( obj , filename ) saves each property of a
CompactClassificationGAM object into an Octave binary file, the name of
which is specified in filename , along with an extra variable,
which defines the type classification object these variables constitute.
Use loadmodel in order to load a classification object into
Octave&rsquo;s workspace.

See also:
loadmodel,
fitcgam,
ClassificationGAM,
CompactClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Save a CompactClassificationGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 575
statistics: CompactClassificationNaiveBayes

Compact naive Bayes classification

A CompactClassificationNaiveBayes object carries the fitted
densities of a ClassificationNaiveBayes model and everything
predict needs, but not the observations the model was fitted on.
It classifies new data identically to the model it came from, and is far
smaller to keep or to ship.

Create one with the compact method of a
ClassificationNaiveBayes object. Because it holds no training
data, it has no resub methods and cannot be cross-validated.

See also:
ClassificationNaiveBayes,
fitcnb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Compact naive Bayes classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationNaiveBayes.CategoricalLevels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 254
CompactClassificationNaiveBayes: property CategoricalLevels

Levels of the categorical predictors

A cell array with one entry per predictor, holding the distinct levels
of each categorical predictor and empty for every other. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Levels of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
CompactClassificationNaiveBayes.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
CompactClassificationNaiveBayes: property CategoricalPredictors

Categorical predictor indices

The column indices treated as categorical, or empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Categorical predictor indices



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationNaiveBayes.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 210
CompactClassificationNaiveBayes: property ClassNames

Class labels of the fitted model

The distinct classes the model was fitted on, in the order the other
per-class properties use. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Class labels of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
CompactClassificationNaiveBayes.CompactClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 288
CompactClassificationNaiveBayes: obj = CompactClassificationNaiveBayes ( Mdl )

Create a CompactClassificationNaiveBayes object.

Mdl is the ClassificationNaiveBayes object to compact. The
documented way to reach this constructor is the compact method.

See also:
ClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Create a CompactClassificationNaiveBayes object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationNaiveBayes.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
CompactClassificationNaiveBayes: property Cost

Misclassification cost

A square numeric matrix where Cost(i,j) is the cost of
classifying an observation of class i into class j .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Misclassification cost



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationNaiveBayes.DistributionNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
CompactClassificationNaiveBayes: property DistributionNames

Predictor distributions

A cell array of character vectors with one entry per predictor, naming
the distribution fitted to it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Predictor distributions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
CompactClassificationNaiveBayes.DistributionParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
CompactClassificationNaiveBayes: property DistributionParameters

Fitted distribution parameters

A cell array with one row per class and one column per predictor,
holding the parameters fitted to each. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Fitted distribution parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
CompactClassificationNaiveBayes.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
CompactClassificationNaiveBayes: property ExpandedPredictorNames

Expanded predictor variable names

A cell array of character vectors naming the predictors as the model
sees them. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Expanded predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationNaiveBayes.Kernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
CompactClassificationNaiveBayes: property Kernel

Kernel smoothing functions

A cell array naming the smoothing kernel of each kernel predictor, and
empty for every other. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Kernel smoothing functions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationNaiveBayes.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 186
CompactClassificationNaiveBayes: property Mu

Predictor means

The means used to center the predictors, when the model standardizes
them, and empty otherwise. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationNaiveBayes.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
CompactClassificationNaiveBayes: property PredictorNames

Predictor variable names

A cell array of character vectors naming the predictors. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationNaiveBayes.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 167
CompactClassificationNaiveBayes: property Prior

Class prior probabilities

A numeric row vector with one entry per class, in the order of
ClassNames , summing to one.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Class prior probabilities



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationNaiveBayes.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 156
CompactClassificationNaiveBayes: property ResponseName

Response variable name

A character vector naming the response variable. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationNaiveBayes.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
CompactClassificationNaiveBayes: property ScoreTransform

Score transformation

A character vector naming the function applied to the posterior
returned by predict , or a function handle.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Score transformation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationNaiveBayes.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
CompactClassificationNaiveBayes: property Sigma

Predictor standard deviations

The standard deviations used to scale the predictors, when the model
standardizes them, and empty otherwise. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationNaiveBayes.Support


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
CompactClassificationNaiveBayes: property Support

Kernel smoothing supports

A cell array giving the support of each kernel predictor&rsquo;s density, and
empty for every other. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Kernel smoothing supports



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationNaiveBayes.Width


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 226
CompactClassificationNaiveBayes: property Width

Kernel smoothing bandwidths

A numeric matrix with one row per class and one column per predictor,
and empty when no predictor uses a kernel density. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Kernel smoothing bandwidths



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationNaiveBayes.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 160
CompactClassificationNaiveBayes: e = edge ( obj , X , Y )
CompactClassificationNaiveBayes: e = edge (&hellip;, 'Weights' , w )

Classification edge on new data.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification edge on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationNaiveBayes.logp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 106
CompactClassificationNaiveBayes: lp = logp ( obj , X )

Log unconditional probability density of new data.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Log unconditional probability density of new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationNaiveBayes.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
CompactClassificationNaiveBayes: l = loss ( obj , X , Y )
CompactClassificationNaiveBayes: l = loss (&hellip;, name , value )

Classification loss on new data.

Takes the 'LossFun' and 'Weights' options that
ClassificationNaiveBayes.loss takes.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationNaiveBayes.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 95
CompactClassificationNaiveBayes: m = margin ( obj , X , Y )

Classification margin on new data.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Classification margin on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationNaiveBayes.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 367
CompactClassificationNaiveBayes: label = predict ( obj , XC )
CompactClassificationNaiveBayes: [ label , score , cost ] = predict ( obj , XC )

Classify new data with a compact naive Bayes model.

The same classification the model it came from would give: the label of
least expected cost, the posterior of each class, and the expected
misclassification cost of each.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Classify new data with a compact naive Bayes model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactClassificationNaiveBayes.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 527
CompactClassificationNaiveBayes: savemodel ( obj , filename )

Save a CompactClassificationNaiveBayes object.

savemodel ( obj , filename ) saves each property of a
CompactClassificationNaiveBayes object into an Octave binary file, the
name of which is specified in filename , along with an extra
variable, which defines the type classification object these variables
constitute. Use loadmodel in order to load a classification
object into Octave&rsquo;s workspace.

See also:
loadmodel,
fitcnb,
CompactClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Save a CompactClassificationNaiveBayes object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 758
statistics: CompactClassificationNeuralNetwork

Compact neural network classification

The CompactClassificationNeuralNetwork class implements a compact
version of the neural network classifier object, which can predict
responses for new data using the predict method, but does not store
the training data.

A compact neural network classification model is a smaller version of the
full ClassificationNeuralNetwork model that does not include the
training data. It consumes less memory than the full model, but cannot
perform tasks that require the training data, such as cross-validation.

Create a CompactClassificationNeuralNetwork object by using the
compact method on a ClassificationNeuralNetwork object.

See also:
ClassificationNeuralNetwork,
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Compact neural network classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationNeuralNetwork.Activations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
CompactClassificationNeuralNetwork: property Activations

Activation functions for hidden layers

A character vector or cell array of character vectors specifying the
activation functions used in the hidden layers of the neural network.
Supported activation functions include: 'linear' ,
'sigmoid' , 'relu' , 'tanh' , 'softmax' ,
'lrelu' , 'prelu' , 'elu' , and 'gelu' .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Activation functions for hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
CompactClassificationNeuralNetwork.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
CompactClassificationNeuralNetwork: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector holding the column of each predictor treated as
categorical, and empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactClassificationNeuralNetwork.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 362
CompactClassificationNeuralNetwork: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y . This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
CompactClassificationNeuralNetwork.CompactClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 489
CompactClassificationNeuralNetwork: obj = CompactClassificationNeuralNetwork ( Mdl )
CompactClassificationNeuralNetwork: obj = CompactClassificationNeuralNetwork ()

Create a CompactClassificationNeuralNetwork object.

Mdl is the ClassificationNeuralNetwork object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Create a CompactClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationNeuralNetwork.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 759
CompactClassificationNeuralNetwork: property Cost

Cost of misclassification

A numeric matrix with one row and one column per class, where
Cost(i,j) is the cost of classifying an observation of class
i as class j . It is taken from the model this object was
compacted from. This property is read-only.

A cost may also be given as a struct with the fields
ClassNames and ClassificationCosts , which names the
order its own matrix is written in. That matrix is permuted into the
order of ClassNames above, so a caller need not know which
order the classes were sorted into. It must name every class.

A cost must be floating point, not sparse, not complex, non-negative
and zero down its diagonal, and must hold no NaN or
Inf . A single is widened to double .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
CompactClassificationNeuralNetwork.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
CompactClassificationNeuralNetwork: property ExpandedPredictorNames

Names of the expanded predictor variables

A cell array of character vectors naming the predictors as the model
sees them. It matches PredictorNames unless a categorical
predictor was expanded into dummy variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of the expanded predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationNeuralNetwork.LayerBiases


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 247
CompactClassificationNeuralNetwork: property LayerBiases

Learned bias of each fully connected layer

A cell array holding one column vector per layer, the output layer
included, with one entry per neuron of that layer. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Learned bias of each fully connected layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactClassificationNeuralNetwork.LayerSizes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 487
CompactClassificationNeuralNetwork: property LayerSizes

Sizes of fully connected layers

A positive integer vector specifying the sizes of the fully connected
layers in the neural network model. The i-th element of
LayerSizes is the number of outputs in the i-th fully connected
layer of the neural network model. LayerSizes does not include
the size of the final fully connected layer. This layer always has K
outputs, where K is the number of classes in Y. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Sizes of fully connected layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationNeuralNetwork.LayerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 276
CompactClassificationNeuralNetwork: property LayerWeights

Learned weights of each fully connected layer

A cell array holding one matrix per layer, the output layer included,
with one row per neuron of that layer and one column per input it
takes. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Learned weights of each fully connected layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationNeuralNetwork.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
CompactClassificationNeuralNetwork: property Mu

Predictor means

A numeric vector containing the means of the predictors used for
standardization. Empty when the predictor data were not standardized.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationNeuralNetwork.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 238
CompactClassificationNeuralNetwork: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the neural network model.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
CompactClassificationNeuralNetwork.OutputLayerActivation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
CompactClassificationNeuralNetwork: property OutputLayerActivation

Activation function for output layer

A character vector specifying the activation function of the output layer
of the neural network. Supported activation functions are the same as
for the Activations property. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Activation function for output layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationNeuralNetwork.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 274
CompactClassificationNeuralNetwork: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationNeuralNetwork.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 259
CompactClassificationNeuralNetwork: property Prior

Prior probability of each class

A numeric vector with one entry per class, in the order of
ClassNames , summing to one. It is taken from the model this
object was compacted from. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationNeuralNetwork.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
CompactClassificationNeuralNetwork: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationNeuralNetwork.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1014
CompactClassificationNeuralNetwork: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationNeuralNetwork.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 259
CompactClassificationNeuralNetwork: property Sigma

Predictor standard deviations

A numeric vector containing the standard deviations of the predictors
used for standardization. Empty when the predictor data were not
standardized.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationNeuralNetwork.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 594
CompactClassificationNeuralNetwork: e = edge ( obj , X , Y )
CompactClassificationNeuralNetwork: e = edge (&hellip;, "Weights" , w )

Classification edge of a compact neural network classifier.

e = edge ( obj , X , Y ) returns the mean of
the classification margins over the rows of X .

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .

See also:
CompactClassificationNeuralNetwork,
##
ClassificationNeuralNetwork,
CompactClassificationNeuralNetwork.margin,
CompactClassificationNeuralNetwork.loss,
CompactClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Classification edge of a compact neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationNeuralNetwork.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1273
CompactClassificationNeuralNetwork: L = loss ( obj , X , Y )
CompactClassificationNeuralNetwork: L = loss (&hellip;, name , value )

Classification loss of a compact neural network classifier.

L = loss ( obj , X , Y ) returns the loss of
the model on the rows of X against the true labels Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss. Supported values are
"mincost" , the default, "binodeviance" ,
"classifcost" , "classiferror" , "crossentropy" ,
"exponential" , "hinge" , "logit" and
"quadratic" . "mincost" assigns each observation to
the class of least expected cost and charges what that assignment
costs, so it reads the scores as a posterior; "classifcost"
charges what the model&rsquo;s own prediction costs. "crossentropy"
is defined for a network only. Note that the default differs from the
other classifiers in this package, which default to
"classiferror" , and follows MATLAB&rsquo;s for this class.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
CompactClassificationNeuralNetwork,
##
ClassificationNeuralNetwork,
CompactClassificationNeuralNetwork.margin,
CompactClassificationNeuralNetwork.edge,
CompactClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Classification loss of a compact neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactClassificationNeuralNetwork.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 616
CompactClassificationNeuralNetwork: m = margin ( obj , X , Y )

Classification margin of a compact neural network classifier.

m = margin ( obj , X , Y ) returns a column
vector holding, for each row of X , the score the model gives its
true class in Y less the largest score it gives any other class.
A positive margin means the observation is classified correctly, and
the larger it is the more confidently so.

See also:
CompactClassificationNeuralNetwork,
##
ClassificationNeuralNetwork,
CompactClassificationNeuralNetwork.edge,
CompactClassificationNeuralNetwork.loss,
CompactClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margin of a compact neural network classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1267
CompactClassificationNeuralNetwork: label = predict ( obj , XC )
CompactClassificationNeuralNetwork: [ label , score ] = predict ( obj , XC )

Classify new data points into categories using the neural network
classification model from a CompactClassificationNeuralNetwork object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
neural network model stored in the CompactClassificationNeuralNetwork
model, obj .

obj must be a CompactClassificationNeuralNetwork class
object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the neural network
model in obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the predicted class scores or
posterior probabilities for each instance of the corresponding unique
classes.

The score matrix contains the classification scores for each class.
For each observation in XC , the predicted class label is the one
with the highest score among all classes. If the ScoreTransform
property is set to a transformation function, the scores are transformed
accordingly before being returned.

See also:
CompactClassificationNeuralNetwork,
ClassificationNeuralNetwork,
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 136
Classify new data points into categories using the neural network classification model from a CompactClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationNeuralNetwork.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 533
CompactClassificationNeuralNetwork: savemodel ( obj , filename )

Save a CompactClassificationNeuralNetwork object.

savemodel ( obj , filename ) saves each property of a
CompactClassificationNeuralNetwork object into an Octave binary file, the
name of which is specified in filename , along with an extra
variable, which defines the type classification object these variables
constitute. Use loadmodel in order to load a classification
object into Octave&rsquo;s workspace.

See also:
loadmodel,
fitcnet,
ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Save a CompactClassificationNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 706
statistics: CompactClassificationSVM

Compact Support Vector Machine classification

The CompactClassificationSVM class implements a compact version of a
Support Vector Machine classifier object for one-class or two-class
problems, which can predict responses for new data using the predict
method.

A CompactClassificationSVM object is a compact version of a support
vector machine model, ClassificationSVM . It does not include the
training data resulting in a smaller classifier size, which can be used for
making predictions from new data, but not for tasks such as cross
validation. It can only be created from a ClassificationSVM model
by using the compact object method.

See also:
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Compact Support Vector Machine classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationSVM.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 361
CompactClassificationSVM: property Alpha

Trained classifier coefficients

The coefficients of the trained SVM classifier specified as an s&times;1
numeric vector, where s is the number of support vectors,
rows (obj.SupportVectors) . If the SVM classifier was trained
with a kernel function other than 'linear' , then Alpha is
empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Trained classifier coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationSVM.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 332
CompactClassificationSVM: property Beta

Linear predictor coefficients

The linear predictor coefficients specified as an s&times;1 numeric
vector, where s is the number of support vectors,
rows (obj.SupportVectors) . If the SVM classifier was trained
with a 'linear' kernel function, then Beta is empty.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Linear predictor coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationSVM.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
CompactClassificationSVM: property Bias

Bias term

The bias term specified as a scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
Bias term



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationSVM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 236
CompactClassificationSVM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationSVM.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 352
CompactClassificationSVM: property ClassNames

Names of classes in the response variable

An array of unique values of the response variable Y , which has the
same data types as the data in Y . This property is read-only.
ClassNames can have any of the following datatypes:

Cell array of character vectors
Character array
Logical vector
Numeric vector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of classes in the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
CompactClassificationSVM.CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 429
CompactClassificationSVM: obj = CompactClassificationSVM ( Mdl )
CompactClassificationSVM: obj = CompactClassificationSVM ()

Create a CompactClassificationSVM object.

Mdl is the ClassificationSVM object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Create a CompactClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationSVM.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
CompactClassificationSVM: property Cost

Cost of misclassification

A numeric square matrix, where Cost(i,j) is the cost of
classifying an observation of class i as class j . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Cost of misclassification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationSVM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 269
CompactClassificationSVM: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactClassificationSVM.KernelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 315
CompactClassificationSVM: property KernelParameters

Parameters of the kernel function

A structure with fields Function and Scale , and
Order for a polynomial kernel. Function names the
kernel as MATLAB names it, so a radial basis kernel reports
'gaussian' whichever spelling was given. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Parameters of the kernel function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
CompactClassificationSVM.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
CompactClassificationSVM: property Mu

Predictor means

A numeric vector of the same length as the columns in X containing
the means of predictor variables. If the predictor variables have not
been standardized, then Mu is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Predictor means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationSVM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
CompactClassificationSVM: property NumPredictors

Number of predictors

A positive integer value specifying the number of predictors in the
training dataset used for training the SVM model. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationSVM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
CompactClassificationSVM: property PredictorNames

Names of predictor variables

A cell array of character vectors specifying the names of the predictor
variables. The names are in the order in which they appear in the
training dataset. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Names of predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationSVM.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
CompactClassificationSVM: property Prior

Prior probabilities of the classes

A numeric row vector with one entry per class, in the order of
ClassNames , summing to one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactClassificationSVM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
CompactClassificationSVM: property ResponseName

Response variable name

A character vector specifying the name of the response variable Y .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationSVM.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1004
CompactClassificationSVM: property ScoreTransform

Transformation function for classification scores

Specified as a function handle for transforming the classification
scores. Add or change the ScoreTransform property using dot
notation as in:

obj .ScoreTransform = 'function_name'
obj .ScoreTransform = @function_handle

When specified as a character vector, it can be any of the following
built-in functions. Nevertheless, the ScoreTransform property
always stores their function handle equivalent.

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the
largest score to 1, and for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x >
0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class
with the largest score to 1, and for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Transformation function for classification scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationSVM.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 291
CompactClassificationSVM: property Sigma

Predictor standard deviations

A numeric vector of the same length as the columns in X containing
the standard deviations of predictor variables. If the predictor
variables have not been standardized, then Sigma is empty.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Predictor standard deviations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactClassificationSVM.SupportVectorLabels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 499
CompactClassificationSVM: property SupportVectorLabels

Support vector class labels

The support vector class labels specified as an s&times;1 numeric
vector, where s is the number of support vectors,
rows (obj.SupportVectors) . A value of +1 in
SupportVectorLabels indicates that the corresponding support
vector belongs to the positive class (ClassNames{2}) . A value
of -1 indicates that the corresponding support vector belongs to the
negative class (ClassNames{1}) . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Support vector class labels



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationSVM.SupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 320
CompactClassificationSVM: property SupportVectors

Support vectors

The support vectors of the trained SVM classifier specified an s&times;p
numeric matrix, where s is the number of support vectors,
rows (obj.SupportVectors) , and p is the number of
predictor variables in the predictor data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Support vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
CompactClassificationSVM.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 632
CompactClassificationSVM: obj = discardSupportVectors ( obj )

Discard the support vectors of a linear SVM model.

obj = discardSupportVectors ( obj ) empties
Alpha , SupportVectors and
SupportVectorLabels , leaving Beta and Bias to
decide every prediction. A linear kernel needs nothing else, so the
returned model predicts what it predicted before while carrying one
vector in place of many.

The kernel must be linear. Under any other the support vectors are
part of the decision function and cannot be dropped. Discarding twice
is not an error and changes nothing.

See also:
fitcsvm,
ClassificationSVM,
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Discard the support vectors of a linear SVM model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationSVM.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 613
CompactClassificationSVM: e = edge ( obj , X , Y )
CompactClassificationSVM: e = edge (&hellip;, "Weights" , w )

Classification edge, the mean of the classification margins.

e = edge ( obj , X , Y ) reduces the vector
that margin returns to a single number, the mean margin over the
rows of X . It says how far the model puts the true class ahead of
its nearest rival on average, so a larger edge is a better model, and
unlike a loss it is not bounded above and rewards confidence rather than
bare correctness.

e = edge (&hellip;, "Weights" , w ) takes the
weighted mean instead, with one weight per row of X .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Classification edge, the mean of the classification margins.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactClassificationSVM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1905
CompactClassificationSVM: L = loss ( obj , X , Y )
CompactClassificationSVM: L = loss (&hellip;, name , value )

Compute loss for a trained CompactClassificationSVM object.

L = loss ( obj , X , Y ) computes the loss,
L , using the default loss function 'classiferror' .

obj is a CompactClassificationSVM object.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

L = loss (&hellip;, name , value ) allows
additional options specified by name - value pairs:

Name Value
'LossFun' Specifies the loss function to use.
Can be a function handle with four input arguments (C, S, W, Cost)
which returns a scalar value or one of:
&rsquo;binodeviance&rsquo;, &rsquo;classifcost&rsquo;, &rsquo;classiferror&rsquo;, &rsquo;exponential&rsquo;,
&rsquo;hinge&rsquo;, &rsquo;logit&rsquo;,&rsquo;mincost&rsquo;, &rsquo;quadratic&rsquo;.

C is a logical matrix of size N&times;K , where N is the
number of observations and K is the number of classes.
The element C(i,j) is true if the class label of the i-th
observation is equal to the j-th class.

S is a numeric matrix of size N&times;K , where each element
represents the classification score for the corresponding class.

W is a numeric vector of length N , representing
the observation weights.

Cost is a K&times;K matrix representing the misclassification
costs.

'Weights' Specifies observation weights, must be
a numeric vector of length equal to the number of rows in X.
Default is ones (size (X, 1)) . loss normalizes the weights so that
observation weights in each class sum to the prior probability of that
class. When you supply Weights, loss computes the weighted
classification loss.

See also:
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Compute loss for a trained CompactClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactClassificationSVM.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 806
CompactClassificationSVM: m = margin ( obj , X , Y )

Classification margins for Support Vector Machine classifier.

m = margin ( obj , X , Y ) returns
the classification margins for obj with data X and
classification Y . m is a numeric vector of length size (X,1).

obj is a CompactClassificationSVM object.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is N&times;1 matrix or cell matrix containing the class labels
of corresponding predictor data in X . Y must have same
numbers of Rows as X .

The classification margin for each observation is the difference between
the classification score for the true class and the maximal
classification score for the false classes.

See also:
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Classification margins for Support Vector Machine classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationSVM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1707
CompactClassificationSVM: label = predict ( obj , XC )
CompactClassificationSVM: [ label , score ] = predict ( obj , XC )
CompactClassificationSVM: [ label , score , cost ] = predict ( obj , XC )

Classify new data points into categories using the Support Vector Machine
classification model from a CompactClassificationSVM object.

label = predict ( obj , XC ) returns the vector of
labels predicted for the corresponding instances in XC , using the
predictor data in the CompactClassificationSVM model, obj . For
one-class SVM model, +1 or -1 is returned.

obj must be a CompactClassificationSVM class object.

XC must be an M&times;P numeric matrix with the same number of
features P as the corresponding predictors of the SVM model in
obj .

[ label , score ] = predict ( obj , XC ) also
returns score , which contains the decision values for each
prediction. A ScoreTransform assigned to obj is applied
to them, so score holds whatever that transform returns. Posterior
probabilities need a transform fitted to the model, which this package
does not compute yet.

Deviation from MATLAB. cost is the expected cost of
each assignment, sum_j P(j) Cost(j,k) . An SVM score is a
signed distance to the boundary and not a posterior, so the only
distribution available is the one concentrated on the predicted class
and cost is the row of Cost belonging to it. MATLAB
returns the column instead, which is the same matrix read the
wrong way and contradicts its own ClassificationKNN ,
ClassificationDiscriminant and ClassificationNaiveBayes
on any asymmetric cost matrix; the two agree wherever Cost is
symmetric, the default included. Measured on R2024a.

See also:
CompactClassificationSVM,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
Classify new data points into categories using the Support Vector Machine classification model from a CompactClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationSVM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
CompactClassificationSVM: savemodel ( obj , filename )

Save a CompactClassificationSVM object.

savemodel ( obj , filename ) saves each property of a
CompactClassificationSVM object into an Octave binary file, the name of
which is specified in filename , along with an extra variable,
which defines the type classification object these variables constitute.
Use loadmodel in order to load a classification object into
Octave&rsquo;s workspace.

See also:
loadmodel,
ClassificationSVM,
CompactClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Save a CompactClassificationSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 710
statistics: CompactClassificationTree

Compact binary decision tree for classification

A CompactClassificationTree object carries the tree a
ClassificationTree model grew and everything predict needs,
but not the observations it was fitted on. It classifies new data
identically to the model it came from, and is far smaller to keep or to
ship.

Create one with the compact method of a ClassificationTree
object. Because it holds no training data, it has no resub
methods and cannot be cross-validated, and it cannot be pruned: the
pruning sequence is reported but taking a subtree out of it rewrites the
node table, which is work for the model that still has its data.

See also:
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Compact binary decision tree for classification



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationTree.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
CompactClassificationTree: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices into X , naming the predictors
treated as categorical, empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationTree.CategoricalSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
CompactClassificationTree: property CategoricalSplit

Categorical splits of the tree

A Nx2 cell array with one row per categorical split, in node
order, holding the levels sent left and the levels sent right. It is
empty when no split is categorical. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categorical splits of the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationTree.Children


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
CompactClassificationTree: property Children

Child nodes of each node

A NumNodesx2 matrix naming the left and the right child of each
node. A leaf carries a zero in both columns. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Child nodes of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationTree.ClassCount


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 258
CompactClassificationTree: property ClassCount

Class counts at each node

A NumNodesxK matrix holding how many training observations of
each class reached each node. These are counts and take no notice of
the observation weights. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Class counts at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationTree.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
CompactClassificationTree: property ClassNames

Names of the classes

The distinct class labels, in the type the response was given in and
sorted. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationTree.ClassProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
CompactClassificationTree: property ClassProbability

Class probabilities at each node

A NumNodesxK matrix holding, for each node, the weight of each
class among the observations that reached it, as a proportion of the
node&rsquo;s total weight. The root row is the prior. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Class probabilities at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CompactClassificationTree.CompactClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
CompactClassificationTree: obj = CompactClassificationTree ( Mdl )

Create a CompactClassificationTree object.

Mdl is the ClassificationTree object to compact. The
documented way to reach this constructor is the compact method.

See also:
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Create a CompactClassificationTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationTree.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 634
CompactClassificationTree: property Cost

Misclassification cost

A square numeric matrix with one row and column per class, where
Cost(i,j) is the cost of classifying an observation of class
i into class j . It defaults to 1 - eye (K) and may
be reassigned after fitting.

Reassigning it re-derives NodeClass , NodeError and
NodeRisk , and changes what predict answers. The shape
of the tree does not follow, having been decided by the cost in force
when it was grown. MATLAB reports this property read-only on a
compact tree and refuses the assignment; it is settable here, as it is
on the package&rsquo;s other compact classifiers.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Misclassification cost



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactClassificationTree.CutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
CompactClassificationTree: property CutCategories

Categories used at each branch

A NumNodesx2 cell array holding, for a node that cuts a
categorical predictor, the levels sent left and the levels sent right.
Every other entry is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categories used at each branch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationTree.CutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 318
CompactClassificationTree: property CutPoint

Cut point of each node

A column vector holding, for each node, the value the split compares
the predictor against: an observation goes left when its value is less
than the cut point and right otherwise. A leaf and a categorical cut
carry NaN .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Cut point of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationTree.CutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 271
CompactClassificationTree: property CutPredictor

Name of the predictor each node cuts on

A cell array of character vectors with one entry per node, holding the
name of the predictor the node splits on and an empty character vector
at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Name of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactClassificationTree.CutPredictorIndex


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
CompactClassificationTree: property CutPredictorIndex

Index of the predictor each node cuts on

A column vector holding, for each node, the column of X the node
splits on, and zero at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Index of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactClassificationTree.CutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
CompactClassificationTree: property CutType

Type of cut at each node

A cell array of character vectors holding 'continuous' at a
branch node that cuts a numeric predictor at a point,
'categorical' at one that splits a set of levels, and an empty
character vector at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Type of cut at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationTree.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 317
CompactClassificationTree: property ExpandedPredictorNames

Expanded predictor names

A cell array of character vectors. It differs from
PredictorNames only when a categorical predictor has been
expanded into one column per level, which this class does not do, so
the two are always equal. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Expanded predictor names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationTree.IsBranchNode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
CompactClassificationTree: property IsBranchNode

Which nodes are branch nodes

A logical column vector, true for each node that carries a split and
false for each leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Which nodes are branch nodes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationTree.NodeClass


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 367
CompactClassificationTree: property NodeClass

Class assigned to each node

A cell array of character vectors naming, for each node, the class of
least expected misclassification cost given the node&rsquo;s class
probabilities. Under the default cost that is simply the most
probable class, with the first of the class names kept on a tie. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Class assigned to each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationTree.NodeError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 347
CompactClassificationTree: property NodeError

Misclassification cost of each node

A column vector holding, for each node, the expected misclassification
cost of the class the node is assigned. Under the default cost that
is the probability that the node&rsquo;s class is wrong, one less the
largest class probability. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Misclassification cost of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactClassificationTree.NodeProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 295
CompactClassificationTree: property NodeProbability

Probability of reaching each node

A column vector holding, for each node, the total weight of the
observations that reached it, the weights being those the model it
came from was fitted with. The root carries one. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Probability of reaching each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 493
CompactClassificationTree: property NodeRisk

Risk of each node

A column vector holding, for each node, the impurity of the node
weighted by the probability of reaching it, measured by whichever of
'gdi' and 'deviance' the tree was grown under.

A non-default Cost enters here rather than through the class
probabilities: the weights are scaled class by class by the total cost
of misclassifying that class, and the impurity is measured on the
scaled distribution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Risk of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationTree.NodeSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 351
CompactClassificationTree: property NodeSize

Number of observations at each node

A column vector holding how many training observations reached each
node. A row missing the predictor its node cuts on is counted at that
node and at none below it, so a parent&rsquo;s size is not in general the
sum of its children&rsquo;s. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Number of observations at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactClassificationTree.NumNodes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
CompactClassificationTree: property NumNodes

Number of nodes in the tree

A positive integer, the number of nodes the tree holds, branch nodes
and leaves together. Nodes are numbered as they are created, so a
parent always carries a lower number than either of its children.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of nodes in the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationTree.Parent


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 165
CompactClassificationTree: property Parent

Parent of each node

A column vector naming the parent of each node. The root carries a
zero. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Parent of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationTree.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
CompactClassificationTree: property PredictorNames

Names of the predictor variables

A cell array of character vectors with one name per column of
X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactClassificationTree.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 672
CompactClassificationTree: property Prior

Prior probability of each class

A numeric row vector with one element per class, summing to one. It
defaults to the weight each class carries in the training data, and
may be reassigned after fitting.

Reassigning it re-derives every node statistic that depends on the
class weights, so ClassProbability , NodeProbability ,
NodeClass , NodeError and NodeRisk all follow.
The shape of the tree does not, having been decided by the prior in
force when it was grown. MATLAB reports this property read-only on a
compact tree and refuses the assignment; it is settable here, as it is
on the package&rsquo;s other compact classifiers.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Prior probability of each class



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactClassificationTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 375
CompactClassificationTree: property PruneAlpha

Cost complexity parameter of each pruning level

A column vector with one element per level of the pruning sequence,
the first of which is zero and stands for the unpruned tree. Level
L is the smallest subtree that is optimal for every complexity
parameter from PruneAlpha( L +1) up to the next one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Cost complexity parameter of each pruning level



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationTree.PruneList


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 445
CompactClassificationTree: property PruneList

Pruning level of each node

A column vector holding, for each branch node, the level of the cost
complexity sequence at which it stops being a branch node, and zero at
a leaf. Pruning the tree to level L turns every node whose
level is between one and L into a leaf. It is empty when
neither 'Prune' nor 'MergeLeaves' was asked for, since
no sequence was then estimated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Pruning level of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactClassificationTree.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
CompactClassificationTree: property ResponseName

Name of the response variable

A character vector naming the response. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactClassificationTree.ScoreTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
CompactClassificationTree: property ScoreTransform

Transform applied to the scores

A character vector naming the function predict applies to the
class probabilities before returning them, or a function handle. The
default is 'none' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Transform applied to the scores



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactClassificationTree.SurrogateCutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 186
CompactClassificationTree: property SurrogateCutCategories

Categories of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Categories of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationTree.SurrogateCutFlip


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 185
CompactClassificationTree: property SurrogateCutFlip

Cut assignments of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cut assignments of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactClassificationTree.SurrogateCutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
CompactClassificationTree: property SurrogateCutPoint

Cut points of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Cut points of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactClassificationTree.SurrogateCutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 185
CompactClassificationTree: property SurrogateCutPredictor

Predictors of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Predictors of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactClassificationTree.SurrogateCutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 175
CompactClassificationTree: property SurrogateCutType

Types of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Types of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
CompactClassificationTree.SurrogatePredictorAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
CompactClassificationTree: property SurrogatePredictorAssociation

Predictive measures of association of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predictive measures of association of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationTree.edge


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 528
CompactClassificationTree: e = edge ( obj , X , Y )
CompactClassificationTree: e = edge (&hellip;, 'Weights' , w )

Classification edge on new data.

e = edge ( obj , X , Y ) returns the
weighted mean of the margins, a single number summarising how
confidently the model classifies the data.

The weights are normalized within each class to that class&rsquo;s prior
before they are applied.

See also:
CompactClassificationTree,
CompactClassificationTree.margin,
CompactClassificationTree.loss,
CompactClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification edge on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 651
CompactClassificationTree: l = loss ( obj , X , Y )
CompactClassificationTree: l = loss (&hellip;, name , value )

Classification loss on new data.

l = loss ( obj , X , Y ) returns the
minimum expected misclassification cost.

l = loss (&hellip;, name , value ) takes the
following options.

Name Value
'LossFun' One of 'binodeviance' ,
'classifcost' , 'classiferror' , 'exponential' ,
'hinge' , 'logit' , 'mincost' (default) or
'quadratic' .
'Weights' A numeric vector of observation weights,
one per row of X .

See also:
CompactClassificationTree,
CompactClassificationTree.margin,
CompactClassificationTree.edge,
CompactClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Classification loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactClassificationTree.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 523
CompactClassificationTree: m = margin ( obj , X , Y )

Classification margin on new data.

m = margin ( obj , X , Y ) returns one
margin per observation: the score the model gives the observation&rsquo;s
true class, less the largest score it gives any other class. A
positive margin means the observation is classified correctly, and a
larger one means it is classified more confidently.

See also:
CompactClassificationTree,
CompactClassificationTree.edge,
CompactClassificationTree.loss,
CompactClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Classification margin on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactClassificationTree.nodeVariableRange


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 506
CompactClassificationTree: r = nodeVariableRange ( obj , node )

Range of each predictor at a node.

r = nodeVariableRange ( obj , node ) returns a
structure with one field per predictor the path from the root to
node cuts on, holding the two-element range of values that reach
the node, or for a categorical predictor the levels that reach it. A
predictor the path never cuts on is unconstrained and is left out, so
the root gives a structure with no fields.

See also:
CompactClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Range of each predictor at a node.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactClassificationTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1256
CompactClassificationTree: label = predict ( obj , XC )
CompactClassificationTree: [ label , score ] = predict (&hellip;)
CompactClassificationTree: [ label , score , node ] = predict (&hellip;)
CompactClassificationTree: [ label , score , node , cnum ] = predict (&hellip;)

Classify new data with a trained CompactClassificationTree object.

label = predict ( obj , XC ) sends each row of
XC down the tree and returns the class of the node it comes to
rest at. XC must have as many columns as the predictor data the
model was fitted on.

[ label , score ] = predict (&hellip;) also returns
score , an NxK matrix holding the class probabilities of
the node each row landed in, after ScoreTransform .

[ label , score , node ] = predict (&hellip;) also
returns the number of the node each row landed in, and
[ label , score , node , cnum ] = predict
(&hellip;) the index of the predicted class into ClassNames .

The label is the class of least expected misclassification cost, which
under the default Cost is the most probable class of the node.

A row missing the predictor a node cuts on is stopped at that node and
takes its answer, rather than being sent down a branch on evidence the
row does not carry.

See also:
CompactClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 66
Classify new data with a trained CompactClassificationTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactClassificationTree.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 690
CompactClassificationTree: imp = predictorImportance ( obj )

Estimate the importance of each predictor.

imp = predictorImportance ( obj ) returns a row
vector with one element per predictor, holding the total drop in risk
the splits on that predictor bring about, divided by the number of
branch nodes. A predictor the tree never splits on scores zero.

The drop at a branch node is its NodeRisk less the risk of its
two children, so a predictor that is chosen often, high up, and on
nodes it separates well, scores highest. The numbers are comparable
between predictors of one tree and not between trees.

See also:
CompactClassificationTree,
fitctree,
CompactClassificationTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactClassificationTree.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
CompactClassificationTree: savemodel ( obj , filename )

Save a CompactClassificationTree model to a file.

savemodel ( obj , filename ) saves each property of a
CompactClassificationTree object into an Octave binary file, the name
of which is specified in filename , along with an extra variable,
which defines the type of classification object these variables
constitute. Use loadmodel in order to load a classification
object into Octave&rsquo;s workspace.

See also:
loadmodel,
fitctree,
ClassificationTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Save a CompactClassificationTree model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactClassificationTree.view


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 419
CompactClassificationTree: view ( obj )

Print the tree as text.

view ( obj ) prints one line per node: a branch node names
the predictor it cuts on, the cut point, and the node each side leads
to, and a leaf names the class it assigns. A branch node&rsquo;s line ends
with the class it would assign itself, which is the answer an
observation missing that predictor gets.

See also:
CompactClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Print the tree as text.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 513
statistics: CompactRegressionEnsemble

Compact ensemble of regression trees

A CompactRegressionEnsemble object carries the trained trees of a
boosted or bagged regression ensemble and what prediction needs, but not
the observations it was fitted on. It predicts new data identically to
the ensemble it came from, and trees can be removed from it.

Create one with the compact method of a
RegressionEnsemble or RegressionBaggedEnsemble object.

See also:
fitrensemble,
RegressionEnsemble,
RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Compact ensemble of regression trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
CompactRegressionEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 190
CompactRegressionEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactRegressionEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
CompactRegressionEnsemble: property CombineWeights

How the trees are combined

'WeightedSum' for LSBoost, whose prediction is the sum of each
tree&rsquo;s prediction times its weight, or 'WeightedAverage' for
Bag, whose prediction is the weighted average of its trees&rsquo;. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
How the trees are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CompactRegressionEnsemble.CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
CompactRegressionEnsemble: obj = CompactRegressionEnsemble ( Mdl )

Create a CompactRegressionEnsemble object.

Mdl is the RegressionEnsemble or
RegressionBaggedEnsemble object to compact. The documented way
to reach this constructor is the compact method.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Create a CompactRegressionEnsemble object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactRegressionEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 166
CompactRegressionEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactRegressionEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 100
CompactRegressionEnsemble: property NumTrained

Number of trained trees

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Number of trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactRegressionEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
CompactRegressionEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
CompactRegressionEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionEnsemble.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
CompactRegressionEnsemble: property ResponseTransform

Transform applied to the predicted response

'none' (default), 'exp' , 'log' or a function
handle. Predictions and losses use the transformed response.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
CompactRegressionEnsemble: property Trained

Trained trees

A column cell array of CompactRegressionTree objects. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactRegressionEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
CompactRegressionEnsemble: property TrainedWeights

Weights of the trained trees

A column with one weight per tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Weights of the trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
CompactRegressionEnsemble: property UsePredForLearner

Which predictors each learner uses

Always empty, as MATLAB returns it for tree learners. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1072
CompactRegressionEnsemble: L = loss ( obj , X , Y )
CompactRegressionEnsemble: L = loss (&hellip;, name , value )

Regression loss of a compact ensemble.

L is the weighted mean squared error of the predictions for the
rows of X against Y , the weights normalized to sum to one
over the rows that have a response; a row whose response is missing is
left out.

Name-Value arguments:

Name Value
'LossFun' 'mse' (default) or a
function handle called as lossfun (Y, Yfit, W) , with column
vectors of the responses, the predictions and the normalized weights,
returning a scalar.
'Mode' 'ensemble' (default) for one
loss over the trees used, 'cumulative' for a column whose
element j uses the first j of them, or
'individual' for a column with the loss of each on its own.
'Weights' A nonnegative vector with one weight
per row. The default is uniform.

'Learners' and 'UseObsForLearner' are taken as by
predict . A row that no tree may predict is left out and the
weights are renormalized over the rest.

See also:
CompactRegressionEnsemble,
CompactRegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Regression loss of a compact ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 732
CompactRegressionEnsemble: yfit = predict ( obj , X )
CompactRegressionEnsemble: yfit = predict (&hellip;, name , value )

Predict the response with a compact regression ensemble.

yfit holds, for each row of X , the sum over the trees of
each tree&rsquo;s prediction times its weight for LSBoost, or the weighted
average of the trees&rsquo; predictions for Bag, after
ResponseTransform . A row that no tree may predict is
NaN .

Name-Value arguments:

Name Value
'Learners' A vector of indices of the trees to
use. The default is all of them.
'UseObsForLearner' An NxNumTrained
logical matrix saying which tree may predict which row. The default
lets every tree predict every row.

See also:
CompactRegressionEnsemble,
fitrensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Predict the response with a compact regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactRegressionEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 479
CompactRegressionEnsemble: imp = predictorImportance ( obj )
CompactRegressionEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

imp is a row vector with one element per predictor, the average
over the trees of each tree&rsquo;s predictorImportance , weighted by
TrainedWeights . ma , the predictive measure of
association between the predictors, is empty, the trees growing no
surrogate splits.

See also:
CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactRegressionEnsemble.removeLearners


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
CompactRegressionEnsemble: C = removeLearners ( obj , idx )

Remove trees from a compact regression ensemble.

C is the ensemble without the trees whose indices idx
holds, their weights removed with them.

See also:
CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Remove trees from a compact regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
CompactRegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1122
statistics: CompactRegressionGAM

Compact generalized additive model regression

The CompactRegressionGAM class implements a compact version of the
generalized additive model regression object, which predicts responses for
new data with the predict method but does not store the training
data.

A compact model consumes less memory than the full RegressionGAM
model, but cannot perform tasks that need the training data, such as
computing a resubstitution loss or the standard deviation of a prediction.

Create a CompactRegressionGAM object by using the compact
method on a RegressionGAM object.

The engine that fitted the model is carried over in FitMethod ,
and the compact model predicts by the same scheme the full one did.
Under 'boostedtrees' , the default, the fit is described by
TreeModel , BinEdges and PairDetectionBinEdges .
Under 'splines' it is described by Formula ,
BaseModel , ModelwInt and IntMatrix , which MATLAB&rsquo;s
compact model does not carry.
Whichever fitted the model, the other set is empty. A standard
deviation is available from the spline engine alone.

See also:
RegressionGAM,
fitrgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Compact generalized additive model regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.BaseModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 308
CompactRegressionGAM: property BaseModel

Model without interaction terms

A structure holding the intercept, the piecewise polynomial of each
predictor, the number of backfitting cycles, the residuals and the
residual sum of squares of the model fitted without interaction
terms. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Model without interaction terms



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactRegressionGAM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 140
CompactRegressionGAM: property BinEdges

Bin edges of the fitted shape functions, empty under the spline
engine. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 71
Bin edges of the fitted shape functions, empty under the spline engine.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionGAM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
CompactRegressionGAM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector holding the column of each predictor treated as
categorical, and empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactRegressionGAM.CompactRegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 405
CompactRegressionGAM: obj = CompactRegressionGAM ( Mdl )
CompactRegressionGAM: obj = CompactRegressionGAM ()

Create a CompactRegressionGAM object.

Mdl is the RegressionGAM object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Create a CompactRegressionGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionGAM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 297
CompactRegressionGAM: property ExpandedPredictorNames

Names of the expanded predictor variables

A cell array of character vectors naming the predictors as the model
sees them. It matches PredictorNames unless a categorical
predictor was expanded into dummy variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of the expanded predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
CompactRegressionGAM: property FitMethod

Which engine fitted the model, 'boostedtrees' or
'splines' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Which engine fitted the model, 'boostedtrees' or 'splines'.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactRegressionGAM.Formula


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
CompactRegressionGAM: property Formula

Formula of the model

A character vector naming the response and the terms of the model, as
in 'Y ~ x1 + x2 + x1:x2' , or empty when the model was not
given one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Formula of the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.IntMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 560
CompactRegressionGAM: property IntMatrix

Every term the model fits

A logical matrix with one row per term and one column per predictor,
true wherever the term multiplies that predictor. A row naming one
predictor is a main effect, two an interaction, and three or more a
higher-order term. This property is read-only.

It is the complete record, where Interactions reports only the
two-way terms, in the form MATLAB reports them. It is also the form
the 'Interactions' option takes back, so passing it to the
constructor rebuilds a model over the same terms.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Every term the model fits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionGAM.Interactions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 601
CompactRegressionGAM: property Interactions

Two-way interaction terms of the fitted model

A Kx2 matrix of predictor index pairs, one row per two-way term
the model carries, and zeros (0, 2) when it carries none. It
reports what was fitted rather than what was asked for, so a count of
terms, 'all' , a logical matrix and a formula all leave the same
kind of value behind. This property is read-only.

A main effect names one predictor and a higher-order term names three
or more, and neither has a two-column form, so neither appears here.
IntMatrix remains the complete record of every term fitted.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Two-way interaction terms of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.Intercept


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 191
CompactRegressionGAM: property Intercept

Intercept of the fitted model

A numeric scalar, the mean of the response, which every additive term
is measured against. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Intercept of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionGAM.IsStandardDeviationFit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 286
CompactRegressionGAM: property IsStandardDeviationFit

Flag for a fitted standard deviation model

A boolean flag, always false , as this class estimates the
standard deviation of a prediction from the residuals of the fit
rather than fitting a model for it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Flag for a fitted standard deviation model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.ModelwInt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
CompactRegressionGAM: property ModelwInt

Model with interaction terms

A structure of the same fields as BaseModel , for the model
fitted with the interaction terms, and empty when none was asked for.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Model with interaction terms



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionGAM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 162
CompactRegressionGAM: property NumPredictors

Number of predictors

A positive integer, the number of predictors of the training data.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionGAM.PairDetectionBinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
CompactRegressionGAM: property PairDetectionBinEdges

Bin edges used to detect interactions, eight equal-frequency bins per
predictor, empty when the model carries none. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
Bin edges used to detect interactions, eight equal-frequency bins per predictor, empty when the model carries none.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionGAM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 212
CompactRegressionGAM: property PredictorNames

Names of the predictor variables

A cell array of character vectors naming the predictors, in the order
they appear in the training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionGAM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
CompactRegressionGAM: property ResponseName

Response variable name

A character vector naming the response variable Y . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionGAM.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 320
CompactRegressionGAM: property ResponseTransform

Transformation applied to the predicted response

A function handle applied to the response the model predicts. Add or
change it using dot notation, as in
obj .ResponseTransform = 'log' or
obj .ResponseTransform = @function_handle . It defaults
to 'none' , the identity.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.TreeModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 153
CompactRegressionGAM: property TreeModel

The fitted shape functions and interaction surfaces, empty under the
spline engine. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 83
The fitted shape functions and interaction surfaces, empty under the spline engine.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 707
CompactRegressionGAM: L = loss ( obj , X , Y )
CompactRegressionGAM: L = loss (&hellip;, name , value )

Regression loss of a generalized additive model.

L = loss ( obj , X , Y ) returns the weighted
mean squared error of the model on the rows of X against the true
response Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss, either "mse" , the default,
or a function handle taking the true response, the predicted response
and the weights, and returning a numeric scalar.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
CompactRegressionGAM,
RegressionGAM,
fitrgam,
CompactRegressionGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Regression loss of a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactRegressionGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2019
CompactRegressionGAM: yFit = predict ( obj , Xfit )
CompactRegressionGAM: yFit = predict (&hellip;, Name , Value )
CompactRegressionGAM: [ yFit , ySD , yInt ] = predict (&hellip;)

Predict new data points using generalized additive model regression
object.

yFit = predict ( obj , Xfit returns a vector of
predicted responses, yFit , for the predictor data in matrix
Xfit based on the Generalized Additive Model in obj .
Xfit must have the same number of features/variables as the
training data in obj . Every row is predicted. Under boosted
trees a missing value adds nothing from a main effect, and an
interaction term takes the value its trees give a row missing that
predictor, so a row missing every predictor predicts the intercept;
under splines a row holding a missing value is predicted as
NaN .

obj must be a CompactRegressionGAM class object.

[ yFit , ySD , yInt ] = predict ( obj ,
Xfit
also returns the standard deviations, ySD , and prediction
intervals,
yInt , of the response variable yFit , evaluated at each
observation in the predictor data Xfit .

yFit = predict (&hellip;, Name , Value ) returns
the
aforementioned results with additional properties specified by
Name-Value pair arguments listed below.

Name Value
'alpha' significance level of the prediction
intervals yInt , specified as scalar in range [0,1] . The
default value is 0.05, which corresponds to 95% prediction intervals.
'includeinteractions' a boolean flag to include
interactions to predict new values based on Xfit . By default,
'includeinteractions' is true when the GAM model in
obj
contains a obj.Formula or obj.Interactions fields.
Otherwise, is set to false . If set to true when no
interactions are present in the trained model, it will result to an
error. If set to
false when using a model that includes interactions, the
predictions
will be made on the basic model without any interaction terms. This way
you can make predictions from the same GAM model without having to
retrain it.

See also:
fitrgam,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Predict new data points using generalized additive model regression object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionGAM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 438
CompactRegressionGAM: savemodel ( obj , filename )

Save a CompactRegressionGAM object.

savemodel ( obj , filename ) saves each property of a
CompactRegressionGAM object into an Octave binary file, the name of
which is specified in filename , along with an extra variable which
defines the type of object these variables constitute. Use
loadmodel in order to load the object back into Octave.

See also:
loadmodel,
fitrgam,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Save a CompactRegressionGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
CompactRegressionGP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1037
statistics: CompactRegressionGP

Compact Gaussian process regression

A CompactRegressionGP object holds a Gaussian process regression
model without its training data, keeping what is needed to predict and
dropping the rest.

Create a CompactRegressionGP object by using the compact
method of a RegressionGP object.

A compact model keeps the active set it predicts from, the prediction
weights, the covariance function and its parameters, the explicit basis and
its coefficients, the noise standard deviation and the standardizing
location and scale. It drops the response, the observation weights, the
rows used, the count of observations and the maximized log likelihood, so
it can predict but cannot be cross validated, refitted, or asked for its
resubstitution loss or its post-fit statistics.

The standard deviation and the prediction intervals remain available,
because the active set of an exactly fitted model is the whole of the
training predictors and the factorization can be rebuilt from it.

See also:
RegressionGP,
fitrgp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Compact Gaussian process regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionGP.ActiveSetMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 123
CompactRegressionGP: property ActiveSetMethod

Method used to select the active set

'Random' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Method used to select the active set



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionGP.ActiveSetSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 123
CompactRegressionGP: property ActiveSetSize

Size of the active set

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Size of the active set



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactRegressionGP.ActiveSetVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
CompactRegressionGP: property ActiveSetVectors

Subset of the training data used for predictions

An MxP numeric matrix, standardized where the model standardized
its predictors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Subset of the training data used for predictions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionGP.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
CompactRegressionGP: property Alpha

Weights the predictions are made from

A numeric vector with one weight per active set vector. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Weights the predictions are made from



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionGP.BasisFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
CompactRegressionGP: property BasisFunction

Explicit basis of the model

A character vector or a function handle. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Explicit basis of the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactRegressionGP.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 160
CompactRegressionGP: property Beta

Estimated coefficients of the explicit basis

A numeric vector, empty when the basis is 'None' . This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Estimated coefficients of the explicit basis



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactRegressionGP.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 160
CompactRegressionGP: property CategoricalPredictors

Indices of the categorical predictors

A vector of positive integers, or empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactRegressionGP.CompactRegressionGP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
CompactRegressionGP: obj = CompactRegressionGP ( Mdl )

Create a CompactRegressionGP object.

Mdl is the RegressionGP object to
compact, and is required: the compact model has no training data to
build itself from. The documented way to reach this constructor is
the compact method.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Create a CompactRegressionGP object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionGP.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 151
CompactRegressionGP: property ExpandedPredictorNames

Expanded predictor variable names

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Expanded predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactRegressionGP.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 128
CompactRegressionGP: property FitMethod

Method used to estimate the parameters

'Exact' or 'None' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Method used to estimate the parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionGP.KernelFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
CompactRegressionGP: property KernelFunction

Form of the covariance function

A character vector or a function handle. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Form of the covariance function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactRegressionGP.KernelInformation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 191
CompactRegressionGP: property KernelInformation

Covariance function and its parameters

A structure with fields Name , KernelParameters and
KernelParameterNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Covariance function and its parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionGP.PredictMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
CompactRegressionGP: property PredictMethod

Method used to make predictions

'Exact' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Method used to make predictions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactRegressionGP.PredictorLocation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 146
CompactRegressionGP: property PredictorLocation

Means the predictors were centred by

A 1xP numeric vector, or empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Means the predictors were centred by



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionGP.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
CompactRegressionGP: property PredictorNames

Predictor variable names

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionGP.PredictorScale


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 156
CompactRegressionGP: property PredictorScale

Standard deviations the predictors were scaled by

A 1xP numeric vector, or empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Standard deviations the predictors were scaled by



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactRegressionGP.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
CompactRegressionGP: property ResponseName

Response variable name

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactRegressionGP.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 204
CompactRegressionGP: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied. Assigning to it accepts either.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionGP.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 119
CompactRegressionGP: property Sigma

Estimated noise standard deviation

A positive scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Estimated noise standard deviation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactRegressionGP.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 338
CompactRegressionGP: L = loss ( obj , X , Y )
CompactRegressionGP: L = loss (&hellip;, name , value )

Compute the regression loss of a compact Gaussian process model.

L = loss ( obj , X , Y ) returns the mean
squared error of the model obj on the data X and Y ,
and accepts the same 'LossFun' and 'Weights' pairs the
full model accepts.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Compute the regression loss of a compact Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
CompactRegressionGP.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 526
CompactRegressionGP: yFit = predict ( obj , XC )
CompactRegressionGP: [ yFit , ySD , yInt ] = predict ( obj , XC )
CompactRegressionGP: [&hellip;] = predict (&hellip;, 'Alpha' , alpha )

Predict the response for new data with a compact Gaussian process model.

yFit = predict ( obj , XC ) returns the predicted
response of the CompactRegressionGP model obj at the
points in XC , and the further outputs are the standard deviation
of each predicted response and the prediction intervals, exactly as the
full model returns them.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Predict the response for new data with a compact Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactRegressionGP.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 198
CompactRegressionGP: savemodel ( obj , filename )

Save a compact Gaussian process model to a file.

savemodel ( obj , filename ) saves the model obj
into filename in a form loadmodel can read back.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Save a compact Gaussian process model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 875
statistics: CompactRegressionNeuralNetwork

Compact neural network regression

A CompactRegressionNeuralNetwork object holds a neural network
regression model that has dropped its training data.

Create a CompactRegressionNeuralNetwork object by using the
compact method of a RegressionNeuralNetwork object.

The compact model keeps what is needed to answer about new data, the layer
weights and biases, the activations, the standardization and the response
transform, and drops what only describes the fit: the predictor and response
data, the observation weights, the rows used, the number of observations and
the iteration by iteration training history. predict and
loss therefore agree with the full model to the last digit, while
resubPredict and resubLoss do not exist here, there being no
training data left to resubstitute.

See also:
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Compact neural network regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionNeuralNetwork.Activations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 214
CompactRegressionNeuralNetwork: property Activations

Activation functions of the hidden layers

A character vector, or a cell array of character vectors with one entry
per hidden layer. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Activation functions of the hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
CompactRegressionNeuralNetwork.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 190
CompactRegressionNeuralNetwork: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices, and empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
CompactRegressionNeuralNetwork.CompactRegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 465
CompactRegressionNeuralNetwork: obj = CompactRegressionNeuralNetwork ( Mdl )
CompactRegressionNeuralNetwork: obj = CompactRegressionNeuralNetwork ()

Create a CompactRegressionNeuralNetwork object.

Mdl is the RegressionNeuralNetwork object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create a CompactRegressionNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
CompactRegressionNeuralNetwork.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
CompactRegressionNeuralNetwork: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionNeuralNetwork.LayerBiases


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 175
CompactRegressionNeuralNetwork: property LayerBiases

Biases the network learned

A cell array with one entry per layer, the output layer included. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Biases the network learned



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactRegressionNeuralNetwork.LayerSizes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
CompactRegressionNeuralNetwork: property LayerSizes

Sizes of the fully connected hidden layers

A row vector of positive integers, one per hidden layer. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Sizes of the fully connected hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionNeuralNetwork.LayerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
CompactRegressionNeuralNetwork: property LayerWeights

Weights the network learned

A cell array with one entry per layer, the output layer included. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Weights the network learned



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionNeuralNetwork.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
CompactRegressionNeuralNetwork: property Mu

Mean of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Mean of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactRegressionNeuralNetwork.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
CompactRegressionNeuralNetwork: property NumPredictors

Number of predictors

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
CompactRegressionNeuralNetwork.OutputLayerActivation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
CompactRegressionNeuralNetwork: property OutputLayerActivation

Activation function of the output layer

A character vector. 'none' applies the identity, so a
prediction is an unrestricted real number. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Activation function of the output layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactRegressionNeuralNetwork.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
CompactRegressionNeuralNetwork: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionNeuralNetwork.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 133
CompactRegressionNeuralNetwork: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
CompactRegressionNeuralNetwork.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 277
CompactRegressionNeuralNetwork: property ResponseTransform

Transformation applied to the predicted response

A function handle, applied by predict to the network&rsquo;s output.
It may be set after construction, either to a handle or to the name of
a supported transformation.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactRegressionNeuralNetwork.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
CompactRegressionNeuralNetwork: property Sigma

Standard deviation of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Standard deviation of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionNeuralNetwork.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 981
CompactRegressionNeuralNetwork: L = loss ( obj , X , Y )
CompactRegressionNeuralNetwork: L = loss (&hellip;, name , value )

Compute the regression loss of a compact neural network model.

L = loss ( obj , X , Y ) returns the
weighted mean squared error between the response Y and the
response the model predicts for X .

obj must be a CompactRegressionNeuralNetwork class object.

X must be a numeric matrix with the same number of predictors as
the data the model was trained on.

Y must be a numeric vector with as many rows as X .

L = loss (&hellip;, name , value ) accepts the
following Name-Value pairs.

Name Value
'LossFun' 'mse' , the default, or a function
handle called as lossfun ( Y , yFit , W )
and returning a scalar.
'Weights' A numeric vector of observation weights
with one entry per row of X . It defaults to a uniform weight.
The weights are normalized to sum to one before the loss is formed.

See also:
CompactRegressionNeuralNetwork,
RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Compute the regression loss of a compact neural network model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 538
CompactRegressionNeuralNetwork: yFit = predict ( obj , XC )

Predict the response for new data with a compact neural network
regression model.

yFit = predict ( obj , XC ) returns a column
vector holding the predicted response for each row of XC . It
agrees with the full model this object was compacted from.

obj must be a CompactRegressionNeuralNetwork class object.

XC must be a numeric matrix with the same number of predictors as
the data the model was trained on.

See also:
CompactRegressionNeuralNetwork,
RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 81
Predict the response for new data with a compact neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CompactRegressionNeuralNetwork.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 349
CompactRegressionNeuralNetwork: savemodel ( obj , filename )

Save a compact neural network regression model to a file.

savemodel ( obj , filename ) saves every property of
the CompactRegressionNeuralNetwork object obj into
filename in binary format, so that it can be read back with
loadmodel .

See also:
loadmodel,
CompactRegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Save a compact neural network regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 852
statistics: CompactRegressionSVM

Compact Support Vector Machine regression

A CompactRegressionSVM object holds a support vector regression
model that has dropped its training data.

Create a CompactRegressionSVM object by using the compact
method of a RegressionSVM object.

The compact model keeps what is needed to answer about new data, the
support vectors and their coefficients, the intercept, the kernel, the
standardization and the response transform, and drops what only describes
the fit: the predictor and response data, the observation weights, the rows
used, the observation count, and which training rows became support
vectors. predict and loss therefore agree with the full
model to the last digit, while resubPredict and resubLoss do
not exist here, there being no training data left to resubstitute.

See also:
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Compact Support Vector Machine regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CompactRegressionSVM.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 219
CompactRegressionSVM: property Alpha

Dual coefficients of the support vectors

A numeric column vector with one entry per support vector, signed, as
in the model this one was compacted from. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Dual coefficients of the support vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionSVM.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
CompactRegressionSVM: property Beta

Primal coefficients, one per predictor

A numeric column vector, equal to
obj.SupportVectors' * obj.Alpha , and empty for any kernel other
than linear. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Primal coefficients, one per predictor



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionSVM.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
CompactRegressionSVM: property Bias

Intercept of the fitted function

A numeric scalar. With a linear kernel the prediction is
X * obj.Beta + obj.Bias . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Intercept of the fitted function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionSVM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
CompactRegressionSVM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices, and empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactRegressionSVM.CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 405
CompactRegressionSVM: obj = CompactRegressionSVM ( Mdl )
CompactRegressionSVM: obj = CompactRegressionSVM ()

Create a CompactRegressionSVM object.

Mdl is the RegressionSVM object to
compact. The documented way to reach this constructor is the
compact method.

Called with no arguments it returns an object with its properties
empty, which is how a saved model is rebuilt before its values are
filled in.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Create a CompactRegressionSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactRegressionSVM.Epsilon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 241
CompactRegressionSVM: property Epsilon

Half-width of the insensitive tube

A non-negative scalar, carried over from the model this one was
compacted from. It is what the 'epsiloninsensitive' loss
charges against. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Half-width of the insensitive tube



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionSVM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 169
CompactRegressionSVM: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactRegressionSVM.KernelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 311
CompactRegressionSVM: property KernelParameters

Parameters of the kernel function

A structure with fields Function and Scale , and
Order for a polynomial kernel. Function names the
kernel as MATLAB names it, so a radial basis kernel reports
'gaussian' whichever spelling was given. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Parameters of the kernel function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
CompactRegressionSVM.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
CompactRegressionSVM: property Mu

Mean of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Mean of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionSVM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 122
CompactRegressionSVM: property NumPredictors

Number of predictors

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionSVM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
CompactRegressionSVM: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
CompactRegressionSVM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 123
CompactRegressionSVM: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionSVM.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
CompactRegressionSVM: property ResponseTransform

Transformation applied to the predicted response

A function handle, applied by predict to the model&rsquo;s output. It
may be set after construction, either to a handle or to the name of a
supported transformation.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CompactRegressionSVM.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 225
CompactRegressionSVM: property Sigma

Standard deviation of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Standard deviation of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionSVM.SupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 195
CompactRegressionSVM: property SupportVectors

The support vectors themselves

A numeric matrix with one row per support vector, on the scale the
model was trained on. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The support vectors themselves



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CompactRegressionSVM.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 598
CompactRegressionSVM: obj = discardSupportVectors ( obj )

Discard the support vectors of a linear SVM model.

obj = discardSupportVectors ( obj ) empties
Alpha and SupportVectors , leaving Beta and
Bias to decide every prediction. A linear kernel needs
nothing else, so the returned model predicts what it predicted
before while carrying one vector in place of many.

The kernel must be linear. Under any other the support vectors are
part of the decision function and cannot be dropped. Discarding twice
is not an error and changes nothing.

See also:
fitrsvm,
RegressionSVM,
CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Discard the support vectors of a linear SVM model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactRegressionSVM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 958
CompactRegressionSVM: L = loss ( obj , X , Y )
CompactRegressionSVM: L = loss (&hellip;, name , value )

Compute the regression loss of a compact support vector machine model.

L = loss ( obj , X , Y ) returns the
weighted mean squared error between the response Y and the
response the model predicts for X .

obj must be a CompactRegressionSVM class object.

X must be a numeric matrix with the same number of predictors as
the data the model was trained on.

Y must be a numeric vector with as many rows as X .

L = loss (&hellip;, name , value ) accepts the
following Name-Value pairs.

Name Value
'LossFun' 'mse' , the default,
'epsiloninsensitive' , or a function handle called as
lossfun ( Y , yFit , W ) returning a scalar.
'Weights' A numeric vector of observation weights
with one entry per row of X . It defaults to a uniform weight.
The weights are normalized to sum to one before the loss is formed.

See also:
CompactRegressionSVM,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 70
Compute the regression loss of a compact support vector machine model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactRegressionSVM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 498
CompactRegressionSVM: yFit = predict ( obj , XC )

Predict the response for new data with a compact support vector
regression model.

yFit = predict ( obj , XC ) returns a column
vector holding the predicted response for each row of XC . It
agrees with the full model this object was compacted from.

obj must be a CompactRegressionSVM class object.

XC must be a numeric matrix with the same number of predictors as
the data the model was trained on.

See also:
CompactRegressionSVM,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 81
Predict the response for new data with a compact support vector regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionSVM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 319
CompactRegressionSVM: savemodel ( obj , filename )

Save a compact support vector regression model to a file.

savemodel ( obj , filename ) saves every property of
the CompactRegressionSVM object obj into filename
in binary format, so that it can be read back with loadmodel .

See also:
loadmodel,
CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Save a compact support vector regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
CompactRegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 683
statistics: CompactRegressionTree

Compact binary decision tree for regression

A CompactRegressionTree object carries the tree a
RegressionTree model grew and everything predict needs, but
not the observations it was fitted on. It answers new data identically
to the model it came from, and is far smaller to keep or to ship.

Create one with the compact method of a RegressionTree
object. Because it holds no training data, it has no resub
methods and cannot be cross-validated, and it cannot be pruned: the
pruning sequence is reported but taking a subtree out of it rewrites the
node table, which is work for the model that still has its data.

See also:
RegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Compact binary decision tree for regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionTree.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
CompactRegressionTree: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices into X , naming the predictors
treated as categorical, empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionTree.CategoricalSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 275
CompactRegressionTree: property CategoricalSplit

Categorical splits of the tree

A Nx2 cell array with one row per categorical split, in node
order, holding the levels sent left and the levels sent right. It is
empty when no split is categorical. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categorical splits of the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.Children


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 204
CompactRegressionTree: property Children

Child nodes of each node

A NumNodesx2 matrix naming the left and the right child of each
node. A leaf carries a zero in both columns. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Child nodes of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionTree.CompactRegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 248
CompactRegressionTree: obj = CompactRegressionTree ( Mdl )

Create a CompactRegressionTree object.

Mdl is the RegressionTree object to compact. The
documented way to reach this constructor is the compact method.

See also:
RegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Create a CompactRegressionTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactRegressionTree.CutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 261
CompactRegressionTree: property CutCategories

Categories used at each branch

A NumNodesx2 cell array holding, for a node that cuts a
categorical predictor, the levels sent left and the levels sent right.
Every other entry is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categories used at each branch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.CutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 314
CompactRegressionTree: property CutPoint

Cut point of each node

A column vector holding, for each node, the value the split compares
the predictor against: an observation goes left when its value is less
than the cut point and right otherwise. A leaf and a categorical cut
carry NaN .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Cut point of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionTree.CutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 267
CompactRegressionTree: property CutPredictor

Name of the predictor each node cuts on

A cell array of character vectors with one entry per node, holding the
name of the predictor the node splits on and an empty character vector
at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Name of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactRegressionTree.CutPredictorIndex


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
CompactRegressionTree: property CutPredictorIndex

Index of the predictor each node cuts on

A column vector holding, for each node, the column of X the node
splits on, and zero at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Index of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactRegressionTree.CutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 299
CompactRegressionTree: property CutType

Type of cut at each node

A cell array of character vectors holding 'continuous' at a
branch node that cuts a numeric predictor at a point,
'categorical' at one that splits a set of levels, and an empty
character vector at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Type of cut at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactRegressionTree.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 313
CompactRegressionTree: property ExpandedPredictorNames

Expanded predictor names

A cell array of character vectors. It differs from
PredictorNames only when a categorical predictor has been
expanded into one column per level, which this class does not do, so
the two are always equal. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Expanded predictor names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionTree.IsBranchNode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 193
CompactRegressionTree: property IsBranchNode

Which nodes are branch nodes

A logical column vector, true for each node that carries a split and
false for each leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Which nodes are branch nodes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactRegressionTree.NodeError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
CompactRegressionTree: property NodeError

Mean squared error of each node

A column vector holding, for each node, the weighted mean squared
error of the response about the node&rsquo;s mean. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Mean squared error of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.NodeMean


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
CompactRegressionTree: property NodeMean

Mean response at each node

A column vector holding, for each node, the weighted mean of the
response over the observations that reached it. It is what
predict answers for a row that comes to rest there. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Mean response at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CompactRegressionTree.NodeProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 258
CompactRegressionTree: property NodeProbability

Probability of reaching each node

A column vector holding, for each node, the total weight of the
observations that reached it, the weights being those in W .
The root carries one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Probability of reaching each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 262
CompactRegressionTree: property NodeRisk

Risk of each node

A column vector holding, for each node, its mean squared error
weighted by the probability of reaching it, which is the squared error
the node contributes to the whole tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Risk of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.NodeSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 347
CompactRegressionTree: property NodeSize

Number of observations at each node

A column vector holding how many training observations reached each
node. A row missing the predictor its node cuts on is counted at that
node and at none below it, so a parent&rsquo;s size is not in general the
sum of its children&rsquo;s. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Number of observations at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
CompactRegressionTree.NumNodes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 299
CompactRegressionTree: property NumNodes

Number of nodes in the tree

A positive integer, the number of nodes the tree holds, branch nodes
and leaves together. Nodes are numbered as they are created, so a
parent always carries a lower number than either of its children.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of nodes in the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactRegressionTree.Parent


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 161
CompactRegressionTree: property Parent

Parent of each node

A column vector naming the parent of each node. The root carries a
zero. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Parent of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
CompactRegressionTree.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 175
CompactRegressionTree: property PredictorNames

Names of the predictor variables

A cell array of character vectors with one name per column of
X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactRegressionTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 371
CompactRegressionTree: property PruneAlpha

Cost complexity parameter of each pruning level

A column vector with one element per level of the pruning sequence,
the first of which is zero and stands for the unpruned tree. Level
L is the smallest subtree that is optimal for every complexity
parameter from PruneAlpha( L +1) up to the next one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Cost complexity parameter of each pruning level



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactRegressionTree.PruneList


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 441
CompactRegressionTree: property PruneList

Pruning level of each node

A column vector holding, for each branch node, the level of the cost
complexity sequence at which it stops being a branch node, and zero at
a leaf. Pruning the tree to level L turns every node whose
level is between one and L into a leaf. It is empty when
neither 'Prune' nor 'MergeLeaves' was asked for, since
no sequence was then estimated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Pruning level of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CompactRegressionTree.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
CompactRegressionTree: property ResponseName

Name of the response variable

A character vector naming the response. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactRegressionTree.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 292
CompactRegressionTree: property ResponseTransform

Transform applied to the predicted response

A character vector naming the function predict applies to the
response it predicts before returning it, or a function handle taking
and returning an array of the same size. The default is
'none' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
CompactRegressionTree.SurrogateCutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 182
CompactRegressionTree: property SurrogateCutCategories

Categories of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Categories of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionTree.SurrogateCutFlip


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
CompactRegressionTree: property SurrogateCutFlip

Cut assignments of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cut assignments of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactRegressionTree.SurrogateCutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
CompactRegressionTree: property SurrogateCutPoint

Cut points of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Cut points of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
CompactRegressionTree.SurrogateCutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
CompactRegressionTree: property SurrogateCutPredictor

Predictors of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Predictors of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactRegressionTree.SurrogateCutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
CompactRegressionTree: property SurrogateCutType

Types of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Types of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
CompactRegressionTree.SurrogatePredictorAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
CompactRegressionTree: property SurrogatePredictorAssociation

Predictive measures of association of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predictive measures of association of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CompactRegressionTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 761
CompactRegressionTree: L = loss ( obj , X , Y )
CompactRegressionTree: L = loss (&hellip;, name , value )

Regression loss on new data.

L = loss ( obj , X , Y ) returns the
weighted mean squared error of the response the model predicts for
X against the observed response Y . A row whose response
is missing is dropped, as it is when fitting.

L = loss (&hellip;, name , value ) takes the
following options.

Name Value
'LossFun' 'mse' , the default, or a function
handle taking the true response, the predicted response and the
weights, and returning a numeric scalar.
'Weights' A numeric vector of observation weights,
one per row of X , normalized to sum to one before it is applied.

See also:
CompactRegressionTree,
fitrtree,
CompactRegressionTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Regression loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
CompactRegressionTree.nodeVariableRange


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 498
CompactRegressionTree: r = nodeVariableRange ( obj , node )

Range of each predictor at a node.

r = nodeVariableRange ( obj , node ) returns a
structure with one field per predictor the path from the root to
node cuts on, holding the two-element range of values that reach
the node, or for a categorical predictor the levels that reach it. A
predictor the path never cuts on is unconstrained and is left out, so
the root gives a structure with no fields.

See also:
CompactRegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Range of each predictor at a node.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactRegressionTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 706
CompactRegressionTree: yFit = predict ( obj , XC )
CompactRegressionTree: [ yFit , node ] = predict (&hellip;)

Predict the response with a trained CompactRegressionTree object.

yFit = predict ( obj , XC ) sends each row of
XC down the tree and returns the mean response of the node it
comes to rest at, after ResponseTransform . XC must have
as many columns as the predictor data the model was fitted on.

[ yFit , node ] = predict (&hellip;) also returns the
number of the node each row landed in.

A row missing the predictor a node cuts on is stopped at that node and
takes its answer, rather than being sent down a branch on evidence the
row does not carry.

See also:
CompactRegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Predict the response with a trained CompactRegressionTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
CompactRegressionTree.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 706
CompactRegressionTree: imp = predictorImportance ( obj )

Estimate the importance of each predictor.

imp = predictorImportance ( obj ) returns a row
vector with one element per predictor, holding the total drop in risk
the splits on that predictor bring about, divided by the number of
branch nodes. A predictor the tree never splits on scores zero.

The drop at a branch node is its NodeRisk less the risk of its
two children and less what it holds back, so a predictor that is
chosen often, high up, and on nodes it separates well, scores highest.
The numbers are comparable between predictors of one tree and not
between trees.

See also:
CompactRegressionTree,
fitrtree,
CompactRegressionTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CompactRegressionTree.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 486
CompactRegressionTree: savemodel ( obj , filename )

Save a CompactRegressionTree model to a file.

savemodel ( obj , filename ) saves each property of a
CompactRegressionTree object into an Octave binary file, the name of
which is specified in filename , along with an extra variable,
which defines the type of regression object these variables
constitute. Use loadmodel in order to load a regression object
into Octave&rsquo;s workspace.

See also:
loadmodel,
fitrtree,
RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Save a CompactRegressionTree model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CompactRegressionTree.view


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 411
CompactRegressionTree: view ( obj )

Print the tree as text.

view ( obj ) prints one line per node: a branch node names
the predictor it cuts on, the cut point, and the node each side leads
to, and a leaf names the response it fits. A branch node&rsquo;s line ends
with the response it would fit itself, which is the answer an
observation missing that predictor gets.

See also:
CompactRegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Print the tree as text.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
CompactTreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 548
statistics: CompactTreeBagger

Compact ensemble of bagged decision trees

A CompactTreeBagger object carries the trees a TreeBagger
ensemble grew and what prediction needs, but not the observations it was
fitted on, and so none of the out-of-bag information. It predicts new
data identically to the ensemble it came from.

Create one with the compact method of a TreeBagger object.
Two compact ensembles fitted on the same classes are joined with
combine .

See also:
TreeBagger,
TreeBagger.compact,
CompactClassificationTree,
CompactRegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Compact ensemble of bagged decision trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactTreeBagger.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 251
CompactTreeBagger: property ClassNames

Names of the classes

The classes of a classification ensemble, in the type of the response
it was fitted on and in the order its scores are laid out. Empty for a
regression ensemble. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactTreeBagger.CompactTreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 234
CompactTreeBagger: obj = CompactTreeBagger ( B )

Create a CompactTreeBagger object.

B is the TreeBagger object to compact. The documented way
to reach this constructor is the compact method.

See also:
TreeBagger,
TreeBagger.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Create a CompactTreeBagger object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
CompactTreeBagger.DefaultYfit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
CompactTreeBagger: property DefaultYfit

Prediction for an observation no tree may answer for

For classification, the class of greatest prior probability, in the
type of the class names, or the missing label of that type after
setDefaultYfit with '' . For regression, the weighted
mean of the training response unless set otherwise. This property is
read-only; change it with setDefaultYfit .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Prediction for an observation no tree may answer for



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CompactTreeBagger.DeltaCriterionDecisionSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
CompactTreeBagger: property DeltaCriterionDecisionSplit

Split criterion contributions of the predictors

A row vector with one element per predictor, the mean over the trees
of each tree&rsquo;s predictorImportance . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Split criterion contributions of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactTreeBagger.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 120
CompactTreeBagger: property Method

Type of the ensemble

'classification' or 'regression' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Type of the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CompactTreeBagger.NumPredictorSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 295
CompactTreeBagger: property NumPredictorSplit

Decision splits on each predictor

A row vector with one element per predictor, the sum over the trees of
the share of each tree&rsquo;s branch nodes that split on the predictor. A
tree without branch nodes adds nothing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Decision splits on each predictor



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CompactTreeBagger.NumTrees


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
CompactTreeBagger: property NumTrees

Number of trees

A nonnegative integer, the number of trees in the ensemble. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactTreeBagger.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
CompactTreeBagger: property PredictorNames

Names of the predictors

A cell array of character vectors naming the columns of the predictor
data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
CompactTreeBagger.SurrogateAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 249
CompactTreeBagger: property SurrogateAssociation

Predictive association between the predictors

A square matrix with one row and one column per predictor. The trees
grow no surrogate splits, so it is the identity matrix. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Predictive association between the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
CompactTreeBagger.Trees


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
CompactTreeBagger: property Trees

The trees of the ensemble

A column cell array holding one CompactClassificationTree or
CompactRegressionTree object per tree. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
The trees of the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactTreeBagger.combine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 315
CompactTreeBagger: C = combine ( C1 , C2 )

Join two compact ensembles.

C holds the trees of C1 followed by those of C2 . The
two must be of the same type and, for classification, have the same
class names and the same default scores. C keeps the
DefaultYfit of C1 .

See also:
CompactTreeBagger,
TreeBagger.append


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Join two compact ensembles.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
CompactTreeBagger.error


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1305
CompactTreeBagger: err = error ( obj , X , Y )
CompactTreeBagger: err = error (&hellip;, name , value )

Misclassification probability or mean squared error of the ensemble.

For a classification ensemble err is the weighted share of the
rows of X whose predicted class differs from Y ; for a
regression ensemble it is the weighted mean squared error. By default
err is a column with one element per tree, the error of the
first tree, then of the first two, and so on.

An observation no tree may answer for is predicted as
DefaultYfit and counted; when DefaultYfit is the missing
label it has no prediction and is left out.

Name-Value arguments:

Name Value
'Mode' 'cumulative' (default),
'individual' for the error of each tree on its own, or
'ensemble' for a single error over every tree used.
'Trees' 'all' (default) or a vector of
indices of the trees to use, in the order they are accumulated.
'TreeWeights' A nonnegative vector with one
weight per tree used. It may not be given in 'individual' mode.
'UseInstanceForTree' An NxNumTrees
logical matrix saying which tree may answer for which observation.
'Weights' A nonnegative vector with one weight
per observation. The default is uniform.

See also:
CompactTreeBagger,
CompactTreeBagger.predict,
CompactTreeBagger.meanMargin,
TreeBagger.oobError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Misclassification probability or mean squared error of the ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
CompactTreeBagger.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 694
CompactTreeBagger: m = margin ( obj , X , Y )
CompactTreeBagger: m = margin (&hellip;, name , value )

Classification margin of each observation.

The margin is the score of the true class less the highest score among
the other classes. By default m has one row per observation and
one column per tree, the margin of the first tree, then of the first
two, and so on. An observation left without a prediction, as described
under CompactTreeBagger.error , has a NaN margin.

'Mode' , 'Trees' , 'TreeWeights' and
'UseInstanceForTree' are taken as by
CompactTreeBagger.error . A regression ensemble has no margins.

See also:
CompactTreeBagger,
CompactTreeBagger.meanMargin,
CompactTreeBagger.error


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification margin of each observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactTreeBagger.mdsprox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1167
CompactTreeBagger: [ S , E ] = mdsprox ( obj , X )
CompactTreeBagger: [ S , E ] = mdsprox (&hellip;, name , value )

Multidimensional scaling of the proximity matrix.

Applies classical multidimensional scaling, as cmdscale does, to
the distances 1 - prox , prox being the proximity
matrix of the rows of X . S holds the scaled coordinates,
one column per positive eigenvalue, and E the eigenvalues.

Name-Value arguments:

Name Value
'Data' 'predictors' (default) or
'proximity' , as for outlierMeasure .
'Colors' A character vector with one color
letter per class. When given, the scaled coordinates are drawn as
overlaid scatter plots, one per class, and a class beyond the number of
letters is not drawn.
'Labels' The class label of each observation,
each one of ClassNames . Classification only. Without labels
every observation is drawn in the first color.
'MDSCoordinates' Two or three indices of the
columns of S to draw. The default is [1, 2] . They must
not exceed the number of columns of S even when nothing is drawn,
as in MATLAB, whose documentation says otherwise.

See also:
CompactTreeBagger,
CompactTreeBagger.proximity,
cmdscale,
TreeBagger.mdsprox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Multidimensional scaling of the proximity matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CompactTreeBagger.meanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 428
CompactTreeBagger: mm = meanMargin ( obj , X , Y )
CompactTreeBagger: mm = meanMargin (&hellip;, name , value )

Weighted mean classification margin.

mm is the weighted mean over the observations of the margins
CompactTreeBagger.margin returns, a row with one element per
tree by default. The Name-Value arguments are those of
CompactTreeBagger.error , 'Weights' included.

See also:
CompactTreeBagger,
CompactTreeBagger.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Weighted mean classification margin.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactTreeBagger.outlierMeasure


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1141
CompactTreeBagger: out = outlierMeasure ( obj , X )
CompactTreeBagger: out = outlierMeasure (&hellip;, name , value )

Outlier measure of each observation.

The raw measure of an observation is the size of its class divided by
the sum of its squared proximities to the observations of the class,
itself included, all the observations forming one class when no labels
are given. out is a column holding, for each observation, the
absolute deviation of its raw measure from the median of its class,
divided by the median absolute deviation of the class. A large value
marks an observation that the trees seldom group with the rest of its
class. As in MATLAB, a class whose median absolute deviation is zero
gives the raw measures themselves, and a class of one or two
observations gives zeros.

Name-Value arguments:

Name Value
'Data' 'predictors' (default), for
X holding predictor data, or 'proximity' , for X
holding a proximity matrix such as proximity returns.
'Labels' The class label of each observation,
each one of ClassNames . Classification only.

See also:
CompactTreeBagger,
CompactTreeBagger.proximity,
TreeBagger.OutlierMeasure


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Outlier measure of each observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
CompactTreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1729
CompactTreeBagger: label = predict ( obj , X )
CompactTreeBagger: [ label , scores ] = predict (&hellip;)
CompactTreeBagger: [ label , scores , stdevs ] = predict (&hellip;)
CompactTreeBagger: [ Yfit , stdevs ] = predict (&hellip;)
CompactTreeBagger: &hellip; = predict (&hellip;, name , value )

Predict responses with a compact bagged ensemble.

For a classification ensemble, label holds the predicted class of
each row of X , in the type of ClassNames . scores is
an NxK matrix, the weighted average over the trees of the class
probability each tree gives, and stdevs holds their standard
deviations over the trees. The label is the class of highest score,
whatever cost matrix the trees were grown with, as MATLAB documents.

For a regression ensemble, Yfit is the weighted average of the
trees&rsquo; predictions and stdevs their standard deviation.

The standard deviations are population deviations, taken over the
trees that answer for the observation with their weights. An
observation no tree may answer for is given DefaultYfit , with
the prior as its scores and NaN as its deviations.

Name-Value arguments:

Name Value
'Trees' 'all' (default) or a vector of
indices of the trees to use.
'TreeWeights' A nonnegative vector with one
weight per tree used. The default weighs them equally.
'UseInstanceForTree' An NxNumTrees
logical matrix saying which tree may answer for which observation. The
default lets every tree answer for every observation.

MATLAB returns the labels as a cell array of character vectors whatever
the type of the response; they are returned here in the type of
ClassNames , as by every other classifier in this package.

See also:
CompactTreeBagger,
CompactTreeBagger.error,
TreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Predict responses with a compact bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
CompactTreeBagger.proximity


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 385
CompactTreeBagger: prox = proximity ( obj , X )

Proximity matrix of the observations.

prox is a symmetric NxN matrix, N being the number
of rows of X , whose element (i,j) is the share of the
trees that bring observations i and j to the same leaf.
Its diagonal holds ones.

See also:
CompactTreeBagger,
CompactTreeBagger.outlierMeasure,
CompactTreeBagger.mdsprox,
TreeBagger.fillprox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Proximity matrix of the observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
CompactTreeBagger.setDefaultYfit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 483
CompactTreeBagger: C = setDefaultYfit ( obj , Yfit )

Set the prediction for an observation no tree may answer for.

For a classification ensemble Yfit is 'MostPopular' , the
class of greatest prior probability, or '' , the missing label,
which leaves such an observation without a prediction and out of the
error and the mean margin. A logical response has no missing label.
For a regression ensemble Yfit is a numeric scalar.

See also:
CompactTreeBagger,
CompactTreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Set the prediction for an observation no tree may answer for.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 744
statistics: RegressionBaggedEnsemble

Bagged ensemble of regression trees

A RegressionBaggedEnsemble object holds regression trees each
grown on a sample drawn from the training data in proportion to the
observation weights, each split chosen from ceil (P / 3)
predictors drawn afresh at every node. It predicts by averaging its
trees.

Create one with fitrensemble and 'Method' set to
'Bag' . It carries everything a RegressionEnsemble does,
and which rows each tree drew. LSBoost that resamples, asked for with
'Resample' , 'FResample' or 'Replace' , returns this
class too: its trees are boosted and summed by their weights, each fitted
on the rows it drew.

See also:
fitrensemble,
RegressionEnsemble,
CompactRegressionEnsemble,
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Bagged ensemble of regression trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionBaggedEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 140
RegressionEnsemble: property BinEdges

Bin edges of the predictors

Always empty, binning not being implemented. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
RegressionBaggedEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 183
RegressionEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionBaggedEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
RegressionEnsemble: property CombineWeights

How the trees are combined

'WeightedSum' for LSBoost, 'WeightedAverage' for Bag.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
How the trees are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionBaggedEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
RegressionEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionBaggedEnsemble.FResample


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
RegressionBaggedEnsemble: property FResample

Share of the observations each tree draws

A number greater than 0 and no greater than 1, each tree drawing
ceil (FResample * N) observations. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Share of the observations each tree draws



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.FitInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
RegressionEnsemble: property FitInfo

Fit information

For LSBoost, a column with the weighted mean squared error of each
tree against the residual it was fitted to. Empty for Bag. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Fit information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
RegressionBaggedEnsemble.FitInfoDescription


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 100
RegressionEnsemble: property FitInfoDescription

Description of FitInfo

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Description of FitInfo



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
RegressionBaggedEnsemble.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
RegressionEnsemble: property HyperparameterOptimizationResults

Results of optimizing the hyperparameters

Always empty, such optimization not being implemented. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Results of optimizing the hyperparameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionBaggedEnsemble.LearnerNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
RegressionEnsemble: property LearnerNames

Names of the weak learners

Always {'Tree'} . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Names of the weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionBaggedEnsemble.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
RegressionEnsemble: property Method

Ensemble method

'LSBoost' or 'Bag' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Ensemble method



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionBaggedEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
RegressionEnsemble: property ModelParameters

Parameters of the fit

A structure with the fields Type , Method ,
LearnerTemplates , NLearn , the number of learning
cycles asked for in all, and for LSBoost LearnRate . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Parameters of the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionBaggedEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
RegressionEnsemble: property NumObservations

Number of observations used

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of observations used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionBaggedEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 93
RegressionEnsemble: property NumTrained

Number of trained trees

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Number of trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionBaggedEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
RegressionEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionBaggedEnsemble.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
RegressionEnsemble: property ReasonForTermination

Why the fit stopped adding trees

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Why the fit stopped adding trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
RegressionBaggedEnsemble.RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 346
RegressionBaggedEnsemble: obj = RegressionBaggedEnsemble ( X , Y )
RegressionBaggedEnsemble: obj = RegressionBaggedEnsemble (&hellip;, name , value )

Fit a bagged ensemble of regression trees.

fitrensemble with 'Method' set to 'Bag' is the
documented way in, and its help lists the options both take.

See also:
fitrensemble,
RegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Fit a bagged ensemble of regression trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionBaggedEnsemble.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
RegressionEnsemble: property Regularization

Result of regularizing the ensemble

Empty until regularize fills it with a structure of lasso
weights for the trees, and emptied again by resume . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Result of regularizing the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.Replace


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 147
RegressionBaggedEnsemble: property Replace

Whether the trees draw with replacement

A logical scalar, true by default. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Whether the trees draw with replacement



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionBaggedEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 101
RegressionEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionBaggedEnsemble.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
RegressionEnsemble: property ResponseTransform

Transform applied to the predicted response

See CompactRegressionEnsemble.ResponseTransform .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionBaggedEnsemble.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
RegressionEnsemble: property RowsUsed

Rows of the data that were used

A logical column over the rows as supplied. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Rows of the data that were used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
RegressionEnsemble: property Trained

Trained trees

A column cell array of CompactRegressionTree objects. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionBaggedEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
RegressionEnsemble: property TrainedWeights

Weights of the trained trees

A column with one weight per tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Weights of the trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
RegressionBaggedEnsemble.UseObsForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
RegressionBaggedEnsemble: property UseObsForLearner

Which observations each tree drew

An NxNumTrained logical matrix, true where a tree&rsquo;s sample holds
an observation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Which observations each tree drew



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionBaggedEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 165
RegressionEnsemble: property UsePredForLearner

Which predictors each learner uses

Always empty, as MATLAB returns it for tree learners. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionBaggedEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 125
RegressionEnsemble: property W

Observation weights

The weights given, normalized to sum to one. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionBaggedEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
RegressionEnsemble: property X

Predictor data

The predictors the ensemble was fitted on, one row per observation.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionBaggedEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
RegressionEnsemble: property Y

Response data

The response the ensemble was fitted on, a row missing a value having
been left out. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
RegressionBaggedEnsemble: CMdl = compact ( obj )

Drop the training data from a bagged regression ensemble.

Returns a CompactRegressionEnsemble , as
RegressionEnsemble.compact does.

See also:
RegressionBaggedEnsemble,
CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Drop the training data from a bagged regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionBaggedEnsemble.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
RegressionBaggedEnsemble: CVMdl = crossval ( obj )
RegressionBaggedEnsemble: CVMdl = crossval (&hellip;, name , value )

Cross-validate a bagged ensemble.

Behaves as RegressionEnsemble.crossval , returning a
RegressionPartitionedEnsemble .

See also:
RegressionBaggedEnsemble,
RegressionPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Cross-validate a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionBaggedEnsemble.cvshrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 302
RegressionBaggedEnsemble: [ vals , nlearn ] = cvshrink ( obj )
RegressionBaggedEnsemble: [ vals , nlearn ] = cvshrink (&hellip;, name , value )

Cross-validate the shrinking of a bagged ensemble.

Behaves as RegressionEnsemble.cvshrink .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.cvshrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Cross-validate the shrinking of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionBaggedEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 263
RegressionBaggedEnsemble: L = loss ( obj , X , Y )
RegressionBaggedEnsemble: L = loss (&hellip;, name , value )

Regression loss of a bagged ensemble.

Behaves as CompactRegressionEnsemble.loss .

See also:
RegressionBaggedEnsemble,
CompactRegressionEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Regression loss of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.oobLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 449
RegressionBaggedEnsemble: L = oobLoss ( obj )
RegressionBaggedEnsemble: L = oobLoss (&hellip;, name , value )

Out-of-bag regression loss.

The loss of the out-of-bag predictions against Y , weighted by
W , an observation in the sample of every tree used being left
out. 'LossFun' and 'Mode' are taken as by
CompactRegressionEnsemble.loss , and 'Learners'
restricts the trees.

See also:
RegressionBaggedEnsemble,
RegressionBaggedEnsemble.oobPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Out-of-bag regression loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
RegressionBaggedEnsemble.oobPermutedPredictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 672
RegressionBaggedEnsemble: imp = oobPermutedPredictorImportance ( obj )
RegressionBaggedEnsemble: imp = oobPermutedPredictorImportance (&hellip;, &rsquo;Learners&rsquo;, idx )

Out-of-bag predictor importance by permutation.

For each tree, the values of each predictor are permuted among the
observations out of its bag, and the tree&rsquo;s mean squared error on them,
weighted by W , is taken before and after. imp holds, for
each predictor, the mean of the rise over the trees divided by its
standard deviation over the trees, zero where the mean is zero.
'Learners' restricts the trees.

See also:
RegressionBaggedEnsemble,
RegressionBaggedEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Out-of-bag predictor importance by permutation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionBaggedEnsemble.oobPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 486
RegressionBaggedEnsemble: yfit = oobPredict ( obj )
RegressionBaggedEnsemble: yfit = oobPredict (&hellip;, &rsquo;Learners&rsquo;, idx )

Out-of-bag predictions for the training data.

Each training observation is predicted by the trees whose samples left
it out, as predict predicts it with 'UseObsForLearner'
set to ! UseObsForLearner ; one in the sample of every tree used
is NaN . 'Learners' restricts the trees.

See also:
RegressionBaggedEnsemble,
RegressionBaggedEnsemble.oobLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Out-of-bag predictions for the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionBaggedEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 295
RegressionBaggedEnsemble: yfit = predict ( obj , X )
RegressionBaggedEnsemble: yfit = predict (&hellip;, name , value )

Predict the response with a bagged regression ensemble.

Behaves as CompactRegressionEnsemble.predict .

See also:
RegressionBaggedEnsemble,
CompactRegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Predict the response with a bagged regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
RegressionBaggedEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 395
RegressionBaggedEnsemble: imp = predictorImportance ( obj )
RegressionBaggedEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

The mean over the trees of each tree&rsquo;s predictorImportance , as
CompactRegressionEnsemble.predictorImportance computes it.

See also:
RegressionBaggedEnsemble,
RegressionBaggedEnsemble.oobPermutedPredictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionBaggedEnsemble.regularize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
RegressionBaggedEnsemble: B = regularize ( obj )
RegressionBaggedEnsemble: B = regularize (&hellip;, name , value )

Find lasso weights for the trees of a bagged ensemble.

Behaves as RegressionEnsemble.regularize .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.regularize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Find lasso weights for the trees of a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionBaggedEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
RegressionBaggedEnsemble: L = resubLoss ( obj )
RegressionBaggedEnsemble: L = resubLoss (&hellip;, name , value )

Regression loss of a bagged ensemble on the training data.

Behaves as RegressionEnsemble.resubLoss .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Regression loss of a bagged ensemble on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionBaggedEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
RegressionBaggedEnsemble: yfit = resubPredict ( obj )
RegressionBaggedEnsemble: yfit = resubPredict (&hellip;, name , value )

Predict the response of the training data with a bagged ensemble.

Behaves as RegressionEnsemble.resubPredict .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Predict the response of the training data with a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionBaggedEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 348
RegressionBaggedEnsemble: B = resume ( obj , NumLearningCycles )
RegressionBaggedEnsemble: B = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more trees in a bagged regression ensemble.

Behaves as RegressionEnsemble.resume , the new trees&rsquo; samples
added to UseObsForLearner .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Grow more trees in a bagged regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionBaggedEnsemble.shrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
RegressionBaggedEnsemble: C = shrink ( obj )
RegressionBaggedEnsemble: C = shrink (&hellip;, name , value )

Keep the trees of a bagged ensemble that a lasso weight retains.

Behaves as RegressionEnsemble.shrink , returning a
CompactRegressionEnsemble .

See also:
RegressionBaggedEnsemble,
RegressionEnsemble.shrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Keep the trees of a bagged ensemble that a lasso weight retains.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 476
statistics: RegressionEnsemble

Boosted ensemble of regression trees

A RegressionEnsemble object holds the regression trees LSBoost
grew one after another, each fitted to the residual the trees before it
left, together with the data it was fitted on.

Create one with fitrensemble . A bagged ensemble is a
RegressionBaggedEnsemble , and compact returns a
CompactRegressionEnsemble without the data.

See also:
fitrensemble,
CompactRegressionEnsemble,
RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Boosted ensemble of regression trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 140
RegressionEnsemble: property BinEdges

Bin edges of the predictors

Always empty, binning not being implemented. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 183
RegressionEnsemble: property CategoricalPredictors

Indices of categorical predictors

The predictors every tree treats as categorical, empty when none
is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionEnsemble.CombineWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
RegressionEnsemble: property CombineWeights

How the trees are combined

'WeightedSum' for LSBoost, 'WeightedAverage' for Bag.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
How the trees are combined



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
RegressionEnsemble.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
RegressionEnsemble: property ExpandedPredictorNames

Names of the predictors as the learners saw them

The same as PredictorNames . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Names of the predictors as the learners saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionEnsemble.FitInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
RegressionEnsemble: property FitInfo

Fit information

For LSBoost, a column with the weighted mean squared error of each
tree against the residual it was fitted to. Empty for Bag. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Fit information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionEnsemble.FitInfoDescription


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 100
RegressionEnsemble: property FitInfoDescription

Description of FitInfo

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Description of FitInfo



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
RegressionEnsemble.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 189
RegressionEnsemble: property HyperparameterOptimizationResults

Results of optimizing the hyperparameters

Always empty, such optimization not being implemented. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Results of optimizing the hyperparameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionEnsemble.LearnerNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
RegressionEnsemble: property LearnerNames

Names of the weak learners

Always {'Tree'} . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Names of the weak learners



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionEnsemble.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
RegressionEnsemble: property Method

Ensemble method

'LSBoost' or 'Bag' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Ensemble method



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 244
RegressionEnsemble: property ModelParameters

Parameters of the fit

A structure with the fields Type , Method ,
LearnerTemplates , NLearn , the number of learning
cycles asked for in all, and for LSBoost LearnRate . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Parameters of the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
RegressionEnsemble: property NumObservations

Number of observations used

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of observations used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionEnsemble.NumTrained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 93
RegressionEnsemble: property NumTrained

Number of trained trees

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Number of trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
RegressionEnsemble: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionEnsemble.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
RegressionEnsemble: property ReasonForTermination

Why the fit stopped adding trees

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Why the fit stopped adding trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionEnsemble.RegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 364
RegressionEnsemble: obj = RegressionEnsemble ( X , Y )
RegressionEnsemble: obj = RegressionEnsemble (&hellip;, name , value )

Fit an ensemble of regression trees by LSBoost.

fitrensemble is the documented way in, and its help lists the
options both take. A bagged ensemble is fitted by
RegressionBaggedEnsemble .

See also:
fitrensemble,
RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Fit an ensemble of regression trees by LSBoost.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionEnsemble.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
RegressionEnsemble: property Regularization

Result of regularizing the ensemble

Empty until regularize fills it with a structure of lasso
weights for the trees, and emptied again by resume . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Result of regularizing the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 101
RegressionEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionEnsemble.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 142
RegressionEnsemble: property ResponseTransform

Transform applied to the predicted response

See CompactRegressionEnsemble.ResponseTransform .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionEnsemble.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
RegressionEnsemble: property RowsUsed

Rows of the data that were used

A logical column over the rows as supplied. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Rows of the data that were used



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 134
RegressionEnsemble: property Trained

Trained trees

A column cell array of CompactRegressionTree objects. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionEnsemble.TrainedWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
RegressionEnsemble: property TrainedWeights

Weights of the trained trees

A column with one weight per tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Weights of the trained trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionEnsemble.UsePredForLearner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 165
RegressionEnsemble: property UsePredForLearner

Which predictors each learner uses

Always empty, as MATLAB returns it for tree learners. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Which predictors each learner uses



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 125
RegressionEnsemble: property W

Observation weights

The weights given, normalized to sum to one. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
RegressionEnsemble: property X

Predictor data

The predictors the ensemble was fitted on, one row per observation.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
RegressionEnsemble: property Y

Response data

The response the ensemble was fitted on, a row missing a value having
been left out. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionEnsemble.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
RegressionEnsemble: CMdl = compact ( obj )

Drop the training data from a regression ensemble.

CMdl = compact ( obj ) returns a
CompactRegressionEnsemble holding the trees and what prediction
needs. It predicts new data identically.

See also:
RegressionEnsemble,
CompactRegressionEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Drop the training data from a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionEnsemble.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 550
RegressionEnsemble: CVMdl = crossval ( obj )
RegressionEnsemble: CVMdl = crossval (&hellip;, name , value )

Cross-validate an ensemble.

CVMdl = crossval ( obj ) refits the ensemble on the
training part of each of ten folds, and returns a
RegressionPartitionedEnsemble . One of 'KFold' , an
integer greater than 1, 'Holdout' , a number between 0 and 1,
'Leaveout' , 'on' for one fold per observation, or
'CVPartition' , a cvpartition object, may choose the
partition instead.

See also:
RegressionEnsemble,
RegressionPartitionedEnsemble,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Cross-validate an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionEnsemble.cvshrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1257
RegressionEnsemble: [ vals , nlearn ] = cvshrink ( obj )
RegressionEnsemble: [ vals , nlearn ] = cvshrink (&hellip;, name , value )

Cross-validate the shrinking of a regression ensemble.

[ vals , nlearn ] = cvshrink ( obj ) grows the
ensemble again on the training part of each fold, as crossval
does, regularizes it with each penalty, shrinks it at each threshold,
and predicts the fold&rsquo;s held-out observations. vals holds one row
per penalty and one column per threshold: the weighted mean squared
error pooled over every held-out observation. nlearn holds the
matching mean number of trees kept per fold.

Name Value
'Lambda' A vector of non-negative penalties. The
default is Regularization.Lambda ; an ensemble that has not been
regularized must be given one.
'Threshold' A vector of non-negative thresholds,
as shrink takes them. The default is 0.
'KFold' , 'Holdout' , 'Leaveout' ,
'CVPartition' The partition, as crossval takes
it, only one of them. The default is ten folds.
'MaxIter' , 'RelTol' As regularize
takes them.

MATLAB warns and returns empty outputs when an ensemble that has not
been regularized is given no penalties; here that is an error.

See also:
RegressionEnsemble,
RegressionEnsemble.shrink,
RegressionEnsemble.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Cross-validate the shrinking of a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 278
RegressionEnsemble: L = loss ( obj , X , Y )
RegressionEnsemble: L = loss (&hellip;, name , value )

Regression loss of an ensemble.

Behaves as CompactRegressionEnsemble.loss and takes the same
Name-Value arguments.

See also:
RegressionEnsemble,
CompactRegressionEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Regression loss of an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 309
RegressionEnsemble: yfit = predict ( obj , X )
RegressionEnsemble: yfit = predict (&hellip;, name , value )

Predict the response with a regression ensemble.

Behaves as CompactRegressionEnsemble.predict and takes the same
Name-Value arguments.

See also:
RegressionEnsemble,
CompactRegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Predict the response with a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 297
RegressionEnsemble: imp = predictorImportance ( obj )
RegressionEnsemble: [ imp , ma ] = predictorImportance ( obj )

Estimate the importance of each predictor.

Behaves as CompactRegressionEnsemble.predictorImportance .

See also:
RegressionEnsemble,
CompactRegressionEnsemble.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionEnsemble.regularize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1732
RegressionEnsemble: B = regularize ( obj )
RegressionEnsemble: B = regularize (&hellip;, name , value )

Find lasso weights for the trees of a regression ensemble.

B = regularize ( obj ) fits the training response by
the trees&rsquo; predictions with a lasso that has no intercept and whose
weights may not be negative, over a path of penalties, and returns the
ensemble with the result in Regularization . For a penalty
lambda the tree weights a minimize
sum (W .* (Y - P * a) .^ 2) / 2 + lambda * sum (a) , where P
holds one column of training predictions per tree and W is the
observation weights, which sum to one. TrainedWeights is left as
it was.

Name Value
'Lambda' A vector of non-negative penalties. The
default is 0 followed by nine values spaced evenly on a log scale from
lmax / 1000 to lmax , the smallest penalty that sets every
weight to zero, lmax = max (abs (P' * (W .* Y))) .
'MaxIter' The most passes of coordinate descent
over the trees for each penalty. The default is 1e5.
'RelTol' The descent stops after a pass in which
no weight changed by more than this times the largest weight, or this
when that weight is below one. The default is 1e-10.

Regularization is a structure with the fields Method ,
'Lasso' ; TrainedWeights , one column per penalty;
Lambda ; ResubstitutionMSE , the weighted mean squared
error of each column; and CombineWeights ,
'WeightedSum' .

MATLAB&rsquo;s solver can stop well short of the minimum at small penalties,
so its weights there differ from these, which are the minimum. Its
CombineWeights is a function handle, and it also takes
'Npass' and 'Verbose' , which are not taken here.

See also:
RegressionEnsemble,
RegressionEnsemble.shrink,
RegressionEnsemble.cvshrink,
lasso


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Find lasso weights for the trees of a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionEnsemble.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
RegressionEnsemble: L = resubLoss ( obj )
RegressionEnsemble: L = resubLoss (&hellip;, name , value )

Regression loss on the training data.

loss on X and Y , weighted by W unless
'Weights' are given.

See also:
RegressionEnsemble,
RegressionEnsemble.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Regression loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionEnsemble.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 269
RegressionEnsemble: yfit = resubPredict ( obj )
RegressionEnsemble: yfit = resubPredict (&hellip;, name , value )

Predict the response of the training data.

predict on X , taking the same Name-Value arguments.

See also:
RegressionEnsemble,
RegressionEnsemble.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Predict the response of the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 474
RegressionEnsemble: B = resume ( obj , NumLearningCycles )
RegressionEnsemble: B = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more trees.

B is the ensemble with NumLearningCycles further trees
grown as though the fit had asked for them from the start.
'NPrint' is taken as by fitrensemble . A
Regularization is emptied, its weights no longer covering every
tree; MATLAB keeps it and applies its weights to the first trees.

See also:
RegressionEnsemble,
fitrensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Grow more trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionEnsemble.shrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 980
RegressionEnsemble: C = shrink ( obj )
RegressionEnsemble: C = shrink (&hellip;, name , value )

Keep the trees a lasso weight retains.

C = shrink ( obj ) returns a
CompactRegressionEnsemble of the trees whose weight in a column
of Regularization.TrainedWeights is above a threshold, ordered
from the largest weight down, each carrying that weight and their
predictions summed. An ensemble that has not been regularized is
thresholded on its TrainedWeights and keeps its way of combining
its trees.

Name Value
'WeightColumn' The column of weights to use, a
positive integer. The default is 1.
'Threshold' A non-negative number; a tree whose
weight is not above it is dropped. The default is 0.
'Lambda' Penalties to regularize with first, as
regularize does, which also takes 'MaxIter' and
'RelTol' here.

MATLAB accepts a 'WeightColumn' that is not a whole number,
which is refused here.

See also:
RegressionEnsemble,
RegressionEnsemble.regularize,
RegressionEnsemble.cvshrink


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Keep the trees a lasso weight retains.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6392
statistics: obj = RegressionGAM ( X , Y )
statistics: obj = RegressionGAM (&hellip;, name , value )

Create a RegressionGAM class object containing a Generalized Additive
Model (GAM) for regression.

A RegressionGAM class object can store the predictors and response
data along with various parameters for the GAM model. It is recommended to
use the fitrgam function to create a RegressionGAM object.

obj = RegressionGAM ( X , Y ) returns an object of
class RegressionGAM, with matrix X containing the predictor data and
vector Y containing the continuous response data.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or variables.
X will be used to train the GAM model.

Y must be N&times;1 numeric vector containing the response data
corresponding to the predictor data in X . Y must have same
number of rows as X .

obj = RegressionGAM (&hellip;, name , value ) returns
an object of class RegressionGAM with additional properties specified by
Name-Value pair arguments listed below.

Name Value
'predictors' Predictor Variable names, specified as
a row vector cell of strings with the same length as the columns in X .
If omitted, the program will generate default variable names
(x1, x2, ..., xn) for each column in X .
'responsename' Response Variable Name, specified as
a string. If omitted, the default value is 'Y' .
'formula' (spline option) a model specification given as a
string in
the form 'Y ~ terms' where Y represents the response variable
and terms the predictor variables. The formula can be used to
specify a subset of variables for training model. For example:
'Y ~ x1 + x2 + x3 + x4 + x1:x2 + x2:x3' specifies four linear terms
for the first four columns of for predictor data, and x1:x2 and
x2:x3 specify the two interaction terms for 1st-2nd and 3rd-4th
columns respectively. Only these terms will be used for training the model,
but X must have at least as many columns as referenced in the formula.
If Predictor Variable names have been defined, then the terms in the formula
must reference to those. When 'formula' is specified, all terms used
for training the model are referenced in the IntMatrix field of the
obj class object as a matrix containing the column indexes for each
term including both the predictors and the interactions used.
'interactions' a logical matrix, a positive integer
scalar, or the string 'all' for defining the interactions between
predictor variables. When given a logical matrix, it must have the same
number of columns as X and each row corresponds to a different
interaction term combining the predictors indexed as true . Each
interaction term is appended as a column vector after the available predictor
column in X . When 'all' is defined, then all possible
combinations of interactions are appended in X before training. At the
moment, parsing a positive integer has the same effect as the 'all'
option. When 'interactions' is specified, only the interaction terms
appended to X are referenced in the IntMatrix field of the
obj class object.
'knots' (spline option) a scalar or a row vector with the
same
columns as X . It defines the knots for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 5, hence expanded to ones (1, columns (X)) * 5 . You can
parse a row vector with different number of knots for each predictor
variable to be fitted with, although not recommended.
'order' (spline option) a scalar or a row vector with the
same
columns as X . It defines the order of the polynomial when training the
GAM. As a scalar, it is expanded to a row vector. The default values is 3,
hence expanded to ones (1, columns (X)) * 3 . You can parse a row
vector with different number of polynomial order for each predictor variable
to be fitted with, although not recommended.
'dof' (spline option) a scalar or a row vector with the
same columns
as X . It defines the degrees of freedom for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 8, hence expanded to ones (1, columns (X)) * 8 . You can
parse a row vector with different degrees of freedom for each predictor
variable to be fitted with, although not recommended.
'tol' (spline option) a positive scalar to set the
tolerance for
convergence during training. By default, it is set to 1e-3 .

A row marked (spline option) belongs to the spline
engine and requires 'FitMethod', 'splines' ; passing one
under the default boosted-tree engine is an error rather than
being ignored. The boosted-tree engine&rsquo;s own options are
documented under fitrgam .

You can parse either a 'formula' or an 'interactions'
optional parameter. Parsing both parameters will result an error.
Accordingly, you can only pass up to two parameters among 'knots' ,
'order' , and 'dof' to define the required polynomial for
training the GAM model.

Two weak learners are available, selected by FitMethod .

'boostedtrees' , the default, boosts one shallow decision tree per
predictor in each round, which is the scheme MATLAB&rsquo;s generalized additive
model uses. A second phase then boosts trees over pairs of predictors,
where interactions are asked for.

'splines' boosts a smoothing spline per predictor until the
residual sum of squares changes by less than 'Tol' . It has no
MATLAB counterpart and is an Octave extension, kept because a smooth
additive fit is a genuinely different and often better answer than a
staircase of stumps. A standard deviation and a prediction interval are
available from it alone.

The two take different arguments, and an argument meant for one is refused
by the other rather than ignored.

The choice is visible in the properties. Knots , Order ,
DoF , Formula , Tol , BaseModel ,
ModelwInt and IntMatrix describe a spline fit and are empty
under the boosted-tree engine, while ModelParameters ,
ReasonForTermination , BinEdges ,
PairDetectionBinEdges and TreeModel describe a tree fit and
are empty under the spline engine.

Fitted values are not expected to equal MATLAB&rsquo;s even under
'boostedtrees' . The stopping rule and the step-reduction limit are
not recoverable from anything MATLAB reports, so this engine documents its
own; what the two share is the estimator and the reported surface, not the
arithmetic.

See also:
fitrgam,
regress,
regress_gp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 97
Create a RegressionGAM class object containing a Generalized Additive Model (GAM) for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.BaseModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 301
RegressionGAM: property BaseModel

Model without interaction terms

A structure holding the intercept, the piecewise polynomial of each
predictor, the number of backfitting cycles, the residuals and the
residual sum of squares of the model fitted without interaction
terms. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Model without interaction terms



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGAM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 471
RegressionGAM: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the model discretized it before fitting. It is empty here
and stays empty: this generalized additive model is built from splines,
which take the predictors as they are, where MATLAB&rsquo;s is built from
boosted trees and bins them. That difference is described in the class
documentation.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionGAM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
RegressionGAM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector holding the column of each predictor treated as
categorical, and empty when none is. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
RegressionGAM.DoF


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 191
RegressionGAM: property DoF

Degrees of freedom of the spline fitting

A numeric vector with one entry per predictor, the sum of its number
of knots and its order. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Degrees of freedom of the spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionGAM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
RegressionGAM: property ExpandedPredictorNames

Names of the expanded predictor variables

A cell array of character vectors naming the predictors as the model
sees them. It matches PredictorNames unless a categorical
predictor was expanded into dummy variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Names of the expanded predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 507
RegressionGAM: property FitMethod

Which engine fitted the model

A character vector, either 'boostedtrees' or
'splines' . The default is 'boostedtrees' , the scheme
MATLAB&rsquo;s generalized additive model uses. 'splines' selects
the penalised-spline engine, an Octave extension with no MATLAB
counterpart and the scheme this class fitted before version 1.9.0. The
two engines take different arguments and an argument meant for one is
refused by the other rather than ignored.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Which engine fitted the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGAM.Formula


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
RegressionGAM: property Formula

Formula of the model

A character vector naming the response and the terms of the model, as
in 'Y ~ x1 + x2 + x1:x2' , or empty when the model was not
given one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Formula of the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionGAM.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 356
RegressionGAM: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.IntMatrix


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 553
RegressionGAM: property IntMatrix

Every term the model fits

A logical matrix with one row per term and one column per predictor,
true wherever the term multiplies that predictor. A row naming one
predictor is a main effect, two an interaction, and three or more a
higher-order term. This property is read-only.

It is the complete record, where Interactions reports only the
two-way terms, in the form MATLAB reports them. It is also the form
the 'Interactions' option takes back, so passing it to the
constructor rebuilds a model over the same terms.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Every term the model fits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGAM.Interactions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 594
RegressionGAM: property Interactions

Two-way interaction terms of the fitted model

A Kx2 matrix of predictor index pairs, one row per two-way term
the model carries, and zeros (0, 2) when it carries none. It
reports what was fitted rather than what was asked for, so a count of
terms, 'all' , a logical matrix and a formula all leave the same
kind of value behind. This property is read-only.

A main effect names one predictor and a higher-order term names three
or more, and neither has a two-column form, so neither appears here.
IntMatrix remains the complete record of every term fitted.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Two-way interaction terms of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.Intercept


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 184
RegressionGAM: property Intercept

Intercept of the fitted model

A numeric scalar, the mean of the response, which every additive term
is measured against. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Intercept of the fitted model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionGAM.IsStandardDeviationFit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
RegressionGAM: property IsStandardDeviationFit

Flag for a fitted standard deviation model

A boolean flag, always false , as this class estimates the
standard deviation of a prediction from the residuals of the fit
rather than fitting a model for it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Flag for a fitted standard deviation model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionGAM.Knots


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 200
RegressionGAM: property Knots

Knots of the spline fitting

A numeric vector with one entry per predictor, the number of breaks
the spline of that predictor is fitted over. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Knots of the spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionGAM.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 359
RegressionGAM: property ModelParameters

Parameters the model was fitted with

A structure holding the fitting parameters. Under the boosted-tree
engine it carries MATLAB&rsquo;s own fields, with Type reading
'regression' ; under the spline engine it describes that scheme
instead, since none of the tree vocabulary applies to it.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Parameters the model was fitted with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.ModelwInt


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 222
RegressionGAM: property ModelwInt

Model with interaction terms

A structure of the same fields as BaseModel , for the model
fitted with the interaction terms, and empty when none was asked for.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Model with interaction terms



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionGAM.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
RegressionGAM: property NumObservations

Number of observations

A positive integer, the number of observations of the training data
the model was fitted on, rows with a missing response excluded. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGAM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 155
RegressionGAM: property NumPredictors

Number of predictors

A positive integer, the number of predictors of the training data.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionGAM.Order


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
RegressionGAM: property Order

Order of the spline fitting

A numeric vector with one entry per predictor, the polynomial order of
the spline of that predictor. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Order of the spline fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionGAM.PairDetectionBinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 483
RegressionGAM: property PairDetectionBinEdges

Bin edges used to detect interactions

A cell array with one row vector per predictor, holding the coarse cut
points the residuals of the predictor phase were laid on while pairs
were being tested. The grid is eight equal-frequency bins whatever the
sample size, as MATLAB&rsquo;s is. It is empty when the model carries no
interaction terms, and empty throughout under the spline engine, which
does not bin.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Bin edges used to detect interactions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionGAM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 205
RegressionGAM: property PredictorNames

Names of the predictor variables

A cell array of character vectors naming the predictors, in the order
they appear in the training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionGAM.ReasonForTermination


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 338
RegressionGAM: property ReasonForTermination

Why each fitting phase stopped

A structure with the fields PredictorTrees and
InteractionTrees , each saying why that phase ended. A phase
that never ran reports an empty character vector. It is empty under
the spline engine, which has no tree budget to exhaust.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Why each fitting phase stopped



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGAM.RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 542
RegressionGAM: obj = RegressionGAM ( X , Y )
RegressionGAM: obj = RegressionGAM (&hellip;, name , value )

Fit a generalized additive model for regression.

X is an N&times;P numeric matrix of predictor data, one
observation per row, and Y is the continuous response of those
N observations. The fit runs at construction, so obj
arrives fitted.

The name / value pairs the fit accepts, and the validation
each one is held to, are listed in help RegressionGAM .
fitrgam is the documented way to reach this constructor and
takes the same pairs.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Fit a generalized additive model for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGAM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionGAM: property ResponseName

Response variable name

A character vector naming the response variable Y . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionGAM.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 313
RegressionGAM: property ResponseTransform

Transformation applied to the predicted response

A function handle applied to the response the model predicts. Add or
change it using dot notation, as in
obj .ResponseTransform = 'log' or
obj .ResponseTransform = @function_handle . It defaults
to 'none' , the identity.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGAM.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 378
RegressionGAM: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the RegressionGAM model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
RegressionGAM.Tol


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
RegressionGAM: property Tol

Tolerance for convergence

A positive scalar, the largest change in the residual sum of squares
of a backfitting cycle that counts as converged. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Tolerance for convergence



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.TreeModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 420
RegressionGAM: property TreeModel

The fitted shape functions and interaction surfaces

A structure with fields ShapeValues , PairValues and
Pairs , holding what the boosted-tree engine fitted. MATLAB
exposes no equivalent, reporting its bin edges but never the values on
them, so this is an Octave extension. It is empty under the spline
engine, whose fit lives in BaseModel and ModelwInt .

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
The fitted shape functions and interaction surfaces



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionGAM.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 221
RegressionGAM: property W

Observation weights

A numeric column vector with one entry per observation used for
training, the 'Weights' normalised to sum to one, and equal
when none were given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionGAM.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 167
RegressionGAM: property X

Predictor data

A numeric matrix with one row per observation and one column per
predictor of the training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionGAM.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 146
RegressionGAM: property Y

Response data

A numeric column vector with one entry per observation of the
training data. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionGAM.addInteractions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1079
RegressionGAM: obj = addInteractions ( obj , interactions )

Add interaction terms to a fitted model.

obj = addInteractions ( obj , interactions ) fits
the interaction terms named by interactions on top of the terms
the model already carries and returns the updated model. The univariate
fit is left alone, so predict with
'IncludeInteractions' set false answers exactly as it
answered before.

interactions takes the forms the constructor&rsquo;s
'Interactions' option takes: a nonnegative integer count of
terms, a logical matrix with a column per predictor, or 'all' .

A model already carrying interaction terms is not extended, which is
what MATLAB refuses too. A model fitted from a 'Formula' names
every term it has, interactions among them, and is refused for the same
reason.

Which terms a count selects is this implementation&rsquo;s own: they are
taken in the order nchoosek lists the pairs, where MATLAB ranks
them by how much each contributes. The constructor&rsquo;s option chooses
the same way, so the two agree with each other.

See also:
fitrgam,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Add interaction terms to a fitted model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGAM.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 250
RegressionGAM: CMdl = compact ( obj )

Create a CompactRegressionGAM object.

CMdl = compact ( obj ) returns a compact version of
the model, which predicts as it does but keeps no training data.

See also:
RegressionGAM,
CompactRegressionGAM,
fitrgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Create a CompactRegressionGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGAM.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1041
RegressionGAM: CVMdl = crossval ( obj )
RegressionGAM: CVMdl = crossval (&hellip;, name , value )

Cross validate a Generalized Additive Model regression object.

CVMdl = crossval ( obj ) returns a cross-validated
model object, CVMdl , from a trained model, obj , using
10-fold cross-validation by default.

CVMdl = crossval ( obj , name , value )
specifies additional name-value pair arguments to customize the
cross-validation process.

Name Value
'KFold' Specify the number of folds to use in
k-fold cross-validation. "KFold", k , where k is an
integer greater than 1.
'Holdout' Specify the fraction of the data to
hold out for testing. "Holdout", p , where p is a
scalar in the range (0,1) .
'Leaveout' Specify whether to perform
leave-one-out cross-validation. "Leaveout", Value , where
Value is &rsquo;on&rsquo; or &rsquo;off&rsquo;.
'CVPartition' Specify a cvpartition
object used for cross-validation. "CVPartition", cv ,
where isa ( cv , "cvpartition") = 1.

See also:
fitrgam,
RegressionGAM,
cvpartition,
RegressionPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Cross validate a Generalized Additive Model regression object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 664
RegressionGAM: L = loss ( obj , X , Y )
RegressionGAM: L = loss (&hellip;, name , value )

Regression loss of a generalized additive model.

L = loss ( obj , X , Y ) returns the weighted
mean squared error of the model on the rows of X against the true
response Y .

L = loss (&hellip;, name , value ) accepts the
following name-value pairs:

"LossFun" selects the loss, either "mse" , the default,
or a function handle taking the true response, the predicted response
and the weights, and returning a numeric scalar.

"Weights" holds one weight per row of X , normalised to
sum to one before it is applied.

See also:
RegressionGAM,
fitrgam,
RegressionGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Regression loss of a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1991
RegressionGAM: yFit = predict ( obj , Xfit )
RegressionGAM: yFit = predict (&hellip;, Name , Value )
RegressionGAM: [ yFit , ySD , yInt ] = predict (&hellip;)

Predict new data points using generalized additive model regression
object.

yFit = predict ( obj , Xfit returns a vector of
predicted responses, yFit , for the predictor data in matrix
Xfit based on the Generalized Additive Model in obj .
Xfit must have the same number of features/variables as the
training data in obj . Every row is predicted. Under boosted
trees a missing value adds nothing from a main effect, and an
interaction term takes the value its trees give a row missing that
predictor, so a row missing every predictor predicts the intercept;
under splines a row holding a missing value is predicted as
NaN .

obj must be a RegressionGAM class object.

[ yFit , ySD , yInt ] = predict ( obj ,
Xfit
also returns the standard deviations, ySD , and prediction
intervals,
yInt , of the response variable yFit , evaluated at each
observation in the predictor data Xfit .

yFit = predict (&hellip;, Name , Value ) returns
the
aforementioned results with additional properties specified by
Name-Value pair arguments listed below.

Name Value
'alpha' significance level of the prediction
intervals yInt , specified as scalar in range [0,1] . The
default value is 0.05, which corresponds to 95% prediction intervals.
'includeinteractions' a boolean flag to include
interactions to predict new values based on Xfit . By default,
'includeinteractions' is true when the GAM model in
obj
contains a obj.Formula or obj.Interactions fields.
Otherwise, is set to false . If set to true when no
interactions are present in the trained model, it will result to an
error. If set to
false when using a model that includes interactions, the
predictions
will be made on the basic model without any interaction terms. This way
you can make predictions from the same GAM model without having to
retrain it.

See also:
fitrgam,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 75
Predict new data points using generalized additive model regression object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 369
RegressionGAM: L = resubLoss ( obj )
RegressionGAM: L = resubLoss (&hellip;, name , value )

Regression loss of a generalized additive model on its training data.

L = resubLoss ( obj ) returns the weighted mean
squared error of the model on the data it was fitted on. It accepts
the same Name-Value pairs as loss .

See also:
RegressionGAM,
fitrgam,
RegressionGAM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Regression loss of a generalized additive model on its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGAM.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 256
RegressionGAM: yFit = resubPredict ( obj )

Predict the training response with the model it was fitted on.

yFit = resubPredict ( obj ) is predict applied
to the observations the model was fitted on.

See also:
RegressionGAM,
fitrgam,
RegressionGAM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Predict the training response with the model it was fitted on.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionGAM.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 945
RegressionGAM: Mdl = resume ( obj , numTrees )

Resume training a generalized additive model.

Mdl = resume ( obj , numTrees ) adds
numTrees more trees to obj and returns the result. The
original model is not modified.

Training continues in the phase that ran last, which is what MATLAB
does: a model carrying interaction terms gains interaction trees and
its predictor shape functions are left alone, while a model without
them gains predictor trees. A round starts at its initial learning
rate whatever its number, so the model this returns is the model a
single fit of the combined budget would have produced.

numTrees must be a positive integer scalar. Resuming raises
where there is nothing left to gain, rather than returning the model
unchanged, and it is not available under
'FitMethod', 'splines' : a backfit that has converged to its
tolerance has no budget to extend.

See also:
RegressionGAM,
fitrgam,
RegressionGAM.addInteractions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Resume training a generalized additive model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
RegressionGAM: savemodel ( obj , filename )

Save a RegressionGAM object.

savemodel ( obj , filename ) saves a RegressionGAM
object into a file defined by filename .

See also:
loadmodel,
fitrgam,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Save a RegressionGAM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
RegressionGP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5586
statistics: obj = RegressionGP ( X , Y )
statistics: obj = RegressionGP (&hellip;, name , value )

Create a RegressionGP object containing a Gaussian process
regression model.

obj = RegressionGP ( X , Y ) returns a Gaussian
process regression model, obj , with X being the predictor data
and Y the continuous response of the observations in X .

X must be an NxP numeric matrix of predictor data, where rows
correspond to observations and columns to features.

Y must be an Nx1 numeric vector holding the response of the
corresponding predictor data in X . Y must have the same number
of rows as X .

A Gaussian process places a prior over functions, given by the covariance
function, and conditions it on the observations. The response is modelled
as H&times;Beta plus a draw from that process plus independent noise of
standard deviation Sigma , where H is the explicit basis. The
covariance parameters and Sigma are estimated by maximizing the log
marginal likelihood, and Beta follows from them in closed form as
the generalized least squares estimate.

obj = RegressionGP (&hellip;, name , value ) returns a
model with additional options specified by Name-Value pair
arguments listed below.

Name Value
'KernelFunction' A character vector naming the covariance
function, or a function handle taking two matrices of points and a parameter
vector. The default is 'squaredexponential' . The supported names
are listed below.
'KernelParameters' A numeric vector of initial values for
the covariance parameters. Its length depends on the covariance function.
These are starting values for the optimization, not fixed values.
'BasisFunction' A character vector naming the explicit
basis, one of 'none' , 'constant' , 'linear' or
'pureQuadratic' , or a function handle taking X and returning
the basis matrix. The default is 'constant' .
'Beta' A numeric vector of basis coefficients. These are
used as known values only when 'FitMethod' is 'none' .
'Sigma' A positive scalar, the initial value of the noise
standard deviation. The default is std ( Y ) / sqrt (2) .
'ConstantSigma' A logical scalar. When true the
noise standard deviation is held at its initial value instead of being
estimated. The default is false .
'SigmaLowerBound' A positive scalar bounding the noise
standard deviation from below. The default is
1e-2 * std ( Y ) .
'FitMethod' A character vector, either 'exact' to
estimate the parameters or 'none' to keep them at their initial
values. The default is 'exact' .
'PredictMethod' A character vector. Only 'exact'
is implemented, which is also the only method under which a standard
deviation and a prediction interval are available.
'Optimizer' A character vector naming the optimizer used
to maximize the log marginal likelihood. 'quasinewton' and
'fminunc' name the same dense solver and are the default,
'lbfgs' selects limited-memory BFGS, which holds a fixed number of
curvature pairs rather than a full inverse Hessian and is the cheaper
choice when the kernel carries many parameters, and 'fminsearch'
is derivative-free.
'Standardize' A logical scalar specifying whether the
predictor data should be centred and scaled before training. The same
transformation is applied by predict . The default is false .
'CategoricalPredictors' The categorical predictors, as
indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per distinct value it takes in the training data, named as in
'x1 == 2' , and the coded columns are not standardized.
X keeps the predictors as given. A row holding a value the
training data did not is predicted as a row missing a predictor, the
weighted lower median of the training response.
'Weights' An Nx1 numeric vector of non-negative
observation weights. The default is a vector of ones.
'PredictorNames' A cell array of character vectors
naming the predictors, in the order they appear in X .
'ResponseName' A character vector naming the response.
The default is 'Y' .
'ResponseTransform' A character vector or a function
handle applied to the response the model predicts. The default is
'none' .

The supported values for 'KernelFunction' are:

Value Parameters
'exponential' [SigmaL; SigmaF]
'squaredexponential' [SigmaL; SigmaF]
'matern32' [SigmaL; SigmaF]
'matern52' [SigmaL; SigmaF]
'rationalquadratic' [SigmaL; AlphaRQ; SigmaF]
'ardexponential' [LengthScale1; &hellip;; SigmaF]
'ardsquaredexponential' [LengthScale1; &hellip;; SigmaF]
'ardmatern32' [LengthScale1; &hellip;; SigmaF]
'ardmatern52' [LengthScale1; &hellip;; SigmaF]
'ardrationalquadratic' [LengthScale1; &hellip;; AlphaRQ; SigmaF]

The automatic relevance determination kernels carry one length scale per
predictor, so a predictor the response does not depend on is given a large
length scale and stops contributing.

The supported values for 'ResponseTransform' are:

Value Description
'none' x (no transformation)
'identity' x (no transformation)
'exp' exp (x)
'log' log (x)

Two deviations from MATLAB are deliberate and documented. The distance
between points is accumulated one predictor at a time instead of by the
expanded form MATLAB uses by default, because the expanded form does not
return exactly zero for a point against itself and the rough kernels
amplify that residue through their square root. The approximate fitting
and prediction methods, 'sd' , 'sr' , 'fic' and
'bcd' , together with the active set options that serve them, are
not implemented and are refused rather than silently ignored.

See also:
fitrgp,
CompactRegressionGP,
RegressionSVM,
RegressionGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 76
Create a RegressionGP object containing a Gaussian process regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionGP.ActiveSetHistory


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
RegressionGP: property ActiveSetHistory

History of the active set selection

Always empty. It is declared for MATLAB compatibility, where
it records the active set chosen at each iteration by a fit method that
builds one. This class implements the exact method alone, which uses
the whole of the training data and selects nothing, so there is no
history to record. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
History of the active set selection



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionGP.ActiveSetMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
RegressionGP: property ActiveSetMethod

Method used to select the active set

'Random' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Method used to select the active set



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGP.ActiveSetSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
RegressionGP: property ActiveSetSize

Size of the active set

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Size of the active set



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionGP.ActiveSetVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 281
RegressionGP: property ActiveSetVectors

Subset of the training data used for predictions

An MxP numeric matrix, standardized where the model standardized
its predictors. It is the whole of the training data, since only the
exact method is implemented. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Subset of the training data used for predictions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionGP.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
RegressionGP: property Alpha

Weights the predictions are made from

An Nx1 numeric vector. A prediction is the basis term plus the
covariance between the new point and the active set, weighted by these.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Weights the predictions are made from



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGP.BCDInformation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
RegressionGP: property BCDInformation

Block coordinate descent information

Always empty. It is declared for MATLAB compatibility, where
it records a block coordinate descent. This class does not use that
method, so there is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Block coordinate descent information



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGP.BasisFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
RegressionGP: property BasisFunction

Explicit basis of the model

'None' , 'Constant' , 'Linear' ,
'PureQuadratic' , or the function handle that was supplied. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Explicit basis of the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
RegressionGP.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 185
RegressionGP: property Beta

Estimated coefficients of the explicit basis

A numeric vector with one element per basis term, empty when the basis
is 'None' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Estimated coefficients of the explicit basis



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGP.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 308
RegressionGP: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the model discretized it before fitting. It is empty here
and stays empty: a Gaussian process takes its predictors as they are.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionGP.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
RegressionGP: property CategoricalPredictors

Indices of the categorical predictors

A vector of positive integers indexing the columns of X that
hold categorical predictors, or empty when none does. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionGP.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 254
RegressionGP: property ExpandedPredictorNames

Expanded predictor variable names

A cell array of character vectors. It differs from
PredictorNames only where a categorical predictor has been
expanded into indicator variables. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Expanded predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGP.FitMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
RegressionGP: property FitMethod

Method used to estimate the parameters

'Exact' when the covariance parameters and the noise were
estimated by maximizing the log marginal likelihood, and 'None'
when they were kept at their initial values. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Method used to estimate the parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
RegressionGP.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 355
RegressionGP: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionGP.IsActiveSetVector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
RegressionGP: property IsActiveSetVector

Which observations are in the active set

A logical vector with one element per training observation. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Which observations are in the active set



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGP.KernelFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 192
RegressionGP: property KernelFunction

Form of the covariance function

A character vector naming the covariance function, or the function
handle that was supplied. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Form of the covariance function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionGP.KernelInformation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
RegressionGP: property KernelInformation

Covariance function and its parameters

A structure with fields Name , KernelParameters and
KernelParameterNames , the last naming each parameter in the
order they are stored. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Covariance function and its parameters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGP.LogLikelihood


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
RegressionGP: property LogLikelihood

Maximized log marginal likelihood

A scalar, or empty when FitMethod is 'None' and nothing
was maximized. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Maximized log marginal likelihood



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionGP.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1121
RegressionGP: property ModelParameters

Parameters used to train the model

A structure holding the options the fit was performed under. MATLAB
returns an object of its own class here; a structure carries the same
information and is what every other learner in this package returns.

Beta , Sigma and KernelParameters are the
starting values the fit was given, empty or zero where it was
given none, as they are in MATLAB. What the fit found is reported by
the Beta and Sigma properties and by
KernelInformation . Beta defaults to a zero for every
column the basis contributes, so a 'linear' basis over three
predictors starts at four zeros.

SigmaLowerBound is the exception and is reported as it was
resolved. MATLAB publishes no top-level field of that name, keeping
it inside an Options structure this class does not carry.

The fields MATLAB reports for its approximate fitting methods
( ActiveSet , Options , OptimizerOptions ,
ConstantKernelParameters , InitialStepSize ,
InitialSigmaLowerBoundTolerance , Verbose and
CacheSize ) are absent, this class implementing exact fitting
alone. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Parameters used to train the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionGP.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
RegressionGP: property NumObservations

Number of observations used to train the model

A positive integer scalar, counting the rows whose response is not
missing. A row missing a predictor is counted, as in MATLAB, though the
fit leaves it out. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Number of observations used to train the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionGP.PredictMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
RegressionGP: property PredictMethod

Method used to make predictions

'Exact' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Method used to make predictions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionGP.PredictorLocation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
RegressionGP: property PredictorLocation

Means the predictors were centred by

A 1xP numeric vector when the model standardized its predictors,
and empty when it did not. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Means the predictors were centred by



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGP.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 149
RegressionGP: property PredictorNames

Predictor variable names

A cell array of character vectors, one per column of X . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Predictor variable names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionGP.PredictorScale


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 209
RegressionGP: property PredictorScale

Standard deviations the predictors were scaled by

A 1xP numeric vector when the model standardized its predictors,
and empty when it did not. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Standard deviations the predictors were scaled by



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionGP.RegressionGP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 528
RegressionGP: obj = RegressionGP ( X , Y )
RegressionGP: obj = RegressionGP (&hellip;, name , value )

Fit a Gaussian process regression model.

X is an N&times;P numeric matrix of predictor data, one
observation per row, and Y is the continuous response of those
N observations. The fit runs at construction, so obj
arrives fitted.

The name / value pairs the fit accepts, and the validation
each one is held to, are listed in help RegressionGP .
fitrgp is the documented way to reach this constructor and
takes the same pairs.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Fit a Gaussian process regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionGP.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
RegressionGP: property ResponseName

Response variable name

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Response variable name



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionGP.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
RegressionGP: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied. Assigning to it accepts either.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGP.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
RegressionGP: property RowsUsed

Rows of the original data used to train the model

A logical vector with one element per row of the data as supplied, true
where the row was used, false where its response was missing. It is
empty when no row was dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Rows of the original data used to train the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionGP.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
RegressionGP: property Sigma

Estimated noise standard deviation

A positive scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Estimated noise standard deviation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
RegressionGP.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 149
RegressionGP: property W

Observation weights

An Nx1 numeric vector, one weight per observation used to train
the model. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
RegressionGP.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 131
RegressionGP: property X

Predictor data

An NxP numeric matrix, as it was supplied to the constructor.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
RegressionGP.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionGP: property Y

Response data

An Nx1 numeric vector, as it was supplied to the constructor.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionGP.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 282
RegressionGP: CMdl = compact ( obj )

Return a compact Gaussian process regression model.

CMdl = compact ( obj ) returns a
CompactRegressionGP object holding what is needed to predict
and nothing else: the training data, the response and everything that
describes them are dropped.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Return a compact Gaussian process regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionGP.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 395
RegressionGP: CVMdl = crossval ( obj )
RegressionGP: CVMdl = crossval (&hellip;, name , value )

Cross validate a Gaussian process model.

CVMdl = crossval ( obj ) returns a
RegressionPartitionedModel built from the model obj by
ten-fold cross validation.

CVMdl = crossval (&hellip;, name , value ) accepts
'KFold' , 'Holdout' , 'Leaveout' and
'CVPartition' , of which at most one may be given.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Cross validate a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
RegressionGP.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 472
RegressionGP: L = loss ( obj , X , Y )
RegressionGP: L = loss (&hellip;, name , value )

Compute the regression loss of a Gaussian process model.

L = loss ( obj , X , Y ) returns the mean
squared error of the model obj on the data X and Y .

L = loss (&hellip;, name , value ) accepts
'LossFun' , either 'mse' , 'mae' ,
'epsiloninsensitive' or a function handle taking the observed
and the predicted response, and 'Weights' , a vector of
non-negative observation weights.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Compute the regression loss of a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionGP.postFitStatistics


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 571
RegressionGP: [ loores , neff ] = postFitStatistics ( obj )

Compute the leave-one-out residuals of a Gaussian process model.

[ loores , neff ] = postFitStatistics ( obj )
returns the Nx1 vector of leave-one-out residuals of the model
obj , and the number of effective parameters the fit uses. Neither
requires refitting the model: both follow from the factorization the fit
already produced.

The coefficients of the explicit basis are treated as estimated, which
is what FitMethod 'Exact' makes them, while the
covariance parameters and the noise are treated as known.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Compute the leave-one-out residuals of a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionGP.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 954
RegressionGP: yFit = predict ( obj , XC )
RegressionGP: [ yFit , ySD , yInt ] = predict ( obj , XC )
RegressionGP: [&hellip;] = predict (&hellip;, 'Alpha' , alpha )

Predict the response for new data with a Gaussian process model.

yFit = predict ( obj , XC ) returns the predicted
response of the RegressionGP model obj at the points in
XC , which must have as many columns as the model has predictors.

[ yFit , ySD , yInt ] = predict (&hellip;) also
returns the standard deviation of each predicted response and the
prediction intervals. The standard deviation is that of a new
response , so it carries the noise as well as the uncertainty of
the latent function, and the interval is the normal quantile of the
level times it.

[&hellip;] = predict (&hellip;, 'Alpha' , alpha ) sets
the significance level of the intervals, so that they are
100 &times; (1 - alpha ) per cent intervals. alpha must be
a scalar in the range [0, 1] and defaults to 0.05 .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Predict the response for new data with a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGP.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 287
RegressionGP: L = resubLoss ( obj )
RegressionGP: L = resubLoss (&hellip;, name , value )

Compute the resubstitution loss of a Gaussian process model.

L = resubLoss ( obj ) returns the loss of the model
obj on the data it was trained on, and accepts the same
Name-Value pairs as loss .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 60
Compute the resubstitution loss of a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionGP.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 333
RegressionGP: yFit = resubPredict ( obj )
RegressionGP: [ yFit , ySD , yInt ] = resubPredict ( obj )

Predict the response of the training data with a Gaussian process model.

yFit = resubPredict ( obj ) returns the response the
RegressionGP model obj predicts at its own training data,
and the further outputs are those of predict .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Predict the response of the training data with a Gaussian process model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionGP.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 183
RegressionGP: savemodel ( obj , filename )

Save a Gaussian process model to a file.

savemodel ( obj , filename ) saves the model obj
into filename in a form loadmodel can read back.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Save a Gaussian process model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1288
statistics: RegressionKernel

Gaussian kernel regression model for large data.

A RegressionKernel object maps the predictors into a randomized
feature space whose inner product approximates a Gaussian kernel, and then
fits a linear model there. A kernel regression is therefore as nonlinear
as a support vector machine with a Gaussian kernel, while costing what a
linear fit costs: nothing of size NxN is ever formed.

The expansion is the random Fourier basis of Rahimi and Recht, drawn once
when the model is fitted and kept with it, so predict maps new data
through the same basis. MATLAB approximates the same kernel by the
Fastfood construction, which reaches the same distribution more cheaply;
the two are interchangeable in distribution but not draw by draw, and the
draws come from different generators in any case, so the predictions of a
model fitted here and one fitted in MATLAB differ even from the same seed.
What does not differ is what they estimate.

Like RegressionLinear the object holds no copy of the training
data. It does hold the basis and the coefficients, so it is bounded by
the number of expansion dimensions rather than by the number of
observations.

Create a RegressionKernel object with fitrkernel .

See also:
fitrkernel,
RegressionLinear,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Gaussian kernel regression model for large data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionKernel.BoxConstraint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
RegressionKernel: property BoxConstraint

Box constraint of the support vector machine

A positive scalar. It is the reciprocal of the product of
Lambda and the number of observations, so setting either of
the two in the constructor fixes the other, and giving both is an
error. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Box constraint of the support vector machine



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionKernel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
RegressionKernel: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionKernel.Epsilon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 362
RegressionKernel: property Epsilon

Half the width of the epsilon-insensitive band

A nonnegative scalar for a support vector machine, and empty for a
least squares fit, which has no such band. It defaults to the
interquartile range of the response over 13.49, an estimate of its
standard deviation, or to 0.1 when that range is zero. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Half the width of the epsilon-insensitive band



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionKernel.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 321
RegressionKernel: property ExpandedPredictorNames

Names of the predictors as the fit saw them

A cell array of character vectors. It equals PredictorNames
unless categorical predictors were dummy coded, each then named once
per level, as in 'x1 == 2' . The expansion dimensions have no
names. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Names of the predictors as the fit saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionKernel.FittedLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 184
RegressionKernel: property FittedLoss

Loss function the fit minimized

'epsiloninsensitive' for a support vector machine and
'mse' for a least squares fit. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Loss function the fit minimized



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionKernel.KernelScale


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 225
RegressionKernel: property KernelScale

Scale of the Gaussian kernel

A positive scalar dividing every predictor before the expansion, so a
larger scale makes the kernel wider and the fit smoother. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Scale of the Gaussian kernel



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionKernel.Lambda


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
RegressionKernel: property Lambda

Regularization strength

A nonnegative scalar, the reciprocal of the product of
BoxConstraint and the number of observations. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Regularization strength



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionKernel.Learner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
RegressionKernel: property Learner

Linear model fitted in the expanded space

Either 'svm' or 'leastsquares' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Linear model fitted in the expanded space



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionKernel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 233
RegressionKernel: property ModelParameters

Fitting options, as they were given

A structure holding every parameter of the fit, with the
'auto' values as they were given rather than as they were
resolved. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionKernel.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 198
RegressionKernel: property Mu

Predictor means used to standardize

A row vector with one element per predictor, or empty when the model
was fitted without standardizing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Predictor means used to standardize



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionKernel.NumExpansionDimensions


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 341
RegressionKernel: property NumExpansionDimensions

Number of dimensions of the expanded space

A positive integer scalar. It defaults to
2 .^ ceil (min (log2 ( p ) + 5, 15)) for p
predictors, so four predictors give 128 dimensions. More dimensions
approximate the kernel more closely and cost proportionally more.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Number of dimensions of the expanded space



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionKernel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
RegressionKernel: property PredictorNames

Names of the predictors

A cell array of character vectors with one name per column of the
training data, defaulting to 'x1' , 'x2' and so on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionKernel.RegressionKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2413
RegressionKernel: obj = RegressionKernel ( X , Y )
RegressionKernel: obj = RegressionKernel (&hellip;, name , value )

Fit a Gaussian kernel regression model.

obj = RegressionKernel ( X , Y ) fits a support
vector machine in a randomized Gaussian kernel space to the NxP
predictor matrix X and the Nx1 continuous response
Y .

obj = RegressionKernel (&hellip;, name , value )
takes the following Name-Value pairs.

Name Value
'Learner' 'svm' , the default, or
'leastsquares' .
'Epsilon' Half the width of the insensitive band,
a nonnegative scalar or 'auto' , which is the interquartile
range of Y over 13.49. It applies to a support vector machine
alone.
'NumExpansionDimensions' 'auto' , the
default, or a positive integer.
'KernelScale' 1 by default, a positive
scalar, or 'auto' , which takes the median distance between the
observations.
'Lambda' 'auto' , the default, which is the
reciprocal of the number of observations, or a nonnegative scalar. It
cannot be given beside 'BoxConstraint' .
'BoxConstraint' A positive scalar, 1 by
default. It applies to a support vector machine alone.
'Standardize' Whether to centre and scale the
predictors, false by default.
'BetaTolerance' Relative tolerance on the
coefficients, 1e-4 by default.
'GradientTolerance' Absolute tolerance on the
gradient&rsquo;s infinity norm, 1e-6 by default.
'IterationLimit' Largest number of iterations,
1000 by default.
'HessianHistorySize' Number of curvature pairs the
solver keeps, 15 by default.
'BlockSize' Memory the expansion may occupy, in
megabytes, 4e3 by default.
'ResponseTransform' A transformation applied to the
predicted response, named or given as a function handle.
'Weights' One nonnegative weight per observation.
'PredictorNames' One name per predictor.
'ResponseName' A name for the response.
'CategoricalPredictors' The categorical predictors,
as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros
and ones per distinct value it takes in the training data, named as in
'x1 == 2' , and the coded columns are not standardized. A row
holding a value the training data did not is predicted as a row
missing a predictor, the weighted lower median of the training response.

The fit is always by limited-memory BFGS, the only solver MATLAB
offers a kernel model, and always under a ridge penalty.

See also:
fitrkernel,
RegressionLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Fit a Gaussian kernel regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionKernel.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 209
RegressionKernel: property Regularization

Penalty on the coefficients

Always 'ridge (L2)' : a kernel model fits in the expanded
space, where a lasso penalty has nothing to select. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Penalty on the coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionKernel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionKernel: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionKernel.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
RegressionKernel: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied. Assigning to it accepts either.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionKernel.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
RegressionKernel: property Sigma

Predictor standard deviations used to standardize

A row vector with one element per predictor, or empty when the model
was fitted without standardizing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Predictor standard deviations used to standardize



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionKernel.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 412
RegressionKernel: l = loss ( obj , X , Y )
RegressionKernel: l = loss (&hellip;, name , value )

Regression loss on new data.

l = loss ( obj , X , Y ) returns the mean
squared error.

l = loss (&hellip;, name , value ) takes
'LossFun' , either 'mse' or
'epsiloninsensitive' , and 'Weights' . The
epsilon-insensitive loss needs a band to be insensitive within, so it
is offered by a support vector machine alone.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Regression loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionKernel.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 248
RegressionKernel: yFit = predict ( obj , XC )

Predict the response of new observations.

yFit = predict ( obj , XC ) maps each row of
XC through the model&rsquo;s own random basis and returns the
predicted response, with ResponseTransform applied.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Predict the response of new observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionKernel.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 841
RegressionKernel: obj = resume ( obj , X , Y )
RegressionKernel: obj = resume (&hellip;, name , value )

Continue fitting a kernel regression model.

obj = resume ( obj , X , Y ) restarts the
optimization from the coefficients the model already carries, through
the basis it already holds. It takes 'BetaTolerance' ,
'GradientTolerance' and 'IterationLimit' , each
defaulting to what the model was fitted with, and 'Weights' .

X and Y must be the data the model was fitted to; the
object keeps no copy of them, which is what makes it small. Neither
does it keep the observation weights, so a model fitted with
'Weights' must be given them again here or it will resume
against uniform ones. MATLAB behaves the same way: measured on
R2024a, resuming a weighted fit without passing the weights back
reaches the objective of the unweighted fit.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Continue fitting a kernel regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionKernel.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
RegressionKernel: savemodel ( obj , filename )

Save a kernel regression model to a file.

savemodel ( obj , filename ) saves the model
obj into filename in a form loadmodel can read
back, the random basis included.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Save a kernel regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1080
statistics: RegressionLinear

Linear regression model for high dimensional data.

A RegressionLinear object fits a linear model,
X * Beta + Bias , to a continuous response by minimizing a
regularized average loss. The loss is the epsilon-insensitive loss for a
support vector machine and the squared error for a least squares fit, and
the penalty is either a ridge or a lasso one.

Unlike the other regression models of this package the object holds no
copy of the training data: the coefficients, the intercept and the fitting
options are the whole model. That is what makes it suited to data with
more predictors than a kernel matrix could carry, and it is why the class
has no compact method and no resubstitution methods.

A vector of regularization strengths fits one model per value in a single
object. Beta is then a PxL matrix and Bias a
1xL row, every method returns one column per strength, and
selectModels narrows the object down to the strengths worth
keeping.

Create a RegressionLinear object with fitrlinear .

See also:
fitrlinear,
RegressionKernel,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Linear regression model for high dimensional data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionLinear.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 195
RegressionLinear: property Beta

Fitted linear coefficients

A Px1 column, or a PxL matrix with one column per
regularization strength when Lambda holds more than one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Fitted linear coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionLinear.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
RegressionLinear: property Bias

Fitted intercept

A scalar, or a 1xL row with one element per regularization
strength. It is zero throughout when the model was fitted with
'FitBias' set to false. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Fitted intercept



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionLinear.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
RegressionLinear: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionLinear.Epsilon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 362
RegressionLinear: property Epsilon

Half the width of the epsilon-insensitive band

A nonnegative scalar for a support vector machine, and empty for a
least squares fit, which has no such band. It defaults to the
interquartile range of the response over 13.49, an estimate of its
standard deviation, or to 0.1 when that range is zero. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Half the width of the epsilon-insensitive band



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionLinear.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 253
RegressionLinear: property ExpandedPredictorNames

Names of the predictors as the fit saw them

A cell array of character vectors. It equals PredictorNames
unless categorical predictors were expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Names of the predictors as the fit saw them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionLinear.FittedLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 278
RegressionLinear: property FittedLoss

Loss function the fit minimized

'epsiloninsensitive' for a support vector machine and
'mse' for a least squares fit. This is the loss of the
objective, which is not the loss loss reports unless it is
asked for. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Loss function the fit minimized



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionLinear.Lambda


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
RegressionLinear: property Lambda

Regularization strength

A nonnegative scalar, or a 1xL row of them in ascending order.
It defaults to the reciprocal of the number of observations used to
train the model. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Regularization strength



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionLinear.Learner


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
RegressionLinear: property Learner

Linear regression model that was fitted

Either 'svm' or 'leastsquares' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Linear regression model that was fitted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionLinear.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
RegressionLinear: property ModelParameters

Fitting options, as they were given

A structure holding every parameter of the fit, including the ones
that a different solver would have used and the 'auto' values
before they were resolved. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fitting options, as they were given



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionLinear.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
RegressionLinear: property PredictorNames

Names of the predictors

A cell array of character vectors with one name per column of the
training data, defaulting to 'x1' , 'x2' and so on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionLinear.RegressionLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3598
RegressionLinear: obj = RegressionLinear ( X , Y )
RegressionLinear: obj = RegressionLinear (&hellip;, name , value )

Fit a linear regression model.

obj = RegressionLinear ( X , Y ) fits a linear
support vector machine to the NxP predictor matrix X and
the Nx1 continuous response Y .

obj = RegressionLinear (&hellip;, name ,
value ) takes the following Name-Value pairs.

Name Value
'Learner' 'svm' , the default, or
'leastsquares' . The first minimizes the epsilon-insensitive
loss and the second the squared error.
'Epsilon' Half the width of the insensitive band,
a nonnegative scalar or 'auto' , which is the interquartile
range of Y over 13.49. It applies to a support vector machine
alone.
'Regularization' 'ridge' or
'lasso' . It defaults to 'lasso' when the solver is
'sparsa' and to 'ridge' otherwise.
'Lambda' 'auto' , the default, which is the
reciprocal of the number of observations, or a nonnegative scalar, or
a vector of them. A vector fits one model per value.
'Solver' One of 'sgd' , 'asgd' ,
'dual' , 'bfgs' , 'lbfgs' and 'sparsa' ,
or a cell array of them applied in turn, each warm starting the next.
'Beta' Initial coefficients, a Px1 column or
a PxL matrix. It defaults to zeros.
'Bias' Initial intercept, a scalar or a 1xL
row. It defaults to the weighted mean of Y for a least squares
fit and to its weighted median for a support vector machine.
'FitBias' Whether to fit an intercept at all, true
by default.
'PostFitBias' Whether to refit the intercept once
the coefficients are settled, false by default.
'ObservationsIn' 'rows' , the default, or
'columns' , which transposes X before fitting.
'BetaTolerance' Relative tolerance on the
coefficients, 1e-4 by default.
'GradientTolerance' Absolute tolerance on the
gradient&rsquo;s infinity norm, 1e-6 by default.
'DeltaGradientTolerance' Tolerance on the
complementarity gap of the 'dual' solver, 0.1 by
default.
'IterationLimit' Largest number of iterations,
1000 by default.
'PassLimit' Largest number of passes over the data
for the stochastic solvers, 1 by default, and 10 for
'dual' .
'BatchSize' Mini-batch size of the stochastic
solvers, 10 by default.
'BatchLimit' Largest number of mini-batches.
'LearnRate' Step size of the stochastic solvers.
'OptimizeLearnRate' Whether to halve the step size
when the objective rises, true by default.
'TruncationPeriod' Number of mini-batches between
soft thresholdings under a lasso penalty, 10 by default.
'NumCheckConvergence' Number of passes between
convergence checks of the 'dual' solver, 2 by
default. MathWorks documents 5 ; R2024a and R2026a both
report 2 .
'HessianHistorySize' Number of curvature pairs the
quasi-Newton solvers keep, 15 by default.
'ResponseTransform' A transformation applied to the
predicted response, named or given as a function handle.
'Weights' One nonnegative weight per observation.
'PredictorNames' One name per predictor.
'ResponseName' A name for the response.
'CategoricalPredictors' The categorical predictors,
as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros
and ones per distinct value it takes in the training data, named as in
'x1 == 2' . A row holding a value the training data did not
is predicted as a row missing a predictor, the weighted lower median
of the training response.

The default solver is 'sparsa' under a lasso penalty. Under a
ridge penalty it is 'bfgs' when there are no more than 100
predictors, and beyond that 'dual' for a support vector
machine and 'sgd' for a least squares fit.

See also:
fitrlinear,
RegressionKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Fit a linear regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionLinear.Regularization


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionLinear: property Regularization

Penalty on the coefficients

'ridge (L2)' or 'lasso (L1)' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Penalty on the coefficients



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionLinear.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionLinear: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionLinear.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
RegressionLinear: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied. Assigning to it accepts either.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionLinear.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 451
RegressionLinear: l = loss ( obj , X , Y )
RegressionLinear: l = loss (&hellip;, name , value )

Regression loss on new data.

l = loss ( obj , X , Y ) returns the mean
squared error, one value per regularization strength.

l = loss (&hellip;, name , value ) takes
'LossFun' , either 'mse' or
'epsiloninsensitive' , and 'Weights' . The
epsilon-insensitive loss needs a band to be insensitive within, so it
is offered by a support vector machine alone.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Regression loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionLinear.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 249
RegressionLinear: yFit = predict ( obj , XC )

Predict the response of new observations.

yFit = predict ( obj , XC ) returns one
predicted value per row of XC , and one column per regularization
strength. ResponseTransform is applied to the result.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Predict the response of new observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionLinear.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
RegressionLinear: savemodel ( obj , filename )

Save a linear regression model to a file.

savemodel ( obj , filename ) saves the model
obj into filename in a form loadmodel can read
back.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Save a linear regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionLinear.selectModels


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 255
RegressionLinear: sub = selectModels ( obj , idx )

Keep a subset of the fitted regularization strengths.

sub = selectModels ( obj , idx ) returns a model
holding only the strengths idx names, which may be indices into
Lambda or a logical vector over it.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Keep a subset of the fitted regularization strengths.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4938
statistics: obj = RegressionNeuralNetwork ( X , Y )
statistics: obj = RegressionNeuralNetwork (&hellip;, name , value )

Create a RegressionNeuralNetwork object containing a neural network
regression model.

obj = RegressionNeuralNetwork ( X , Y ) returns a
neural network regression model, obj , with X being the predictor
data and Y the continuous response of the observations in X .

X must be an NxP numeric matrix of predictor data, where rows
correspond to observations and columns to features.

Y must be an Nx1 numeric vector holding the response of the
corresponding predictor data in X . Y must have the same number
of rows as X .

The network is trained against the mean squared error, and its output layer
applies the identity, so a prediction is an unrestricted real number rather
than a score over classes. This is the only difference in the engine
between this class and ClassificationNeuralNetwork ; everything else,
the layer sizes, the activations, the learning rate and the initialisation,
behaves identically.

obj = RegressionNeuralNetwork (&hellip;, name ,
value ) returns a model with additional options specified by
Name-Value pair arguments listed below.

Name Value
'Standardize' A logical scalar specifying whether the
predictor data should be centred and scaled before training. The same
transformation is applied by predict . The default is false .
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not is predicted as a
row missing a predictor, the lower median of the training response.
'PredictorNames' A cell array of character vectors
naming the predictors, in the order they appear in X .
'ResponseName' A character vector naming the response.
The default is 'Y' .
'ResponseTransform' A character vector naming one of the
supported transformations, or a function handle, applied to the predicted
response by predict and resubPredict . The default is
'none' .
'LayerSizes' A positive integer vector specifying the
number of units in each fully connected hidden layer. The default is 10,
one hidden layer of ten units.
'Activations' A character vector or cell array of
character vectors specifying the activation of the hidden layers. The
supported functions are 'linear' , 'sigmoid' ,
'relu' , 'tanh' , 'lrelu' , 'prelu' ,
'elu' , 'gelu' and 'none' . The default is
'relu' .
'OutputLayerActivation' A character vector specifying
the activation of the output layer. The default is 'none' , the
identity, which is what a regression output calls for. The supported
values are the same as for 'Activations' .
'LearningRate' A positive scalar specifying the learning
rate for gradient descent. The default is 0.003. A larger rate can drive
every unit of a hidden layer negative, after which a rectifier passes no
gradient and the network stops training.
Applies only when 'Solver' is 'sgd' .
'Solver' A character vector naming the solver that
trains the network, either 'lbfgs' or 'sgd' . The
default is 'lbfgs' , which minimizes the loss over the whole
training set at once by limited-memory BFGS, as MATLAB does. It takes
no learning rate, stops on the three tolerances below, and reaches a
lower training loss in fewer passes over the data, though each of its
iterations costs several passes where an epoch costs one.
'sgd' visits the samples one at a time and steps down the
gradient of each, running for 'IterationLimit' epochs; it was
the default before version 1.9.0.
'GradientTolerance' A nonnegative scalar. Training
stops once the gradient&rsquo;s infinity norm falls to or below it, which is
the quantity MATLAB tests too. The default is 1e-6 . Applies
only when 'Solver' is 'lbfgs' .
'StepTolerance' A nonnegative scalar. Training
stops once the step&rsquo;s infinity norm falls to or below it, which is the
quantity MATLAB tests too. The default is 1e-6 . Applies only
when 'Solver' is 'lbfgs' .
'LossTolerance' A real scalar. Training stops once
the training loss falls to or below it. The test is on the loss
itself and not on its change, matching MATLAB; pass -Inf to
switch it off. The default is 1e-6 . Applies only when
'Solver' is 'lbfgs' .
'IterationLimit' A positive integer specifying the
maximum number of training iterations. The default is 1000.
Under 'sgd' this counts epochs, under
'lbfgs' solver iterations.
'DisplayInfo' A logical scalar specifying whether to
print information during training. The default is false .

The supported values for 'ResponseTransform' are:

Value Description
'none' x (no transformation)
'identity' x (no transformation)
'exp' exp (x)
'log' log (x)

See also:
fitrnet,
ClassificationNeuralNetwork,
fcnntrain,
fcnnpredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 85
Create a RegressionNeuralNetwork object containing a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionNeuralNetwork.Activations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 239
RegressionNeuralNetwork: property Activations

Activation functions of the hidden layers

A character vector, applying to every hidden layer, or a cell array of
character vectors with one entry per hidden layer. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Activation functions of the hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionNeuralNetwork.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 371
RegressionNeuralNetwork: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionNeuralNetwork.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
RegressionNeuralNetwork: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices into X naming the predictors
treated as categorical, and empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionNeuralNetwork.ConvergenceInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 578
RegressionNeuralNetwork: property ConvergenceInfo

Information recorded during training

A structure with the fields Time , the seconds training took, and
TrainingLoss , the mean squared error of the network at the end of
each iteration. This property is read-only.

Under 'lbfgs' the structure carries Gradient and
Step , the two quantities the solver measured to decide it had
converged, and ConvergenceCriterion , naming the test that
stopped it. It carries no Accuracy : MATLAB reports none, and
measuring it would cost a pass over the whole training set at every
iteration.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Information recorded during training



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionNeuralNetwork.DisplayInfo


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 131
RegressionNeuralNetwork: property DisplayInfo

Whether training printed its progress

A logical scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Whether training printed its progress



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
RegressionNeuralNetwork.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
RegressionNeuralNetwork: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. It matches PredictorNames
unless a categorical predictor was expanded into indicator variables.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
RegressionNeuralNetwork.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 366
RegressionNeuralNetwork: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionNeuralNetwork.IterationLimit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 143
RegressionNeuralNetwork: property IterationLimit

Maximum number of training iterations

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Maximum number of training iterations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionNeuralNetwork.LayerBiases


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
RegressionNeuralNetwork: property LayerBiases

Biases the network learned

A cell array with one entry per layer, the output layer included.
LayerBiases{i} is a column with one entry per unit of layer
i . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Biases the network learned



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionNeuralNetwork.LayerSizes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 252
RegressionNeuralNetwork: property LayerSizes

Sizes of the fully connected hidden layers

A row vector of positive integers, one per hidden layer. It does not
include the output layer, whose width is the number of responses. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Sizes of the fully connected hidden layers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionNeuralNetwork.LayerWeights


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 258
RegressionNeuralNetwork: property LayerWeights

Weights the network learned

A cell array with one entry per layer, the output layer included.
LayerWeights{i} has one row per unit of layer i and one
column per input to that layer. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Weights the network learned



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionNeuralNetwork.LearningRate


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
RegressionNeuralNetwork: property LearningRate

Learning rate for gradient descent

A positive scalar value defining the learning rate used by the gradient
descent algorithm during training. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Learning rate for gradient descent



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionNeuralNetwork.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1172
RegressionNeuralNetwork: property ModelParameters

Parameters of the trained network

A structure holding the fit as it was asked for: LayerSizes ,
Activations , OutputLayerActivation ,
LayerWeightsInitializers , Solver ,
LearningRate , IterationLimit ,
GradientTolerance , LossTolerance ,
StepTolerance , DisplayInfo , StandardizeData ,
and the Version , Method and Type tags.

What came out of the fit is elsewhere: the LayerWeights and
LayerBiases properties hold the network, TrainingHistory
the series and ConvergenceInfo where it stopped.

LayerWeightsInitializers names the scheme each layer&rsquo;s weights
were drawn with, the output layer last: 'he' for a rectifying
activation and 'glorot' for a symmetric one. It is a report,
not a setting, the engine choosing per layer from the activation and
offering no way to override it.

OutputLayerActivation , Solver and LearningRate
are this package&rsquo;s own; MATLAB has no counterpart for them. The fields
it reports that this class does not accept as arguments
( Lambda , the validation set and its patience and frequency,
InitialStepSize and the two initializer settings) are absent.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Parameters of the trained network



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionNeuralNetwork.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
RegressionNeuralNetwork: property Mu

Mean of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Mean of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionNeuralNetwork.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 221
RegressionNeuralNetwork: property NumObservations

Number of observations used to train the model

A positive integer scalar, counting only the rows that survived the
removal of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Number of observations used to train the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionNeuralNetwork.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
RegressionNeuralNetwork: property NumPredictors

Number of predictors

A positive integer scalar, the number of columns of X . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionNeuralNetwork.OutputLayerActivation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 237
RegressionNeuralNetwork: property OutputLayerActivation

Activation function of the output layer

A character vector. The default, 'none' , applies the identity,
so a prediction is an unrestricted real number. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Activation function of the output layer



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionNeuralNetwork.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 159
RegressionNeuralNetwork: property PredictorNames

Names of the predictors

A cell array of character vectors, one per column of X . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionNeuralNetwork.RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 340
RegressionNeuralNetwork: obj = RegressionNeuralNetwork ( X , Y )
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (&hellip;, name , value )

Create a RegressionNeuralNetwork object containing a neural
network regression model.

See the class documentation for the accepted Name-Value pairs.

See also:
fitrnet,
RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 85
Create a RegressionNeuralNetwork object containing a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionNeuralNetwork.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 126
RegressionNeuralNetwork: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
RegressionNeuralNetwork.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
RegressionNeuralNetwork: property ResponseTransform

Transformation applied to the predicted response

A function handle, applied by predict and resubPredict to
the network&rsquo;s output. It defaults to the identity and may be set after
construction, either to a handle or to the name of a supported
transformation.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionNeuralNetwork.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 398
RegressionNeuralNetwork: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the RegressionNeuralNetwork model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionNeuralNetwork.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
RegressionNeuralNetwork: property Sigma

Standard deviation of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Standard deviation of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionNeuralNetwork.Solver


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 210
RegressionNeuralNetwork: property Solver

Solver used to train the network

A character vector, either 'Gradient Descent' for the
stochastic solver or 'LBFGS' for the full-batch one.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Solver used to train the network



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionNeuralNetwork.TrainingHistory


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 423
RegressionNeuralNetwork: property TrainingHistory

Iteration by iteration record of the fit

A table with the variables Iteration and
TrainingLoss , one row per training iteration. This property is
read-only.

The columns follow the solver. Under 'sgd' they are
Iteration and TrainingLoss , with TrainingAccuracy
for a classifier. Under 'lbfgs' they are Iteration ,
TrainingLoss , Gradient and Step , as MATLAB&rsquo;s are.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Iteration by iteration record of the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionNeuralNetwork.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 205
RegressionNeuralNetwork: property W

Observation weights

A numeric column vector with one entry per training observation. It
defaults to a uniform weight for every observation. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionNeuralNetwork.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
RegressionNeuralNetwork: property X

Predictor data

An NxP numeric matrix, as it was supplied to the constructor,
before any rows carrying missing values were dropped. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionNeuralNetwork.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionNeuralNetwork: property Y

Response data

An Nx1 numeric vector, as it was supplied to the constructor.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionNeuralNetwork.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
RegressionNeuralNetwork: CMdl = compact ( obj )

Create a CompactRegressionNeuralNetwork object.

CMdl = compact ( obj ) returns a compact version of
the RegressionNeuralNetwork object obj , which keeps the
trained network but drops the training data, so it predicts identically
while carrying no observations.

See also:
fitrnet,
RegressionNeuralNetwork,
CompactRegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create a CompactRegressionNeuralNetwork object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionNeuralNetwork.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 909
RegressionNeuralNetwork: CVMdl = crossval ( obj )
RegressionNeuralNetwork: CVMdl = crossval (&hellip;, name , value )

Cross validate a neural network regression model.

CVMdl = crossval ( obj ) returns a
RegressionPartitionedModel holding one refit of obj per
fold of a ten-fold partition, or of an n -fold one where the
model has fewer than ten observations.

obj must be a RegressionNeuralNetwork class object.

CVMdl = crossval (&hellip;, name , value )
accepts one, and only one, of the following Name-Value pairs.

Name Value
'KFold' An integer greater than 1, the number of
folds.
'Holdout' A scalar in (0, 1) , the fraction
of observations held out for testing.
'Leaveout' 'on' or 'off' , whether
to hold out one observation at a time.
'CVPartition' A cvpartition object over as
many observations as the model was trained on.

See also:
RegressionNeuralNetwork,
RegressionPartitionedModel,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Cross validate a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionNeuralNetwork.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 995
RegressionNeuralNetwork: L = loss ( obj , X , Y )
RegressionNeuralNetwork: L = loss (&hellip;, name , value )

Compute the regression loss of a neural network model.

L = loss ( obj , X , Y ) returns the
weighted mean squared error between the response Y and the
response the model predicts for X .

obj must be a RegressionNeuralNetwork class object.

X must be a numeric matrix with the same number of predictors as
the data the model was trained on.

Y must be a numeric vector with as many rows as X .

L = loss (&hellip;, name , value ) accepts the
following Name-Value pairs.

Name Value
'LossFun' 'mse' , the default, or a function
handle called as lossfun ( Y , yFit , W )
and returning a scalar.
'Weights' A numeric vector of observation weights
with one entry per row of X . It defaults to a uniform weight.
The weights are normalized to sum to one before the loss is formed, so
scaling them all by the same factor leaves the loss unchanged.

See also:
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Compute the regression loss of a neural network model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionNeuralNetwork.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 576
RegressionNeuralNetwork: yFit = predict ( obj , XC )

Predict the response for new data with a neural network regression
model.

yFit = predict ( obj , XC ) returns a column
vector holding the predicted response for each row of XC , using
the network stored in obj .

obj must be a RegressionNeuralNetwork class object.

XC must be a numeric matrix with the same number of predictors as
the data the model was trained on.

The transformation named by ResponseTransform is applied to the
network&rsquo;s output before it is returned.

See also:
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Predict the response for new data with a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionNeuralNetwork.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 433
RegressionNeuralNetwork: L = resubLoss ( obj )
RegressionNeuralNetwork: L = resubLoss (&hellip;, name , value )

Compute the resubstitution regression loss of a neural network model.

L = resubLoss ( obj ) returns the weighted mean
squared error of the model on the data it was trained on. It accepts
the same Name-Value pairs as loss .

obj must be a RegressionNeuralNetwork class object.

See also:
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Compute the resubstitution regression loss of a neural network model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionNeuralNetwork.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 417
RegressionNeuralNetwork: yFit = resubPredict ( obj )

Predict the response of the training data with a neural network
regression model.

yFit = resubPredict ( obj ) returns a column vector
holding the predicted response for every observation the model was
trained on, that is the rows of obj.X selected by
obj.RowsUsed .

obj must be a RegressionNeuralNetwork class object.

See also:
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 81
Predict the response of the training data with a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionNeuralNetwork.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 329
RegressionNeuralNetwork: savemodel ( obj , filename )

Save a neural network regression model to a file.

savemodel ( obj , filename ) saves every property of
the RegressionNeuralNetwork object obj into
filename in binary format, so that it can be read back with
loadmodel .

See also:
loadmodel,
RegressionNeuralNetwork,
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Save a neural network regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 549
statistics: RegressionPartitionedEnsemble

Cross-validated ensemble of regression trees

A RegressionPartitionedEnsemble object holds one ensemble per fold
of a partition, each fitted on the observations the fold keeps for
training, and predicts every observation with the ensemble of the fold
that held it out.

Create one with fitrensemble given a cross-validation option, or
with the crossval method of a RegressionEnsemble or
RegressionBaggedEnsemble .

See also:
fitrensemble,
RegressionEnsemble.crossval,
CompactRegressionEnsemble,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Cross-validated ensemble of regression trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionPartitionedEnsemble.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 120
RegressionPartitionedEnsemble: property BinEdges

Bin edges of the predictors

Always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
RegressionPartitionedEnsemble.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 139
RegressionPartitionedEnsemble: property CategoricalPredictors

Indices of categorical predictors

Always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Indices of categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
RegressionPartitionedEnsemble.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 149
RegressionPartitionedEnsemble: property CrossValidatedModel

Method of the cross-validated ensemble

'LSBoost' or 'Bag' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Method of the cross-validated ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionPartitionedEnsemble.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 91
RegressionPartitionedEnsemble: property KFold

Number of folds

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionPartitionedEnsemble.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 303
RegressionPartitionedEnsemble: property ModelParameters

Parameters of the cross-validation

A structure with the fields Type , Method ,
'PartitionedEnsemble' , LearnerTemplates , the
ModelParameters of the ensemble the folds were fitted as, and
NLearn , the number of folds. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Parameters of the cross-validation



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionPartitionedEnsemble.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
RegressionPartitionedEnsemble: property NumObservations

Number of observations

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionPartitionedEnsemble.NumTrainedPerFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionPartitionedEnsemble: property NumTrainedPerFold

Number of trees in each fold

A row vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Number of trees in each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionPartitionedEnsemble.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 135
RegressionPartitionedEnsemble: property Partition

The partition of the observations

A cvpartition object. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
The partition of the observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
RegressionPartitionedEnsemble.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 108
RegressionPartitionedEnsemble: property PredictorNames

Names of the predictors

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
RegressionPartitionedEnsemble.RegressionPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 270
RegressionPartitionedEnsemble: CVMdl = RegressionPartitionedEnsemble ( Mdl , Partition )

Cross-validate a regression ensemble.

Mdl is the ensemble to cross-validate and Partition a
cvpartition of its observations. The documented ways in are
fitrensemble and crossval .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Cross-validate a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedEnsemble.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 112
RegressionPartitionedEnsemble: property ResponseName

Name of the response variable

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionPartitionedEnsemble.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 258
RegressionPartitionedEnsemble: property ResponseTransform

Transform applied to the out-of-fold predictions

The folds carry none; this one is applied once to what they predict.
MATLAB R2024a leaves the transform on the folds as well and so applies
it twice.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transform applied to the out-of-fold predictions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionPartitionedEnsemble.Trainable


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 216
RegressionPartitionedEnsemble: property Trainable

The full ensemble of each fold

A column cell array with one RegressionEnsemble or
RegressionBaggedEnsemble per fold, which resume grows.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The full ensemble of each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionPartitionedEnsemble.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
RegressionPartitionedEnsemble: property Trained

The compact ensemble of each fold

A column cell array with one CompactRegressionEnsemble per fold.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
The compact ensemble of each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionPartitionedEnsemble.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 198
RegressionPartitionedEnsemble: property W

Observation weights

The weights of the ensemble that was cross-validated, by which the
losses weigh the held-out observations. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionPartitionedEnsemble.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 86
RegressionPartitionedEnsemble: property X

Predictor data

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionPartitionedEnsemble.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 85
RegressionPartitionedEnsemble: property Y

Response data

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionPartitionedEnsemble.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 773
RegressionPartitionedEnsemble: L = kfoldLoss ( obj )
RegressionPartitionedEnsemble: L = kfoldLoss (&hellip;, name , value )

Cross-validated regression loss.

L is the weighted mean squared error of the out-of-fold
predictions, the held-out observations weighted by W .

Name-Value arguments:

Name Value
'Folds' The folds to use, pooled. The default
is all of them.
'LossFun' 'mse' (default) or a function
handle called as lossfun (Y, Yfit, W) with normalized weights.
'Mode' 'average' (default) for one loss
over the observations of every fold used, 'individual' for a
column with the loss of each fold, or 'cumulative' for a column
whose element t uses the first t trees of every fold.

See also:
RegressionPartitionedEnsemble,
RegressionPartitionedEnsemble.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Cross-validated regression loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedEnsemble.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 365
RegressionPartitionedEnsemble: yfit = kfoldPredict ( obj )

Predict each observation with the fold that held it out.

yfit holds each observation&rsquo;s prediction from the ensemble of the
fold that held it out, after ResponseTransform , and NaN
for an observation no fold held out.

See also:
RegressionPartitionedEnsemble,
RegressionPartitionedEnsemble.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Predict each observation with the fold that held it out.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
RegressionPartitionedEnsemble.kfoldfun


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 340
RegressionPartitionedEnsemble: vals = kfoldfun ( obj , fun )

Apply a function to each fold.

fun is called once per fold as
fun (CMP, Xtrain, Ytrain, Wtrain, Xtest, Ytest, Wtest) ,
CMP being the fold&rsquo;s compact ensemble and the weights those of
W , and must return a row. vals stacks the rows.

See also:
RegressionPartitionedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Apply a function to each fold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionPartitionedEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 359
RegressionPartitionedEnsemble: CVMdl = resume ( obj , NumLearningCycles )
RegressionPartitionedEnsemble: CVMdl = resume (&hellip;, &rsquo;NPrint&rsquo;, n )

Grow more trees in every fold.

Each fold&rsquo;s ensemble is resumed, as RegressionEnsemble.resume
does, by NumLearningCycles trees.

See also:
RegressionPartitionedEnsemble,
RegressionEnsemble.resume


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Grow more trees in every fold.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1022
statistics: RegressionPartitionedKernel

Cross-validated Gaussian kernel regression model.

A RegressionPartitionedKernel object holds one
RegressionKernel per fold of a partition, each fitted to the
observations the fold trains on. kfoldPredict predicts each
observation with the fold that held it out , so what it returns is
an out-of-sample prediction.

A RegressionKernel stores no copy of its training data and so has
no resubstitution methods and no compact form. This class is what
takes their place: cross-validation is the way a kernel model is asked
how it would do on data it has not seen.

Every fold draws its own random basis, as it must, being its own fit.
Two folds therefore approximate the same kernel through different
expansions, which is a source of variation between folds over and above
the data they were given. A larger 'NumExpansionDimensions'
narrows it.

Create one with fitrlinear and a cross-validation option, or
directly.

See also:
fitrlinear,
RegressionKernel,
RegressionPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Cross-validated Gaussian kernel regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
RegressionPartitionedKernel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 198
RegressionPartitionedKernel: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionPartitionedKernel.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
RegressionPartitionedKernel: property CrossValidatedModel

Name of the model that was cross-validated

Always 'Linear' , the short name MATLAB uses. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Name of the model that was cross-validated



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionPartitionedKernel.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
RegressionPartitionedKernel: property KFold

Number of folds

A positive integer scalar. A holdout partition has one fold and a
leave-one-out partition has as many as there are observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
RegressionPartitionedKernel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1151
RegressionPartitionedKernel: property ModelParameters

What was cross-validated, and how

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class, with
LearnerTemplates naming the backing. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedKernel' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
What was cross-validated, and how



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
RegressionPartitionedKernel.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
RegressionPartitionedKernel: property NumObservations

Number of observations the partition covers

A positive integer scalar, counting the rows that survived the removal
of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Number of observations the partition covers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionPartitionedKernel.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 151
RegressionPartitionedKernel: property Partition

The partition itself

A cvpartition object over the retained observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
The partition itself



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedKernel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionPartitionedKernel: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
RegressionPartitionedKernel.RegressionPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 972
RegressionPartitionedKernel: obj = RegressionPartitionedKernel ( X , Y )
RegressionPartitionedKernel: obj = RegressionPartitionedKernel (&hellip;, name , value )

Cross-validate a linear regression model.

obj = RegressionPartitionedKernel ( X , Y )
partitions the data into ten folds and fits a
RegressionKernel to each.

obj = RegressionPartitionedKernel (&hellip;, name ,
value ) takes one of 'KFold' , 'Holdout' ,
'Leaveout' and 'CVPartition' to say how to partition,
and any option RegressionKernel takes to say how to fit.
'CrossVal' is accepted and has no effect here, this class
being cross-validated by construction.

Anything left as 'auto' is resolved by each fold against its
own training rows rather than once over the whole data, so ten folds
of a hundred observations each get a Lambda of one ninetieth
rather than one hundredth, and each its own Epsilon and
KernelScale . Both are MATLAB&rsquo;s behaviour, measured.

See also:
fitrlinear,
RegressionKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Cross-validate a linear regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionPartitionedKernel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionPartitionedKernel: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionPartitionedKernel.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 332
RegressionPartitionedKernel: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied, which may be assigned after the model is built. The fold
models carry no transform of their own; this one is applied once to
the assembled predictions.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionPartitionedKernel.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
RegressionPartitionedKernel: property Trained

The models fitted to the folds

A cell column with one RegressionKernel per fold, each fitted
to the observations its fold trains on. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The models fitted to the folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionPartitionedKernel.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
RegressionPartitionedKernel: property W

Observation weights

An Nx1 numeric vector summing to one. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionPartitionedKernel.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionPartitionedKernel: property Y

Response of the retained observations

An Nx1 numeric vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Response of the retained observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionPartitionedKernel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
RegressionPartitionedKernel: l = kfoldLoss ( obj )
RegressionPartitionedKernel: l = kfoldLoss (&hellip;, name , value )

Out-of-fold regression loss.

l = kfoldLoss ( obj ) returns the out-of-fold mean
squared error.

l = kfoldLoss (&hellip;, name , value ) takes
'LossFun' , either 'mse' or
'epsiloninsensitive' ; 'Folds' , a subset of the folds
to average over; and 'Mode' , either 'average' , the
default, or 'individual' , which returns one row per fold.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Out-of-fold regression loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionPartitionedKernel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
RegressionPartitionedKernel: yFit = kfoldPredict ( obj )

Out-of-fold prediction for every observation.

Each observation is predicted by the fold that held it out, so the
predictions are out-of-sample. An observation that no fold held out,
which under a holdout partition is most of them, comes back
NaN .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Out-of-fold prediction for every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionPartitionedLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 883
statistics: RegressionPartitionedLinear

Cross-validated linear regression model.

A RegressionPartitionedLinear object holds one
RegressionLinear per fold of a partition, each fitted to the
observations the fold trains on. kfoldPredict predicts each
observation with the fold that held it out , so what it returns is
an out-of-sample prediction.

A RegressionLinear stores no copy of its training data and so has
no resubstitution methods and no compact form. This class is what
takes their place: cross-validation is the way a linear model is asked
how it would do on data it has not seen.

When the fold models carry a whole regularization path, both methods
return one column per strength, in the order of the 'Lambda' that
was asked for.

Create one with fitrlinear and a cross-validation option, or
directly.

See also:
fitrlinear,
RegressionLinear,
RegressionPartitionedKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Cross-validated linear regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
RegressionPartitionedLinear.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 198
RegressionPartitionedLinear: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices, empty when every predictor is
numeric. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionPartitionedLinear.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
RegressionPartitionedLinear: property CrossValidatedModel

Name of the model that was cross-validated

Always 'Linear' , the short name MATLAB uses. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Name of the model that was cross-validated



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
RegressionPartitionedLinear.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
RegressionPartitionedLinear: property KFold

Number of folds

A positive integer scalar. A holdout partition has one fold and a
leave-one-out partition has as many as there are observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
RegressionPartitionedLinear.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1151
RegressionPartitionedLinear: property ModelParameters

What was cross-validated, and how

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class, with
LearnerTemplates naming the backing. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedLinear' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
What was cross-validated, and how



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
RegressionPartitionedLinear.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
RegressionPartitionedLinear: property NumObservations

Number of observations the partition covers

A positive integer scalar, counting the rows that survived the removal
of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Number of observations the partition covers



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionPartitionedLinear.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 151
RegressionPartitionedLinear: property Partition

The partition itself

A cvpartition object over the retained observations. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
The partition itself



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedLinear.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionPartitionedLinear: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
RegressionPartitionedLinear.RegressionPartitionedLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 956
RegressionPartitionedLinear: obj = RegressionPartitionedLinear ( X , Y )
RegressionPartitionedLinear: obj = RegressionPartitionedLinear (&hellip;, name , value )

Cross-validate a linear regression model.

obj = RegressionPartitionedLinear ( X , Y )
partitions the data into ten folds and fits a
RegressionLinear to each.

obj = RegressionPartitionedLinear (&hellip;, name ,
value ) takes one of 'KFold' , 'Holdout' ,
'Leaveout' and 'CVPartition' to say how to partition,
and any option RegressionLinear takes to say how to fit.
'CrossVal' is accepted and has no effect here, this class
being cross-validated by construction.

Anything left as 'auto' is resolved by each fold against its
own training rows rather than once over the whole data, so ten folds
of a hundred observations each get a Lambda of one ninetieth
rather than one hundredth, and each its own Epsilon . Both are
MATLAB&rsquo;s behaviour, measured.

See also:
fitrlinear,
RegressionLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Cross-validate a linear regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionPartitionedLinear.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
RegressionPartitionedLinear: property ResponseName

Name of the response

A character vector, defaulting to 'Y' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Name of the response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
RegressionPartitionedLinear.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 332
RegressionPartitionedLinear: property ResponseTransform

Transformation applied to the predicted response

A character vector, or the text of the function handle that was
supplied, which may be assigned after the model is built. The fold
models carry no transform of their own; this one is applied once to
the assembled predictions.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionPartitionedLinear.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 208
RegressionPartitionedLinear: property Trained

The models fitted to the folds

A cell column with one RegressionLinear per fold, each fitted
to the observations its fold trains on. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The models fitted to the folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionPartitionedLinear.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
RegressionPartitionedLinear: property W

Observation weights

An Nx1 numeric vector summing to one. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionPartitionedLinear.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 130
RegressionPartitionedLinear: property Y

Response of the retained observations

An Nx1 numeric vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Response of the retained observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionPartitionedLinear.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 458
RegressionPartitionedLinear: l = kfoldLoss ( obj )
RegressionPartitionedLinear: l = kfoldLoss (&hellip;, name , value )

Out-of-fold regression loss.

l = kfoldLoss ( obj ) returns the out-of-fold mean
squared error.

l = kfoldLoss (&hellip;, name , value ) takes
'LossFun' , either 'mse' or
'epsiloninsensitive' ; 'Folds' , a subset of the folds
to average over; and 'Mode' , either 'average' , the
default, or 'individual' , which returns one row per fold.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Out-of-fold regression loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
RegressionPartitionedLinear.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 373
RegressionPartitionedLinear: yFit = kfoldPredict ( obj )

Out-of-fold prediction for every observation.

Each observation is predicted by the fold that held it out, so the
predictions are out-of-sample. An observation that no fold held out,
which under a holdout partition is most of them, comes back
NaN .

With L regularization strengths yFit has one column per
strength.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Out-of-fold prediction for every observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 990
statistics: obj = RegressionPartitionedModel ( Mdl , Partition )

Create a RegressionPartitionedModel object, a regression model
cross validated over a partition of its training data.

obj = RegressionPartitionedModel ( Mdl , Partition )
refits Mdl once per fold of Partition , each time on the
observations that fold holds out of its test set, and stores the compact
form of every fit in Trained . It is normally reached through
crossval ( Mdl ) rather than called directly.

Mdl must be a RegressionGAM , a
RegressionNeuralNetwork , or a RegressionSVM object.

Partition must be a cvpartition object over as many
observations as Mdl was trained on.

Every observation is held out by exactly one fold under k -fold or
leave-one-out partitioning, so kfoldPredict can answer for it with a
model that never saw it. Under a holdout partition only the test set is
answered for, and the rest come back NaN .

See also:
crossval,
cvpartition,
RegressionGAM,
RegressionNeuralNetwork,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 117
Create a RegressionPartitionedModel object, a regression model cross validated over a partition of its training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionPartitionedModel.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 535
RegressionPartitionedModel: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is carried
over from the model that was cross validated, and is empty whenever that
model did no binning, which is every learner this package implements:
MATLAB fills it only for its generalized additive model, which bins
because it is built from boosted trees where ours is built from splines.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
RegressionPartitionedModel.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 186
RegressionPartitionedModel: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices, and empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
RegressionPartitionedModel.CrossValidatedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 358
RegressionPartitionedModel: property CrossValidatedModel

Name of the cross-validated model

A character vector holding the short name of the learner that was
cross validated, as MATLAB reports it: 'GAM' , 'GP' ,
'NeuralNetwork' or 'SVM' . It is not the class name of
that learner, and the classification side uses the same names. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Name of the cross-validated model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
RegressionPartitionedModel.IsStandardDeviationFit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 830
RegressionPartitionedModel: property IsStandardDeviationFit

Whether the folds fitted a standard deviation model

A logical scalar for a generalized additive model backing, taken from
the model that was cross validated, and empty for every other backing.

MATLAB carries this on RegressionPartitionedGAM , one of five
per-learner partitioned classes this package deliberately does not have
(see crossval ). With one class serving every backing the
property has to be declared for all of them, so it is empty where it
does not apply. It is placed last rather than first, where MATLAB&rsquo;s
subclass shows it, because that subclass also moves
ResponseTransform to the end and no single order can match both
of MATLAB&rsquo;s classes; matching the general one and appending is the only
coherent choice.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Whether the folds fitted a standard deviation model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionPartitionedModel.KFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
RegressionPartitionedModel: property KFold

Number of folds

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of folds



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedModel.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1111
RegressionPartitionedModel: property ModelParameters

Parameters the folds were fitted with

A structure holding the parameters the folds were fitted with, carried
through from the learner that was cross validated, beside
NLearn , the number of folds, and the Version ,
Method and Type tags of this class. The
learner&rsquo;s own tags are replaced rather than kept, so a cross-validated
SVM reports Method as 'PartitionedModel' and not
'SVM' .

Deviation from MATLAB. MATLAB reports the parameter record of
the cross-validation ensemble here rather than of the learner,
so it says nothing at all about how the folds were fitted: of its
eighteen fields only the fold count, its partitioner and a fit template
carry anything, and the rest are boosting settings left inert. Nor can
the parameters be reached through the folds, a compact model carrying
none in MATLAB. This class reports the fit instead, which is strictly
more than MATLAB offers, and everything MATLAB&rsquo;s record does carry is
published here as the KFold , Partition , X ,
Y , W and CrossValidatedModel properties.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Parameters the folds were fitted with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
RegressionPartitionedModel.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
RegressionPartitionedModel: property NumObservations

Number of observations

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
RegressionPartitionedModel.NumTrainedPerFold


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 724
RegressionPartitionedModel: property NumTrainedPerFold

How many trees each fold fitted

A scalar structure with fields PredictorTrees and
InteractionTrees , each a row with one entry per fold, for a
generalized additive model backing, and empty for every other.

It reports what each fold actually fitted, which the budget in
ModelParameters does not: a phase stops early when it can no
longer improve the fit, and the folds need not stop at the same place.

MATLAB carries this on its per-learner partitioned GAM classes, which
this package deliberately does not have (see crossval ), so like
IsStandardDeviationFit it is declared here for every backing
and left empty where it does not apply.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
How many trees each fold fitted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionPartitionedModel.Partition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
RegressionPartitionedModel: property Partition

The partition the folds came from

A cvpartition object. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
The partition the folds came from



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
RegressionPartitionedModel.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 140
RegressionPartitionedModel: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
RegressionPartitionedModel.RegressionPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 243
RegressionPartitionedModel: obj = RegressionPartitionedModel ( Mdl , Partition )

Create a RegressionPartitionedModel object.

See the class documentation for what it holds and how it is reached.

See also:
crossval,
RegressionPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Create a RegressionPartitionedModel object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionPartitionedModel.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 129
RegressionPartitionedModel: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
RegressionPartitionedModel.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
RegressionPartitionedModel: property ResponseTransform

Transformation applied to the predicted response

A function handle, carried over from the model that was cross
validated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionPartitionedModel.Trained


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 219
RegressionPartitionedModel: property Trained

The models fitted to each fold

A cell array with one compact model per fold, each fitted on the
observations its fold holds out of the test set. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The models fitted to each fold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionPartitionedModel.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
RegressionPartitionedModel: property W

Observation weights

A numeric column vector with one entry per observation. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionPartitionedModel.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
RegressionPartitionedModel: property X

Predictor data

A numeric matrix holding the observations the model was trained on,
the rows carrying missing values already removed. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionPartitionedModel.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 136
RegressionPartitionedModel: property Y

Response data

A numeric column vector with one entry per row of X . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionPartitionedModel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1071
RegressionPartitionedModel: L = kfoldLoss ( obj )
RegressionPartitionedModel: L = kfoldLoss (&hellip;, name , value )

Compute the cross-validated regression loss.

L = kfoldLoss ( obj ) returns the weighted mean
squared error between the response and the out-of-fold predictions of
kfoldPredict , over every observation some fold tests.

obj must be a RegressionPartitionedModel class object.

L = kfoldLoss (&hellip;, name , value ) accepts
the following Name-Value pairs.

Name Value
'LossFun' 'mse' , the default,
'epsiloninsensitive' , or a function handle called as
lossfun ( Y , yFit , W ) returning a scalar.
The epsilon -insensitive loss belongs to a support vector model
and is refused for any other, there being no tube to measure against.
'Mode' 'average' , the default, which returns
one number over the observations of every fold asked for, or
'individual' , which returns one number per fold.
'Folds' A vector of fold indices to restrict the
loss to. It defaults to every fold.

See also:
RegressionPartitionedModel,
RegressionPartitionedModel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Compute the cross-validated regression loss.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
RegressionPartitionedModel.kfoldPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1453
RegressionPartitionedModel: yFit = kfoldPredict ( obj )
RegressionPartitionedModel: [ yFit , ySD , yInt ] = kfoldPredict ( obj )
RegressionPartitionedModel: [&hellip;] = kfoldPredict (&hellip;, 'Alpha' , alpha )

Predict the response of every observation from the fold that held it
out.

yFit = kfoldPredict ( obj ) returns a column vector
with one entry per observation, each predicted by the fold&rsquo;s model that
did not see it during training. An observation no fold tests, which a
holdout partition leaves outside its test set, comes back NaN .

obj must be a RegressionPartitionedModel class object.

[ yFit , ySD , yInt ] = kfoldPredict ( obj )
also returns the standard deviation ySD of each predicted
response and the two-column matrix yInt of prediction intervals,
each answered for by the fold that held the observation out. A
RegressionGP backing is the only one that fits the uncertainty
its predictions carry, so any other raises here. An untested
observation is NaN in all three.

[&hellip;] = kfoldPredict (&hellip;, 'Alpha' , alpha )
sets the significance level of the prediction intervals, which default
to 95 per cent at an alpha of 0.05.

ySD does not follow ResponseTransform and the other two
outputs do, the same rule RegressionGP.predict applies: a
predicted response and an interval endpoint are on the response scale
and a standard deviation is not.

See also:
RegressionPartitionedModel,
RegressionPartitionedModel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Predict the response of every observation from the fold that held it out.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionPartitionedModel.kfoldfun


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 828
RegressionPartitionedModel: vals = kfoldfun ( obj , fun )

Apply a function to each fold of a cross-validated model.

vals = kfoldfun ( obj , fun ) calls fun once
per fold and returns a K&times;M numeric matrix whose row k is
what fun returned for fold k .

fun is a function handle taking seven inputs and returning a
numeric vector of the same length every time it is called:

testvals = fun ( M , Xtrain , Ytrain , Wtrain , &hellip;
Xtest , Ytest , Wtest )

M is the model the fold was fitted with, taken from
obj .Trained{k} ; Xtrain , Ytrain and
Wtrain are the predictors, response and weights of the
observations that fold was trained on, and Xtest , Ytest and
Wtest those of the observations it held out.

See also:
RegressionPartitionedModel,
RegressionPartitionedModel.kfoldPredict,
RegressionPartitionedModel.kfoldLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Apply a function to each fold of a cross-validated model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3638
statistics: obj = RegressionSVM ( X , Y )
statistics: obj = RegressionSVM (&hellip;, name , value )

Create a RegressionSVM object containing a support vector machine
regression model.

obj = RegressionSVM ( X , Y ) returns a support vector
regression model, obj , with X being the predictor data and
Y the continuous response of the observations in X .

X must be an NxP numeric matrix of predictor data, where rows
correspond to observations and columns to features.

Y must be an Nx1 numeric vector holding the response of the
corresponding predictor data in X . Y must have the same number
of rows as X .

The model is fitted by epsilon -insensitive regression: errors smaller
than Epsilon cost nothing, so only the observations outside that
tube become support vectors. Epsilon defaults to
iqr ( Y ) / 13.49 , a robust estimate of a tenth of the response&rsquo;s
standard deviation, which is what MATLAB uses.

obj = RegressionSVM (&hellip;, name , value ) returns
a model with additional options specified by Name-Value pair
arguments listed below.

Name Value
'Standardize' A logical scalar specifying whether the
predictor data should be centred and scaled before training. The same
transformation is applied by predict . The default is false .
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not is predicted as a
row missing a predictor, the lower median of the training response.
'PredictorNames' A cell array of character vectors
naming the predictors, in the order they appear in X .
'ResponseName' A character vector naming the response.
The default is 'Y' .
'ResponseTransform' A character vector naming one of the
supported transformations, or a function handle, applied to the predicted
response by predict and resubPredict . The default is
'none' .
'Epsilon' A non-negative scalar, the half-width of the
insensitive tube. The default is iqr ( Y ) / 13.49 , or
0.1 where that is zero.
'BoxConstraint' A positive scalar bounding the dual
coefficients, the cost of an error outside the tube. The default is 1.
'KernelFunction' A character vector naming the kernel,
one of 'linear' , the default, 'rbf' , 'gaussian' ,
'polynomial' or 'sigmoid' .
'PolynomialOrder' A positive integer, the order of the
polynomial kernel. The default is 3. It is ignored by every other kernel.
'KernelScale' A positive scalar dividing the predictors
before the kernel is applied. The default is 1.
'KernelOffset' A non-negative scalar added to the kernel
value. The default is 0.
'SVMtype' A character vector selecting the formulation,
either 'eps_svr' , the default, or 'nu_svr' . MATLAB fits
only the epsilon form; 'nu_svr' is an Octave extension, in
which Nu bounds the fraction of support vectors and Epsilon
is determined by the fit rather than given.
'Nu' A scalar in (0, 1] used by
'nu_svr' . The default is 0.5.
'CacheSize' A positive scalar, the kernel cache in
megabytes. The default is 1000.
'Tolerance' A non-negative scalar, the tolerance of the
termination criterion. The default is 1e-6 .
'Shrinking' Either 0 or 1, whether to use the shrinking
heuristic. The default is 1.

The supported values for 'ResponseTransform' are:

Value Description
'none' x (no transformation)
'identity' x (no transformation)
'exp' exp (x)
'log' log (x)

See also:
fitrsvm,
ClassificationSVM,
RegressionNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 83
Create a RegressionSVM object containing a support vector machine regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionSVM.Alpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 418
RegressionSVM: property Alpha

Dual coefficients of the support vectors

A numeric column vector with one entry per support vector, holding the
difference of the two multipliers each observation carries. Unlike a
classifier&rsquo;s, these are signed: there are no labels to take the sign
into, so an observation above the tube and one below it are told apart
by the sign of its coefficient. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Dual coefficients of the support vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionSVM.Beta


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 275
RegressionSVM: property Beta

Primal coefficients, one per predictor

A numeric column vector, equal to
obj.SupportVectors' * obj.Alpha . It exists only for a linear
kernel; for any other kernel there is no primal representation and this
is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Primal coefficients, one per predictor



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionSVM.Bias


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
RegressionSVM: property Bias

Intercept of the fitted function

A numeric scalar. With a linear kernel the prediction is
X * obj.Beta + obj.Bias . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Intercept of the fitted function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionSVM.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 361
RegressionSVM: property BinEdges

Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor&rsquo;s bin
edges where the learner discretized it before fitting. It is empty here
and stays empty: this learner fits the predictors as they are, and
MATLAB&rsquo;s reports an empty cell for it as well.

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionSVM.BoxConstraints


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 265
RegressionSVM: property BoxConstraints

Box constraints

A numeric column vector with one entry per observation, holding the box
constraint the fit applied to it. A regression has no classes to
reweight, so every entry is BoxConstraint . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Box constraints



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionSVM.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 173
RegressionSVM: property CategoricalPredictors

Indices of the categorical predictors

A numeric vector of column indices, and empty when none is. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionSVM.Epsilon


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 226
RegressionSVM: property Epsilon

Half-width of the insensitive tube

A non-negative scalar. An error smaller than Epsilon costs
nothing, so only observations outside the tube become support vectors.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Half-width of the insensitive tube



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionSVM.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 162
RegressionSVM: property ExpandedPredictorNames

Names of the predictors as the model expanded them

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Names of the predictors as the model expanded them



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
RegressionSVM.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 356
RegressionSVM: property HyperparameterOptimizationResults

Results of the hyperparameter optimization

Always empty. It is declared for MATLAB compatibility, where
it holds what an automatic search over the hyperparameters found. This
class fits the parameters it is given and runs no such search, so there
is nothing to report. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Results of the hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionSVM.IsSupportVector


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 182
RegressionSVM: property IsSupportVector

Which training observations are support vectors

A logical column vector with one entry per training observation. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Which training observations are support vectors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionSVM.KernelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
RegressionSVM: property KernelParameters

Parameters of the kernel function

A structure with fields Function and Scale , and
Order for a polynomial kernel. Function names the
kernel as MATLAB names it, so a radial basis kernel reports
'gaussian' whichever spelling was given; the kernel the fit was
handed is unchanged in ModelParameters . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Parameters of the kernel function



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionSVM.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 734
RegressionSVM: property ModelParameters

Parameters the model was fitted with

A structure holding the SVM formulation, the kernel and its parameters,
the box constraint, Epsilon and the solver settings. The engine
is LIBSVM and the record is LIBSVM&rsquo;s, so SVMtype names its
formulation and Tolerance and Shrinking are its own
controls; the parameters MathWorks reports for its SMO and ISDA solvers
are absent, this class running neither.

KernelPolynomialOrder belongs to the polynomial kernel alone
and is empty under every other, as it is in MATLAB. Nu is
reported here where MATLAB leaves it empty on a regression model, this
class offering 'nu_svr' through SVMtype and the value
being a real one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Parameters the model was fitted with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionSVM.Mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 201
RegressionSVM: property Mu

Mean of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Mean of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionSVM.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
RegressionSVM: property NumObservations

Number of observations used to train the model

A positive integer scalar, counting only the rows that survived the
removal of missing values. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Number of observations used to train the model



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionSVM.NumPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 115
RegressionSVM: property NumPredictors

Number of predictors

A positive integer scalar. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Number of predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionSVM.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 127
RegressionSVM: property PredictorNames

Names of the predictors

A cell array of character vectors. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionSVM.RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 288
RegressionSVM: obj = RegressionSVM ( X , Y )
RegressionSVM: obj = RegressionSVM (&hellip;, name , value )

Create a RegressionSVM object containing a support vector
machine regression model.

See the class documentation for the accepted Name-Value pairs.

See also:
fitrsvm,
RegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 83
Create a RegressionSVM object containing a support vector machine regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionSVM.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
RegressionSVM: property ResponseName

Name of the response variable

A character vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionSVM.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
RegressionSVM: property ResponseTransform

Transformation applied to the predicted response

A function handle, applied by predict and resubPredict to
the model&rsquo;s output. It defaults to the identity and may be set after
construction, either to a handle or to the name of a supported
transformation.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Transformation applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionSVM.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 378
RegressionSVM: property RowsUsed

Rows used for fitting

A logical column vector with the same length as the observations in the
original predictor data X , true for each row that was used for
fitting the RegressionSVM model. It is empty, [] ,
when every observation was used, so a non-empty value means that rows
holding missing values were dropped. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionSVM.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
RegressionSVM: property Sigma

Standard deviation of the predictors

A row vector with one entry per predictor, used for standardization.
Empty when the predictor data were not standardized. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Standard deviation of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionSVM.SupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
RegressionSVM: property SupportVectors

The support vectors themselves

A numeric matrix with one row per support vector, on the scale the
model was trained on, standardized where Mu is non-empty.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The support vectors themselves



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionSVM.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
RegressionSVM: property W

Observation weights

A numeric column vector with one entry per training observation,
normalized to sum to one, as MATLAB reports it. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionSVM.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
RegressionSVM: property X

Predictor data

An NxP numeric matrix, as it was supplied to the constructor.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
RegressionSVM.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 131
RegressionSVM: property Y

Response data

An Nx1 numeric vector, as it was supplied to the constructor.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionSVM.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 359
RegressionSVM: CMdl = compact ( obj )

Create a CompactRegressionSVM object.

CMdl = compact ( obj ) returns a compact version of
the RegressionSVM object obj , which keeps the support
vectors and their coefficients but drops the training data, so it
predicts identically while carrying no observations.

See also:
fitrsvm,
RegressionSVM,
CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Create a CompactRegressionSVM object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionSVM.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 869
RegressionSVM: CVMdl = crossval ( obj )
RegressionSVM: CVMdl = crossval (&hellip;, name , value )

Cross validate a support vector regression model.

CVMdl = crossval ( obj ) returns a
RegressionPartitionedModel holding one refit of obj per
fold of a ten-fold partition, or of an n -fold one where the
model has fewer than ten observations.

obj must be a RegressionSVM class object.

CVMdl = crossval (&hellip;, name , value )
accepts one, and only one, of the following Name-Value pairs.

Name Value
'KFold' An integer greater than 1, the number of
folds.
'Holdout' A scalar in (0, 1) , the fraction
of observations held out for testing.
'Leaveout' 'on' or 'off' , whether
to hold out one observation at a time.
'CVPartition' A cvpartition object over as
many observations as the model was trained on.

See also:
RegressionSVM,
RegressionPartitionedModel,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Cross validate a support vector regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
RegressionSVM.discardSupportVectors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 591
RegressionSVM: obj = discardSupportVectors ( obj )

Discard the support vectors of a linear SVM model.

obj = discardSupportVectors ( obj ) empties
Alpha and SupportVectors , leaving Beta and
Bias to decide every prediction. A linear kernel needs
nothing else, so the returned model predicts what it predicted
before while carrying one vector in place of many.

The kernel must be linear. Under any other the support vectors are
part of the decision function and cannot be dropped. Discarding twice
is not an error and changes nothing.

See also:
fitrsvm,
RegressionSVM,
CompactRegressionSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Discard the support vectors of a linear SVM model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
RegressionSVM.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1078
RegressionSVM: L = loss ( obj , X , Y )
RegressionSVM: L = loss (&hellip;, name , value )

Compute the regression loss of a support vector machine model.

L = loss ( obj , X , Y ) returns the
weighted mean squared error between the response Y and the
response the model predicts for X .

obj must be a RegressionSVM class object.

X must be a numeric matrix with the same number of predictors as
the data the model was trained on.

Y must be a numeric vector with as many rows as X .

L = loss (&hellip;, name , value ) accepts the
following Name-Value pairs.

Name Value
'LossFun' 'mse' , the default,
'epsiloninsensitive' , or a function handle called as
lossfun ( Y , yFit , W ) returning a scalar.
The epsilon -insensitive loss charges nothing for an error inside
the tube, max (0, abs ( Y - yFit ) - Epsilon) , which is
the quantity the fit itself minimizes.
'Weights' A numeric vector of observation weights
with one entry per row of X . It defaults to a uniform weight.
The weights are normalized to sum to one before the loss is formed.

See also:
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Compute the regression loss of a support vector machine model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionSVM.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 510
RegressionSVM: yFit = predict ( obj , XC )

Predict the response for new data with a support vector regression
model.

yFit = predict ( obj , XC ) returns a column
vector holding the predicted response for each row of XC .

obj must be a RegressionSVM class object.

XC must be a numeric matrix with the same number of predictors as
the data the model was trained on.

The transformation named by ResponseTransform is applied to the
model&rsquo;s output before it is returned.

See also:
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Predict the response for new data with a support vector regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionSVM.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 401
RegressionSVM: L = resubLoss ( obj )
RegressionSVM: L = resubLoss (&hellip;, name , value )

Compute the resubstitution regression loss of a support vector machine
model.

L = resubLoss ( obj ) returns the weighted mean
squared error of the model on the data it was trained on. It accepts
the same Name-Value pairs as loss .

obj must be a RegressionSVM class object.

See also:
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
Compute the resubstitution regression loss of a support vector machine model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
RegressionSVM.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 334
RegressionSVM: yFit = resubPredict ( obj )

Predict the response of the training data with a support vector
regression model.

yFit = resubPredict ( obj ) returns a column vector
holding the predicted response for every observation the model was
trained on.

obj must be a RegressionSVM class object.

See also:
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 81
Predict the response of the training data with a support vector regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionSVM.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 299
RegressionSVM: savemodel ( obj , filename )

Save a support vector regression model to a file.

savemodel ( obj , filename ) saves every property of
the RegressionSVM object obj into filename in
binary format, so that it can be read back with loadmodel .

See also:
loadmodel,
RegressionSVM,
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Save a support vector regression model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1883
statistics: RegressionTree

Binary decision tree for regression

The RegressionTree class implements a CART binary decision tree.
Growth splits each node on the single predictor and cut point that lower
the squared error of the response the most, and stops when a node is too
small to be a parent, has no split leaving enough observations on both
sides, or already accounts for all but a tolerance of the error the root
carried. The grown tree is then optionally reduced, first by merging
the leaves that buy no accuracy and then by cost complexity pruning,
which orders the branch nodes by how little error their subtrees remove
and records that order so a subtree of any size can be recovered
afterwards with prune .

Create a RegressionTree object by using the fitrtree
function or the class constructor.

The fit is carried out by the compiled engine treetrain and
predictions by treepredict , which the classification tree shares.

An observation missing the predictor a node cuts on descends to neither
child. It is counted in that node and in every node above it, and
predict stops it there and gives it that node&rsquo;s answer, so a row
is never sent down a branch on evidence it does not carry.

A categorical predictor is split into two sets of levels by ordering the
levels by their mean response, and an observation whose level a node did
not see stops there, as one missing the predictor does. The lower means
go left; MATLAB does not always keep that side, and equally good splits
may be chosen differently, so a node&rsquo;s sides and numbering may differ.

What this class does not do yet. Surrogate splits are not
implemented, and an option asking for them is refused rather than
quietly ignored. The six Surrogate properties are therefore
always empty, as they are in MATLAB without surrogate splits.

See also:
fitrtree,
ClassificationTree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Binary decision tree for regression



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.BinEdges


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
RegressionTree: property BinEdges

Bin edges of the predictors

A cell array with one column vector of bin edges per predictor, empty
unless the predictors were binned before fitting. Binning is not
implemented, so this is always empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Bin edges of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionTree.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 220
RegressionTree: property CategoricalPredictors

Indices of the categorical predictors

A row vector of column indices into X , naming the predictors
treated as categorical, empty when none is. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Indices of the categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionTree.CategoricalSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 268
RegressionTree: property CategoricalSplit

Categorical splits of the tree

A Nx2 cell array with one row per categorical split, in node
order, holding the levels sent left and the levels sent right. It is
empty when no split is categorical. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categorical splits of the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.Children


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 197
RegressionTree: property Children

Child nodes of each node

A NumNodesx2 matrix naming the left and the right child of each
node. A leaf carries a zero in both columns. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Child nodes of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
RegressionTree.CutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 254
RegressionTree: property CutCategories

Categories used at each branch

A NumNodesx2 cell array holding, for a node that cuts a
categorical predictor, the levels sent left and the levels sent right.
Every other entry is empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Categories used at each branch



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.CutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
RegressionTree: property CutPoint

Cut point of each node

A column vector holding, for each node, the value the split compares
the predictor against: an observation goes left when its value is less
than the cut point and right otherwise. A leaf and a categorical cut
carry NaN .
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Cut point of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionTree.CutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 260
RegressionTree: property CutPredictor

Name of the predictor each node cuts on

A cell array of character vectors with one entry per node, holding the
name of the predictor the node splits on and an empty character vector
at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Name of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionTree.CutPredictorIndex


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 209
RegressionTree: property CutPredictorIndex

Index of the predictor each node cuts on

A column vector holding, for each node, the column of X the node
splits on, and zero at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Index of the predictor each node cuts on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionTree.CutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 292
RegressionTree: property CutType

Type of cut at each node

A cell array of character vectors holding 'continuous' at a
branch node that cuts a numeric predictor at a point,
'categorical' at one that splits a set of levels, and an empty
character vector at a leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Type of cut at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionTree.ExpandedPredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 306
RegressionTree: property ExpandedPredictorNames

Expanded predictor names

A cell array of character vectors. It differs from
PredictorNames only when a categorical predictor has been
expanded into one column per level, which this class does not do, so
the two are always equal. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Expanded predictor names



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
RegressionTree.HyperparameterOptimizationResults


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
RegressionTree: property HyperparameterOptimizationResults

Results of a hyperparameter optimization

Hyperparameter optimization is not implemented, so this is always
empty. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Results of a hyperparameter optimization



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionTree.IsBranchNode


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 186
RegressionTree: property IsBranchNode

Which nodes are branch nodes

A logical column vector, true for each node that carries a split and
false for each leaf. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Which nodes are branch nodes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionTree.ModelParameters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 619
RegressionTree: property ModelParameters

Parameters the fit was run with

A structure recording the options the tree was grown under:
SplitCriterion , MinParent , MinLeaf ,
MaxSplits , NVarToSample , MergeLeaves ,
Prune , PruneCriterion , QEToler ,
NSurrogate , MaxCat , AlgCat ,
PredictorSelection , Method and Type .
SplitCriterion and PruneCriterion are both
'mse' , the only criterion a regression tree has, and
QEToler is the tolerance growth stops at.

MinParent is the value the fit used, which is
max (MinParentSize, 2 * MinLeafSize) and so may exceed the
'MinParentSize' asked for. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Parameters the fit was run with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionTree.NodeError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 213
RegressionTree: property NodeError

Mean squared error of each node

A column vector holding, for each node, the weighted mean squared
error of the response about the node&rsquo;s mean. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Mean squared error of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.NodeMean


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 266
RegressionTree: property NodeMean

Mean response at each node

A column vector holding, for each node, the weighted mean of the
response over the observations that reached it. It is what
predict answers for a row that comes to rest there. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Mean response at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionTree.NodeProbability


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 251
RegressionTree: property NodeProbability

Probability of reaching each node

A column vector holding, for each node, the total weight of the
observations that reached it, the weights being those in W .
The root carries one. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Probability of reaching each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 255
RegressionTree: property NodeRisk

Risk of each node

A column vector holding, for each node, its mean squared error
weighted by the probability of reaching it, which is the squared error
the node contributes to the whole tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Risk of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.NodeSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 340
RegressionTree: property NodeSize

Number of observations at each node

A column vector holding how many training observations reached each
node. A row missing the predictor its node cuts on is counted at that
node and at none below it, so a parent&rsquo;s size is not in general the
sum of its children&rsquo;s. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Number of observations at each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.NumNodes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 292
RegressionTree: property NumNodes

Number of nodes in the tree

A positive integer, the number of nodes the tree holds, branch nodes
and leaves together. Nodes are numbered as they are created, so a
parent always carries a lower number than either of its children.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Number of nodes in the tree



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
RegressionTree.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 270
RegressionTree: property NumObservations

Number of observations

A positive integer, the number of observations the model was fitted
on. It counts the rows kept, so it is smaller than the number of rows
given whenever a response was missing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionTree.Parent


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
RegressionTree: property Parent

Parent of each node

A column vector naming the parent of each node. The root carries a
zero. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Parent of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionTree.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 168
RegressionTree: property PredictorNames

Names of the predictor variables

A cell array of character vectors with one name per column of
X . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Names of the predictor variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
RegressionTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 364
RegressionTree: property PruneAlpha

Cost complexity parameter of each pruning level

A column vector with one element per level of the pruning sequence,
the first of which is zero and stands for the unpruned tree. Level
L is the smallest subtree that is optimal for every complexity
parameter from PruneAlpha( L +1) up to the next one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Cost complexity parameter of each pruning level



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionTree.PruneList


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 434
RegressionTree: property PruneList

Pruning level of each node

A column vector holding, for each branch node, the level of the cost
complexity sequence at which it stops being a branch node, and zero at
a leaf. Pruning the tree to level L turns every node whose
level is between one and L into a leaf. It is empty when
neither 'Prune' nor 'MergeLeaves' was asked for, since
no sequence was then estimated. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Pruning level of each node



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
RegressionTree.RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2468
RegressionTree: obj = RegressionTree ( X , Y )
RegressionTree: obj = RegressionTree (&hellip;, name , value )

Grow a binary decision tree for regression.

obj = RegressionTree ( X , Y ) grows a tree on
the NxP numeric matrix X of predictor data and the
Nx1 numeric response Y , and returns it as a
RegressionTree object.

obj = RegressionTree (&hellip;, name , value )
takes the options below.

Name Value
'CategoricalPredictors' The predictors whose values
are levels, as indices, as a logical vector with one element per
predictor, or as 'all' .
'MaxNumCategories' A nonnegative integer, recorded
in ModelParameters . The default is 10. A regression orders
the levels by their mean response, which finds the best split whatever
the number of levels.
'MaxNumSplits' A nonnegative integer, the largest
number of branch nodes the tree may take. The default is one less
than the number of observations, which is as many as a tree can have.
'MergeLeaves' 'on' (default) or
'off' . When on, a pair of leaves whose parent is no worse
than the two of them together is merged back into that parent.
'MinLeafSize' A positive integer, the fewest
observations a leaf may hold. The default is 1. A split leaving
fewer than this on either side is not taken.
'MinParentSize' A positive integer, the fewest
observations a node must hold to be split at all. The default is 10.
The value the fit uses is max (MinParentSize, 2 * MinLeafSize) ,
since a smaller node cannot give both children a legal leaf.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'Prune' 'on' (default) or 'off' .
When on, the cost complexity pruning sequence is estimated and
reported in PruneList and PruneAlpha . The tree returned
is the unpruned one either way; prune takes a subtree out of
the sequence.
'PruneCriterion' 'mse' , the only criterion
a regression tree has.
'QuadraticErrorTolerance' A positive scalar. A
node whose squared error has fallen to this fraction of the root&rsquo;s is
not split further. The default is 1e-6.
'ResponseName' A character vector naming the
response. The default is 'Y' .
'ResponseTransform' A character vector naming a
transform to apply to the predicted response, or a function handle.
The default is 'none' .
'SplitCriterion' 'mse' , the only criterion
a regression tree has.
'Weights' A nonnegative numeric vector with one
element per observation. The default is uniform.

See also:
fitrtree,
ClassificationTree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Grow a binary decision tree for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionTree.ResponseName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 137
RegressionTree: property ResponseName

Name of the response variable

A character vector naming the response. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Name of the response variable



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionTree.ResponseTransform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 285
RegressionTree: property ResponseTransform

Transform applied to the predicted response

A character vector naming the function predict applies to the
response it predicts before returning it, or a function handle taking
and returning an array of the same size. The default is
'none' .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Transform applied to the predicted response



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.RowsUsed


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 386
RegressionTree: property RowsUsed

Rows used for fitting

A logical column vector with one element per row of the predictor data
as it was given, true for each row used for fitting. It is empty,
[] , when every row was used, so a non-empty value means that
rows were dropped. Only a missing response drops a row; a row missing
some of its predictors is kept. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Rows used for fitting



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
RegressionTree.SurrogateCutCategories


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 175
RegressionTree: property SurrogateCutCategories

Categories of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Categories of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionTree.SurrogateCutFlip


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
RegressionTree: property SurrogateCutFlip

Cut assignments of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cut assignments of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionTree.SurrogateCutPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 170
RegressionTree: property SurrogateCutPoint

Cut points of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Cut points of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
RegressionTree.SurrogateCutPredictor


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 174
RegressionTree: property SurrogateCutPredictor

Predictors of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Predictors of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
RegressionTree.SurrogateCutType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 164
RegressionTree: property SurrogateCutType

Types of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
Types of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
RegressionTree.SurrogatePredictorAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 206
RegressionTree: property SurrogatePredictorAssociation

Predictive measures of association of the surrogate splits

Surrogate splits are not implemented, so this is always empty. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predictive measures of association of the surrogate splits



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionTree.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 209
RegressionTree: property W

Observation weights

A numeric column vector of the weights the fit used, one per retained
observation. They are the weights given, scaled to sum to one. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionTree.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
RegressionTree: property X

Predictor data

A numeric matrix holding the predictor data the model was fitted on.
Each column is one predictor and each row one observation. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
RegressionTree.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
RegressionTree: property Y

Response data

A numeric column vector with one element per row of X , holding
the observed response of each observation. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionTree.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 365
RegressionTree: CMdl = compact ( obj )

Drop the training data from a trained model.

CMdl = compact ( obj ) returns a
CompactRegressionTree object carrying the tree and everything
predict needs, but not the observations the model was fitted
on. It answers new data identically and is far smaller to keep or to
ship.

See also:
CompactRegressionTree,
RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Drop the training data from a trained model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionTree.crossval


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 916
RegressionTree: CVMdl = crossval ( obj )
RegressionTree: CVMdl = crossval (&hellip;, name , value )

Cross-validate a trained decision tree.

CVMdl = crossval ( obj ) partitions the training data
into ten folds, or into as many folds as there are observations when
there are fewer than ten, grows a tree on the training part of each
and returns them as a RegressionPartitionedModel .

CVMdl = crossval (&hellip;, name , value ) takes
one of the following, and one only.

Name Value
'KFold' An integer greater than 1, the number of
folds.
'Holdout' A value between 0 and 1, the fraction of
the data held out for testing, which gives a single fold.
'Leaveout' 'on' or 'off' , one fold
per observation.
'CVPartition' A cvpartition object.

Every fold is grown with the growth parameters the parent was grown
with and a slice of its observation weights.

See also:
RegressionPartitionedModel,
RegressionTree,
cvpartition


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Cross-validate a trained decision tree.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
RegressionTree.cvloss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1961
RegressionTree: E = cvloss ( obj )
RegressionTree: [ E , SE , Nleaf , BestLevel ] = cvloss ( obj )
RegressionTree: [&hellip;] = cvloss (&hellip;, name , value )

Cross-validated loss of a tree and of its subtrees.

E = cvloss ( obj ) partitions the training data into
ten folds, grows a tree on the training part of each, and returns the
mean squared error of the held-out part.

[ E , SE , Nleaf , BestLevel ] = cvloss
(&hellip;) also returns SE , the standard error of E over
the folds, Nleaf , the number of leaves each subtree holds, and
BestLevel , the pruning level chosen by 'TreeSize' . Each
has one element per subtree asked for.

[&hellip;] = cvloss (&hellip;, name , value ) takes the
options below.

Name Value
'SubTrees' A vector of pruning levels in ascending
order, or 'all' for every level of the sequence. The default
is 0, the unpruned tree.
'TreeSize' 'se' (default), the smallest
subtree whose loss is within one standard error of the smallest loss,
or 'min' , the smallest subtree of least loss.
'KFold' An integer greater than 1, the number of
folds. The default is 10. A value above the number of observations
is reduced to it.

A fold&rsquo;s tree is pruned to the level its own sequence gives for the
geometric mean of the parent&rsquo;s two neighbouring complexity parameters,
which is the classical way a fold is matched to a subtree of the whole
tree. The last level takes every fold&rsquo;s tree back to its root. The
partition is drawn over the observations rather than over a response
there is nothing to stratify, and the loss is weighed by the model&rsquo;s
own weights.

The standard error is not MATLAB&rsquo;s. This is the standard
error of the loss over the folds, which is what the name means. Its
value is not MATLAB&rsquo;s, whose formula is not recoverable from what it
reports; E , Nleaf and BestLevel are measured and
match.

See also:
RegressionTree,
RegressionTree.prune,
RegressionTree.crossval,
RegressionTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Cross-validated loss of a tree and of its subtrees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 733
RegressionTree: L = loss ( obj , X , Y )
RegressionTree: L = loss (&hellip;, name , value )

Regression loss on new data.

L = loss ( obj , X , Y ) returns the
weighted mean squared error of the response the model predicts for
X against the observed response Y . A row whose response
is missing is dropped, as it is when fitting.

L = loss (&hellip;, name , value ) takes the
following options.

Name Value
'LossFun' 'mse' , the default, or a function
handle taking the true response, the predicted response and the
weights, and returning a numeric scalar.
'Weights' A numeric vector of observation weights,
one per row of X , normalized to sum to one before it is applied.

See also:
RegressionTree,
fitrtree,
RegressionTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Regression loss on new data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
RegressionTree.nodeVariableRange


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 484
RegressionTree: r = nodeVariableRange ( obj , node )

Range of each predictor at a node.

r = nodeVariableRange ( obj , node ) returns a
structure with one field per predictor the path from the root to
node cuts on, holding the two-element range of values that reach
the node, or for a categorical predictor the levels that reach it. A
predictor the path never cuts on is unconstrained and is left out, so
the root gives a structure with no fields.

See also:
RegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Range of each predictor at a node.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
RegressionTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 678
RegressionTree: yFit = predict ( obj , XC )
RegressionTree: [ yFit , node ] = predict (&hellip;)

Predict the response with a trained RegressionTree object.

yFit = predict ( obj , XC ) sends each row of
XC down the tree and returns the mean response of the node it
comes to rest at, after ResponseTransform . XC must have
as many columns as the predictor data the model was fitted on.

[ yFit , node ] = predict (&hellip;) also returns the
number of the node each row landed in.

A row missing the predictor a node cuts on is stopped at that node and
takes its answer, rather than being sent down a branch on evidence the
row does not carry.

See also:
RegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predict the response with a trained RegressionTree object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
RegressionTree.predictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 685
RegressionTree: imp = predictorImportance ( obj )

Estimate the importance of each predictor.

imp = predictorImportance ( obj ) returns a row
vector with one element per predictor, holding the total drop in risk
the splits on that predictor bring about, divided by the number of
branch nodes. A predictor the tree never splits on scores zero.

The drop at a branch node is its NodeRisk less the risk of its
two children and less what it holds back, so a predictor that is
chosen often, high up, and on nodes it separates well, scores highest.
The numbers are comparable between predictors of one tree and not
between trees.

See also:
RegressionTree,
fitrtree,
RegressionTree.NodeRisk


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Estimate the importance of each predictor.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
RegressionTree.prune


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1135
RegressionTree: obj2 = prune ( obj )
RegressionTree: obj2 = prune ( obj , 'Level' , L )
RegressionTree: obj2 = prune ( obj , 'Alpha' , A )
RegressionTree: obj2 = prune ( obj , 'Nodes' , N )

Take a subtree out of the pruning sequence.

obj2 = prune ( obj ) returns the tree unchanged.

obj2 = prune ( obj , 'Level' , L ) turns
every branch node whose PruneList level is between one and
L into a leaf and discards everything below it. Level zero is
the tree itself and the largest level is the root alone. A level
above the largest prunes to the root and warns.

obj2 = prune ( obj , 'Alpha' , A ) prunes
to the smallest subtree that is optimal for the cost complexity
parameter A , which is the largest level whose PruneAlpha
does not exceed it.

obj2 = prune ( obj , 'Nodes' , N ) turns
the branch nodes named in N into leaves, along with everything
below them, and leaves the rest of the tree alone.

Pruning renumbers the nodes, so the properties of the returned tree
are those of a tree of that shape and not a subset of the original&rsquo;s.

See also:
RegressionTree,
fitrtree,
RegressionTree.PruneList,
RegressionTree.PruneAlpha


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Take a subtree out of the pruning sequence.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionTree.resubLoss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
RegressionTree: L = resubLoss ( obj )
RegressionTree: L = resubLoss (&hellip;, name , value )

Regression loss on the training data.

L = resubLoss ( obj ) is loss over the
training data, weighed as the fit weighed it, and takes the same
'LossFun' option. Giving 'Weights' weighs the
training data some other way instead.

See also:
RegressionTree,
RegressionTree.loss


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Regression loss on the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
RegressionTree.resubPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 211
RegressionTree: yFit = resubPredict ( obj )

Predict the training response with the model fitted to it.

yFit = resubPredict ( obj ) is
predict ( obj , obj .X) .

See also:
RegressionTree,
RegressionTree.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 58
Predict the training response with the model fitted to it.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionTree.savemodel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 465
RegressionTree: savemodel ( obj , filename )

Save a RegressionTree model to a file.

savemodel ( obj , filename ) saves each property of a
RegressionTree object into an Octave binary file, the name of which is
specified in filename , along with an extra variable, which
defines the type of regression object these variables constitute. Use
loadmodel in order to load a regression object into Octave&rsquo;s
workspace.

See also:
loadmodel,
fitrtree,
RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Save a RegressionTree model to a file.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
RegressionTree.view


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 397
RegressionTree: view ( obj )

Print the tree as text.

view ( obj ) prints one line per node: a branch node names
the predictor it cuts on, the cut point, and the node each side leads
to, and a leaf names the response it fits. A branch node&rsquo;s line ends
with the response it would fit itself, which is the answer an
observation missing that predictor gets.

See also:
RegressionTree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Print the tree as text.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 816
statistics: TreeBagger

Ensemble of bagged decision trees

A TreeBagger object is a random forest: an ensemble of decision
trees, each grown on a bootstrap sample of the training data and each
choosing every split from a random subset of the predictors. The
ensemble predicts by averaging its trees, their class probabilities for
classification and their responses for regression.

Every observation a tree&rsquo;s sample leaves out is out of bag for that tree,
and the out-of-bag methods judge the ensemble on those observations
alone, giving an estimate of its error on new data without a separate
test set.

Create one with the TreeBagger constructor. The compact
method drops the training data and returns a CompactTreeBagger .

See also:
CompactTreeBagger,
ClassificationTree,
RegressionTree,
fitctree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Ensemble of bagged decision trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
TreeBagger.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 272
TreeBagger: property ClassNames

Names of the classes

The classes of a classification ensemble, in the type of the response
and in the order its scores are laid out: sorted, or the order given by
'ClassNames' . Empty for a regression ensemble. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Names of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
TreeBagger.ComputeOOBPrediction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
TreeBagger: property ComputeOOBPrediction

Whether out-of-bag information is kept

A logical scalar, false unless the ensemble was fitted with
'OOBPrediction' set to 'on' . The out-of-bag methods
need it. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Whether out-of-bag information is kept



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
TreeBagger.ComputeOOBPredictorImportance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 275
TreeBagger: property ComputeOOBPredictorImportance

Whether out-of-bag predictor importance is computed

A logical scalar, false unless the ensemble was fitted with
'OOBPredictorImportance' set to 'on' , which keeps the
out-of-bag information too. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
Whether out-of-bag predictor importance is computed



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
TreeBagger.Cost


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 324
TreeBagger: property Cost

Misclassification costs

A square matrix, Cost(i,j) being the cost of classifying an
observation of class i as class j . The trees are grown
with it; the ensemble&rsquo;s label is the class of highest average score, as
MATLAB documents. Empty for a regression ensemble. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Misclassification costs



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
TreeBagger.DefaultYfit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 345
TreeBagger: property DefaultYfit

Prediction for an observation no tree may answer for

For classification, the class of greatest prior probability, in the
type of ClassNames ; for regression, the weighted mean of the
response. An out-of-bag prediction takes it for an observation that is
in the sample of every tree. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Prediction for an observation no tree may answer for



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
TreeBagger.DeltaCriterionDecisionSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 238
TreeBagger: property DeltaCriterionDecisionSplit

Split criterion contributions of the predictors

A row vector with one element per predictor, the mean over the trees
of each tree&rsquo;s predictorImportance . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Split criterion contributions of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
TreeBagger.InBagFraction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 205
TreeBagger: property InBagFraction

Size of each tree&rsquo;s sample

A number greater than 0 and no greater than 1. Each tree is grown on
ceil (InBagFraction * N) observations. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Size of each tree's sample



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
TreeBagger.MergeLeaves


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 156
TreeBagger: property MergeLeaves

Whether the trees merge leaves

A logical scalar, false unless 'MergeLeaves' was set to
'on' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Whether the trees merge leaves



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
TreeBagger.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 113
TreeBagger: property Method

Type of the ensemble

'classification' or 'regression' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Type of the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
TreeBagger.MinLeafSize


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
TreeBagger: property MinLeafSize

Fewest observations a leaf may hold

A positive integer, 1 by default for classification and 5 for
regression. A node is split only when it holds at least twice as many.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Fewest observations a leaf may hold



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
TreeBagger.NumPredictorSplit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 288
TreeBagger: property NumPredictorSplit

Decision splits on each predictor

A row vector with one element per predictor, the sum over the trees of
the share of each tree&rsquo;s branch nodes that split on the predictor. A
tree without branch nodes adds nothing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Decision splits on each predictor



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
TreeBagger.NumPredictorsToSample


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 264
TreeBagger: property NumPredictorsToSample

Predictors each split is chosen from

A positive integer, or 'all' . The default is the square root
of the number of predictors for classification and a third of it for
regression, rounded up. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Predictors each split is chosen from



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
TreeBagger.NumTrees


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
TreeBagger: property NumTrees

Number of trees

A positive integer, the number of trees in the ensemble. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Number of trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
TreeBagger.OOBIndices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 231
TreeBagger: property OOBIndices

Which observations each tree left out

An NxNumTrees logical matrix, true where an observation is not
in a tree&rsquo;s sample. Empty unless ComputeOOBPrediction is true.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Which observations each tree left out



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
TreeBagger.OOBInstanceWeight


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 203
TreeBagger: property OOBInstanceWeight

Number of trees each observation is out of bag for

A column with one count per observation. Empty unless
ComputeOOBPrediction is true. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Number of trees each observation is out of bag for



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
TreeBagger.OOBPermutedPredictorCountRaiseMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 482
TreeBagger: property OOBPermutedPredictorCountRaiseMargin

Margins lowered less margins raised when a predictor is permuted

A row vector with one element per predictor, computed as
OOBPermutedPredictorDeltaError is from the number of each tree&rsquo;s
out-of-bag observations whose margin the permutation lowers less the
number whose margin it raises. Empty for a regression ensemble.
Reading it is an error unless ComputeOOBPredictorImportance is
true. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Margins lowered less margins raised when a predictor is permuted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
TreeBagger.OOBPermutedPredictorDeltaError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 606
TreeBagger: property OOBPermutedPredictorDeltaError

Rise in out-of-bag error when a predictor is permuted

A row vector with one element per predictor. For each tree, the
values of the predictor are permuted among the observations out of its
bag, and the tree&rsquo;s error on them, the misclassification share or the
mean squared error weighted by W , is taken before and after.
The element is the mean of the rise over the trees divided by its
standard deviation over the trees, zero when the mean is zero. Reading
it is an error unless ComputeOOBPredictorImportance is true.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Rise in out-of-bag error when a predictor is permuted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
TreeBagger.OOBPermutedPredictorDeltaMeanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 468
TreeBagger: property OOBPermutedPredictorDeltaMeanMargin

Fall in out-of-bag mean margin when a predictor is permuted

A row vector with one element per predictor, computed as
OOBPermutedPredictorDeltaError is from each tree&rsquo;s weighted mean
classification margin on its out-of-bag observations, before the
permutation less after it. Empty for a regression ensemble. Reading
it is an error unless ComputeOOBPredictorImportance is true.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 59
Fall in out-of-bag mean margin when a predictor is permuted



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
TreeBagger.OutlierMeasure


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 395
TreeBagger: property OutlierMeasure

Outlier measure of the training observations

A column with one element per observation, computed from
Proximity as CompactTreeBagger.outlierMeasure computes
it, within each class for classification and over every observation
for regression. Reading it is an error until fillprox fills it,
and growTrees and append empty it again. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Outlier measure of the training observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
TreeBagger.PredictorNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 149
TreeBagger: property PredictorNames

Names of the predictors

A cell array of character vectors naming the columns of X . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Names of the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
TreeBagger.Prior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
TreeBagger: property Prior

Prior probabilities of the classes

A row vector with one probability per class, in the order of
ClassNames . Every tree is grown with this prior, restricted to
the classes its sample holds. Empty for a regression ensemble. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Prior probabilities of the classes



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
TreeBagger.Proximity


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 316
TreeBagger: property Proximity

Proximity of the training observations

A symmetric NxN matrix whose element (i,j) is the share
of the trees that bring training observations i and j to
the same leaf. Reading it is an error until fillprox fills it,
and growTrees and append empty it again. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Proximity of the training observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
TreeBagger.Prune


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 187
TreeBagger: property Prune

Whether the trees estimate a pruning sequence

A logical scalar, false unless 'Prune' was set to 'on' .
The trees are never pruned. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Whether the trees estimate a pruning sequence



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
TreeBagger.SampleWithReplacement


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 154
TreeBagger: property SampleWithReplacement

Whether the samples are drawn with replacement

A logical scalar, true by default. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Whether the samples are drawn with replacement



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
TreeBagger.SurrogateAssociation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 242
TreeBagger: property SurrogateAssociation

Predictive association between the predictors

A square matrix with one row and one column per predictor. The trees
grow no surrogate splits, so it is the identity matrix. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Predictive association between the predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
TreeBagger.TreeArguments


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 217
TreeBagger: property TreeArguments

Options given to the trees

A cell array of the Name-Value pairs given to the constructor that are
passed on to every tree, in the order they were given. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Options given to the trees



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
TreeBagger.TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3416
TreeBagger: B = TreeBagger ( NumTrees , X , Y )
TreeBagger: B = TreeBagger (&hellip;, name , value )

Grow an ensemble of bagged decision trees.

B = TreeBagger ( NumTrees , X , Y ) grows
NumTrees classification trees on the NxP predictor matrix
X and the response Y . Y holds a class label per row,
as a numeric or logical vector, a categorical, string or character
array, or a cell array of character vectors. An observation whose
response is missing is left out; one missing a predictor is kept.

Each tree is grown on a sample of ceil (InBagFraction * N)
observations, drawn with replacement in proportion to the weights, and
chooses every split from NumPredictorsToSample predictors drawn
afresh at each node. The trees are neither pruned nor merged unless
asked. The random numbers come from Octave&rsquo;s generator, so rng
reproduces an ensemble.

Name-Value arguments of the ensemble:

Name Value
'Method' 'classification' (default) or
'regression' , for a real numeric response.
'NumPredictorsToSample' A positive integer or
'all' . The default is ceil (sqrt (P)) for classification
and ceil (P / 3) for regression.
'MinLeafSize' A positive integer, 1 by default
for classification and 5 for regression.
'InBagFraction' The share of the observations in
each sample, greater than 0 and no greater than 1. The default is 1.
'SampleWithReplacement' 'on' (default)
or 'off' .
'OOBPrediction' 'off' (default) or
'on' , to keep what the out-of-bag methods need. Sampling
without replacement at an 'InBagFraction' of 1 leaves nothing
out of bag, so the two are refused together.
'OOBPredictorImportance' 'off' (default)
or 'on' , to estimate the importance of each predictor by
permuting it among each tree&rsquo;s out-of-bag observations. It turns
'OOBPrediction' on.
'Weights' A nonnegative vector with one weight
per observation. The default is uniform.
'Prior' 'empirical' (default),
'uniform' , a vector with one probability per class, or a
structure with fields ClassNames and ClassProbs .
Classification only.
'Cost' A square matrix of misclassification
costs, or a structure with fields ClassNames and
ClassificationCosts . Classification only.
'ClassNames' The classes to fit, in the order
their scores are to be laid out; observations of other classes are left
out. Classification only.
'PredictorNames' A cell array of character
vectors naming the columns of X .
'NumPrint' A nonnegative integer. After every
that many trees a line saying how many are done is printed. The
default, 0, prints nothing.

'CategoricalPredictors' , 'MaxNumCategories' ,
'MaxNumSplits' , 'MergeLeaves' , 'Prune' ,
'PruneCriterion' and 'SplitCriterion' are passed on to
every tree, and so are 'AlgorithmForCategorical' for
classification and 'QuadraticErrorTolerance' for regression;
see fitctree and fitrtree . Merging leaves is allowed but
warned against.

Surrogate splits, parallel growth and tall arrays are not implemented,
and an option asking for one of them is refused.

MATLAB returns classification labels as a cell array of character
vectors whatever the type of the response; this ensemble returns them,
and its ClassNames and DefaultYfit , in the type of the
response, as every other classifier in this package does. Code that
converts MATLAB&rsquo;s labels with str2double will get NaN
from a numeric response here, its labels already being numbers.

See also:
TreeBagger,
CompactTreeBagger,
fitctree,
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Grow an ensemble of bagged decision trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
TreeBagger.Trees


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 182
TreeBagger: property Trees

The trees of the ensemble

A column cell array holding one CompactClassificationTree or
CompactRegressionTree object per tree. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
The trees of the ensemble



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
TreeBagger.W


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
TreeBagger: property W

Observation weights

A column of weights summing to one, one per observation. For
classification each class&rsquo;s weights sum to its prior. The bootstrap
draws observations in proportion to these weights, and the out-of-bag
error is weighted by them. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Observation weights



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
TreeBagger.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
TreeBagger: property X

Predictor data

The predictors the ensemble was fitted on, one row per observation. A
row whose response is missing is not kept. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Predictor data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
TreeBagger.Y


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 188
TreeBagger: property Y

Response data

The response the ensemble was fitted on, in the type it was given in,
without the observations whose response is missing. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
Response data



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
TreeBagger.append


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 457
TreeBagger: B = append ( B1 , B2 )

Add the trees of one ensemble to another.

B is B1 with the trees of B2 appended. The two must
be of the same type, fitted on the same number of observations, with
the same classes and priors, and must agree on whether they keep
out-of-bag information and predictor importance, which are then
joined. A proximity matrix filled by fillprox is emptied.

See also:
TreeBagger,
TreeBagger.growTrees,
CompactTreeBagger.combine


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Add the trees of one ensemble to another.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
TreeBagger.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 280
TreeBagger: C = compact ( obj )

Drop the training data from an ensemble.

C = compact ( obj ) returns a
CompactTreeBagger object holding the trees and what prediction
needs. It predicts new data identically, and has no out-of-bag
methods.

See also:
CompactTreeBagger,
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Drop the training data from an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
TreeBagger.error


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
TreeBagger: err = error ( obj , X , Y )
TreeBagger: err = error (&hellip;, name , value )

Misclassification probability or mean squared error of the ensemble.

Behaves as CompactTreeBagger.error and takes the same Name-Value
arguments.

See also:
TreeBagger,
TreeBagger.oobError,
CompactTreeBagger.error


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Misclassification probability or mean squared error of the ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
TreeBagger.fillprox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 603
TreeBagger: B = fillprox ( obj )
TreeBagger: B = fillprox (&hellip;, name , value )

Fill the proximity matrix of the training data.

B is the ensemble with Proximity holding the share of the
trees that bring each pair of training observations to the same leaf,
and OutlierMeasure the outlier measure computed from it.
'Trees' is 'all' (default) or a vector of indices of
the trees to use. 'NumPrint' is a nonnegative integer; after
every that many trees a line saying how many are done is printed.

See also:
TreeBagger,
TreeBagger.mdsprox,
CompactTreeBagger.proximity,
CompactTreeBagger.outlierMeasure


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Fill the proximity matrix of the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
TreeBagger.growTrees


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 470
TreeBagger: B = growTrees ( obj , NumTrees )
TreeBagger: B = growTrees (&hellip;, &rsquo;NumPrint&rsquo;, n )

Grow more trees in an ensemble.

B is the ensemble with NumTrees further trees grown exactly
as the first were, their out-of-bag information added. A proximity
matrix filled by fillprox is emptied, as it no longer describes
the ensemble; MATLAB keeps it unchanged.
'NumPrint' is taken as by the TreeBagger constructor.

See also:
TreeBagger,
TreeBagger.append


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Grow more trees in an ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
TreeBagger.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
TreeBagger: m = margin ( obj , X , Y )
TreeBagger: m = margin (&hellip;, name , value )

Classification margin of each observation.

Behaves as CompactTreeBagger.margin and takes the same Name-Value
arguments.

See also:
TreeBagger,
TreeBagger.oobMargin,
CompactTreeBagger.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Classification margin of each observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
TreeBagger.mdsprox


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1070
TreeBagger: [ S , E ] = mdsprox ( obj )
TreeBagger: [ S , E ] = mdsprox (&hellip;, name , value )

Multidimensional scaling of the proximity matrix.

Applies classical multidimensional scaling, as cmdscale does, to
the distances 1 - Proximity . S holds the scaled
coordinates, one column per positive eigenvalue, and E the
eigenvalues. fillprox must have filled Proximity first.

Name-Value arguments:

Name Value
'Keep' 'all' (default), or a vector of
indices or a logical vector selecting the training observations to
scale.
'Colors' A character vector with one color
letter per class. When given, the scaled coordinates are drawn as
overlaid scatter plots, one per class, a class beyond the number of
letters not drawn; a regression ensemble is drawn in the first color.
'MDSCoordinates' Two or three indices of the
columns of S to draw. The default is [1, 2] . They must
not exceed the number of columns of S even when nothing is drawn,
as in MATLAB, whose documentation says otherwise.

See also:
TreeBagger,
TreeBagger.fillprox,
CompactTreeBagger.mdsprox,
cmdscale


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
Multidimensional scaling of the proximity matrix.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
TreeBagger.meanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 295
TreeBagger: mm = meanMargin ( obj , X , Y )
TreeBagger: mm = meanMargin (&hellip;, name , value )

Weighted mean classification margin.

Behaves as CompactTreeBagger.meanMargin and takes the same
Name-Value arguments.

See also:
TreeBagger,
TreeBagger.oobMeanMargin,
CompactTreeBagger.meanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Weighted mean classification margin.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
TreeBagger.oobError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 621
TreeBagger: err = oobError ( obj )
TreeBagger: err = oobError (&hellip;, name , value )

Out-of-bag misclassification probability or mean squared error.

The error of the out-of-bag predictions on the training data, weighted
by W . In 'individual' mode each tree is judged on its
own, the observations in its sample taking DefaultYfit , and
every observation counts in every mode, as MATLAB counts it.
'Mode' , 'Trees' , 'TreeWeights' and
'Weights' are taken as by CompactTreeBagger.error . The
ensemble must have been fitted with 'OOBPrediction' on.

See also:
TreeBagger,
TreeBagger.oobPredict,
TreeBagger.oobMeanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Out-of-bag misclassification probability or mean squared error.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
TreeBagger.oobMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 399
TreeBagger: m = oobMargin ( obj )
TreeBagger: m = oobMargin (&hellip;, name , value )

Out-of-bag classification margin of each training observation.

The margins of the out-of-bag predictions, with 'Mode' ,
'Trees' and 'TreeWeights' taken as by
CompactTreeBagger.margin . The ensemble must have been fitted
with 'OOBPrediction' on.

See also:
TreeBagger,
TreeBagger.oobMeanMargin,
TreeBagger.margin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Out-of-bag classification margin of each training observation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
TreeBagger.oobMeanMargin


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 338
TreeBagger: mm = oobMeanMargin ( obj )
TreeBagger: mm = oobMeanMargin (&hellip;, name , value )

Out-of-bag mean classification margin.

The mean of TreeBagger.oobMargin , weighted by W unless
'Weights' are given. The ensemble must have been fitted with
'OOBPrediction' on.

See also:
TreeBagger,
TreeBagger.oobMargin,
TreeBagger.oobError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Out-of-bag mean classification margin.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
TreeBagger.oobPredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 650
TreeBagger: label = oobPredict ( obj )
TreeBagger: [ label , scores , stdevs ] = oobPredict (&hellip;)
TreeBagger: [ Yfit , stdevs ] = oobPredict (&hellip;)
TreeBagger: &hellip; = oobPredict (&hellip;, &rsquo;Trees&rsquo;, trees )

Out-of-bag predictions for the training data.

Each observation is predicted by the trees whose samples left it out,
as TreeBagger.predict would with those trees alone. An
observation in the sample of every tree used takes DefaultYfit ,
with the prior as its scores. 'Trees' restricts the trees.
The ensemble must have been fitted with 'OOBPrediction' on.

See also:
TreeBagger,
TreeBagger.oobError,
TreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Out-of-bag predictions for the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
TreeBagger.oobQuantileError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 768
TreeBagger: err = oobQuantileError ( obj )
TreeBagger: err = oobQuantileError (&hellip;, name , value )

Out-of-bag quantile loss of a regression ensemble.

The loss of TreeBagger.quantileError on the training data, the
quantiles predicted out of bag as by
TreeBagger.oobQuantilePredict and the observations weighted by
W . 'Mode' , 'Quantile' , 'Trees' and
'TreeWeights' are taken as by TreeBagger.quantileError .
The ensemble must have been fitted with 'OOBPrediction' on.

In 'individual' mode each tree is judged on the observations
out of its own bag alone, and a tree that left nothing out has a
NaN loss. MATLAB R2024a fails with an indexing error in that
mode.

See also:
TreeBagger,
TreeBagger.oobQuantilePredict,
TreeBagger.quantileError,
TreeBagger.oobError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Out-of-bag quantile loss of a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
TreeBagger.oobQuantilePredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 658
TreeBagger: YFit = oobQuantilePredict ( obj )
TreeBagger: [ YFit , YW ] = oobQuantilePredict (&hellip;)
TreeBagger: &hellip; = oobQuantilePredict (&hellip;, name , value )

Out-of-bag quantile predictions for the training data.

Each training observation is predicted as by
TreeBagger.quantilePredict , by the trees whose samples left it
out. An observation in the sample of every tree used takes
quantile ( obj .Y, tau ) . YW is NxN .
'Quantile' , 'Trees' and 'TreeWeights' are taken
as by TreeBagger.quantilePredict . The ensemble must have been
fitted with 'OOBPrediction' on.

See also:
TreeBagger,
TreeBagger.quantilePredict,
TreeBagger.oobQuantileError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Out-of-bag quantile predictions for the training data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
TreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 505
TreeBagger: label = predict ( obj , X )
TreeBagger: [ label , scores ] = predict (&hellip;)
TreeBagger: [ label , scores , stdevs ] = predict (&hellip;)
TreeBagger: [ Yfit , stdevs ] = predict (&hellip;)
TreeBagger: &hellip; = predict (&hellip;, name , value )

Predict responses with a bagged ensemble.

Behaves as CompactTreeBagger.predict , and takes the same
'Trees' , 'TreeWeights' and 'UseInstanceForTree'
Name-Value arguments.

See also:
TreeBagger,
TreeBagger.oobPredict,
CompactTreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Predict responses with a bagged ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
TreeBagger.quantileError


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1172
TreeBagger: err = quantileError ( obj , X , Y )
TreeBagger: err = quantileError (&hellip;, name , value )

Quantile loss of a regression ensemble.

For each quantile probability tau , err is the weighted
mean over the observations of the pinball loss, tau (y - q)
where the response y is not below the predicted quantile
q and (1 - tau) (q - y) where it is. The quantiles are
predicted as by TreeBagger.quantilePredict .

In 'ensemble' mode, the default, err is a row with one
element per quantile. In 'cumulative' mode it has one row per
tree, the loss of the first tree, then of the first two, and so on, and
in 'individual' mode one row per tree, each on its own.

Name-Value arguments:

Name Value
'Mode' 'ensemble' (default),
'cumulative' or 'individual' .
'Quantile' A vector of probabilities between 0
and 1. The default is 0.5.
'Weights' A nonnegative vector with one weight
per observation. The default is uniform.

'Trees' , 'TreeWeights' and 'UseInstanceForTree'
are taken as by TreeBagger.quantilePredict , and
'TreeWeights' may not be given in 'individual' mode.

See also:
TreeBagger,
TreeBagger.quantilePredict,
TreeBagger.oobQuantileError,
TreeBagger.error


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Quantile loss of a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
TreeBagger.quantilePredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1724
TreeBagger: YFit = quantilePredict ( obj , X )
TreeBagger: [ YFit , YW ] = quantilePredict (&hellip;)
TreeBagger: &hellip; = quantilePredict (&hellip;, name , value )

Predict quantiles of the response with a regression ensemble.

Each tree gives every training observation a weight for each row of
X : the number of times the tree&rsquo;s sample holds the observation,
divided by the size of the leaf the row comes to rest at, when the
observation is in that leaf, and zero otherwise. The weights are
averaged over the trees, with their tree weights, into YW , a
sparse NxM matrix with one row per training observation and one
column per row of X , each column summing to one.

YFit is an MxQ matrix holding, for each row of X and
each quantile probability, the quantile of the training responses under
those weights. The responses are sorted, each keeping its own weight,
and the quantile is interpolated linearly between them at their
cumulative weights less half their own weight, taking the smallest or
the largest response beyond either end. A row no tree may answer for
takes quantile ( obj .Y, tau ) , and its column of
YW weighs every training observation equally. The observation
weights enter only through the samples they drew.

Name-Value arguments:

Name Value
'Quantile' A vector of probabilities tau
between 0 and 1. The default is 0.5, the median.
'Trees' 'all' (default) or a vector of
indices of the trees to use.
'TreeWeights' A nonnegative vector with one
weight per tree used. The default weighs them equally.
'UseInstanceForTree' An MxNumTrees
logical matrix saying which tree may answer for which row.

See also:
TreeBagger,
TreeBagger.oobQuantilePredict,
TreeBagger.quantileError,
TreeBagger.predict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Predict quantiles of the response with a regression ensemble.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
designecoc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2032
statistics: M = designecoc ( K , name )
statistics: M = designecoc (&hellip;, 'NumTrials' , n )

Coding design matrix for an error correcting output codes model.

M = designecoc ( K , name ) returns the coding design
for K classes named by name . M is a KxL matrix of
-1, 0 and +1 with one row per class and one column per binary learner: a
learner is trained to tell the classes marked +1 in its column from those
marked -1, and a class marked 0 takes no part in it.

K must be an integer of at least 2. name must be one of:

Design Columns Description
'onevsone' K(K-1)/2 One column per pair of
classes, the earlier class +1 and the later -1, pairs taken in order.
'onevsall' K One column per class, that
class +1 and every other -1.
'binarycomplete' 2^(K-1)-1 Every way of
splitting the classes into two non-empty groups, with the first class
always +1.
'ternarycomplete' (3^K-2^(K+1)+1)/2 Every
way of splitting into two non-empty groups while leaving any classes out.
It grows fast: 28501 columns at K = 10 .
'ordinal' K-1 Column j separates the
first j classes from the rest, for classes that are ordered.
'denserandom' about 10log_2 K Random -1 and
+1, no class left out.
'sparserandom' about 15log_2 K Random -1, 0
and +1, a class left out of a column with probability 0.5 .

M = designecoc (&hellip;, 'NumTrials' , n ) draws
n random designs and keeps the one whose rows are furthest apart,
which is what makes a random design correct errors. The default is 10000.
It is accepted but does nothing for the five designs that are not random.

K = 2 gives the single column [-1; 1] whatever the design,
there being only one way to tell two classes apart.

Deviation from MATLAB

The two random designs cannot be reproduced from MATLAB and neither can
their width. Measured on R2024a: five runs at K = 10 gave
'denserandom' 38, 38, 38, 40 and 40 columns and
'sparserandom' 57, 55, 55 and 54, so the number of columns varies
between runs of MATLAB itself. The five other designs are exact.

See also:
fitcecoc,
ClassificationECOC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Coding design matrix for an error correcting output codes model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3477
statistics: Mdl = fitcdiscr ( X , Y )
statistics: Mdl = fitcdiscr (&hellip;, name , value )

Fit a Linear Discriminant Analysis classification model.

Mdl = fitcdiscr ( X , Y ) returns a Linear Discriminant
Analysis (LDA) classification model, Mdl , with X being the
predictor data, and Y the class labels of observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is N&times;1 matrix or cell matrix containing the class labels of
corresponding predictor data in X . Y can be numerical, logical,
char array or cell array of character vectors. Y must have same number
of rows as X .

Mdl = fitcdiscr (&hellip;, name , value ) returns a
Linear Discriminant Analysis model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'PredictorNames' A cell array of character vectors
specifying the names of the predictors. The length of this array must match
the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the Discriminant model. ClassNames
are of the same type as the class labels in Y . The model keeps
the classes in this order; by default they are sorted.
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
Alternatively, you can specify 'empirical' to use the empirical
class probabilities or 'uniform' to assume equal class probabilities.
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . They weigh the class means and
covariances, the covariances being unbiased for them, and an empirical
prior sums them per class. Only their proportions matter, and a row of
zero weight is left out of the fit.
'Cost' A N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X where
R is the number of unique categories in Y . If an instance is
correctly classified into its category the cost is calculated to be 1,
otherwise 0. cost matrix can be altered use Mdl.cost = somecost .
default value cost = ones(rows(X),numel(unique(Y))) .
'DiscrimType' A character vector naming the type of
discriminant analysis to perform, one of 'linear' (default),
'quadratic' , 'diagLinear' , 'diagQuadratic' ,
'pseudoLinear' or 'pseudoQuadratic' . A linear type pools
one covariance across the classes and a quadratic type estimates one per
class; a 'diag' type keeps only the variances, and a
'pseudo' type inverts a singular covariance rather than refusing
it. The property may be reassigned after fitting, but only within its own
family, since the family decides which covariances the fit estimates.
'FillCoeffs' A character vector or string scalar
with values 'on' or 'off' specifying whether to fill the
coefficients after fitting. If set to 'on' , the coefficients are
computed during model fitting, which can be useful for prediction.
'Gamma' A numeric scalar specifying the
regularization parameter for the covariance matrix. It adjusts the linear
discriminant analysis to make the model more stable in the presence of
multicollinearity or small sample sizes. A value of 0 corresponds to no
regularization, while a value of 1 corresponds to
a completely regularized model.

See also:
ClassificationDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
Fit a Linear Discriminant Analysis classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
fitcecoc


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4425
statistics: Mdl = fitcecoc ( X , Y )
statistics: Mdl = fitcecoc (&hellip;, name , value )

Fit a multiclass model from binary learners.

Mdl = fitcecoc ( X , Y ) turns the multiclass
problem in X and Y into a set of two class problems, fits one
binary learner to each, and returns them as a ClassificationECOC
object. A coding matrix says which classes each 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 row of that matrix its scores match most
closely.

X must be a NxP numeric matrix of predictor data.

Y must be a Nx1 vector of class labels, of any type
ClassNames accepts, with at least two distinct values.

Name Value
'Learners' The binary learner, either a name,
'svm' (default), 'tree' , 'knn' ,
'naivebayes' , 'discriminant' , 'linear' ,
'kernel' or 'ensemble' , a LogitBoost ensemble of 100
trees, or a template from templateSVM and its siblings,
templateEnsemble among them, which also carries the options that
learner is to be fitted with.
'Coding' The coding design, either a name
designecoc accepts, 'onevsone' by default, or a coding
matrix given outright, which sets CodingName to 'custom' .
'BinaryLoss' The loss the binary scores are read
with. The default follows the learner: 'exponential' for an
AdaBoostM1 or GentleBoost ensemble, 'binodeviance' for a
LogitBoost one, and otherwise 'hinge' for one scoring on
(-Inf,+Inf) and 'quadratic' for one scoring on [0,1] ,
as a bagged, random subspace or RUSBoost ensemble does.
'ClassNames' The classes to fit, and the order
the rows of the coding matrix, Prior and Cost take them in.
By default they are sorted.
'Cost' A KxK matrix of misclassification
costs. The default is 1 - eye (K) .
'Prior' 'empirical' (default),
'uniform' , or a vector with one element per class.
'Weights' A nonnegative numeric vector with one
element per observation. The default is uniform.
'CategoricalPredictors' The predictors whose values
are levels, as indices, a logical vector or 'all' , passed as given
to every binary learner, which codes them its own way; a nearest neighbour
learner takes only 'all' and a discriminant learner none.
'PredictorNames' A cellstr of predictor names.
'ResponseName' The name of the response variable.
'ScoreTransform' A transform applied to the
returned scores. The default is 'none' .

A linear or kernel learner carries no training data of its own, so
fitcecoc returns a CompactClassificationECOC for those two
and a ClassificationECOC for the other five, which is what R2024a
does.

'FitPosterior' is refused rather than quietly ignored: it installs
a fitted score transform on each binary learner, which needs the posterior
fitting this package does not have yet.

An ensemble template may name any classification method of
fitcensemble ; a regression template is refused, as in MATLAB.

A RUSBoost ensemble scores each class with the weighted sum of its trees&rsquo;
class probabilities, which no binary loss can read: MATLAB sets the loss
to 'unknown' and then cannot predict. Here those scores, and the
binary scores predict returns, are divided by the total weight of
the trees, which gives the weighted mean of their class probabilities, and
are read with 'quadratic' as a bagged ensemble&rsquo;s are. This follows
R&rsquo;s ebmc and adabag packages and scikit-learn, whose
AdaBoostClassifier and imbalanced-learn&rsquo;s RUSBoostClassifier
built on it scale a boosted ensemble&rsquo;s weighted votes the same way.

A binary learner that cannot be fitted, such as an AdaBoostM2 ensemble, which
needs three classes, stops the fit with its own error, where MATLAB warns and
predicts the majority class. An AdaBoostM1 learner whose first tree
separates its two classes keeps that tree, as fitcensemble does;
MATLAB keeps no tree and never predicts those classes from it.

Each binary learner is fitted with the weight its observations carry, which
the prior and any 'Weights' decide. The SVM, KNN, naive Bayes and
discriminant learners of this package take no observation weights, so when
those weights are unequal they are given instead the prior their two sides
hold, the prior MATLAB&rsquo;s learners report, and weights that vary within a
class, which no prior can express, are refused for them. MATLAB weighs
each observation of those learners as well.

See also:
ClassificationECOC,
CompactClassificationECOC,
designecoc,
templateSVM,
templateTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Fit a multiclass model from binary learners.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
fitcensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9924
statistics: Mdl = fitcensemble ( X , Y )
statistics: Mdl = fitcensemble (&hellip;, name , value )

Fit an ensemble of decision trees for classification.

Mdl = fitcensemble ( X , Y ) grows 100 boosted
decision trees on the NxP predictor matrix X and the class
labels Y , LogitBoost for two classes and AdaBoostM2 for more, and
returns a ClassificationEnsemble . With 'Method' set to
'Bag' , or with a boosting method that resamples, it returns a
ClassificationBaggedEnsemble .

Y holds a class label per row of X , as a numeric or logical
vector, a categorical, string or character array, or a cell array of
character vectors. A row missing a predictor or a class is left out.

The boosting methods, y being +1 for the first class and -1 for the
second, d the observation weights, which start at W times the
total cost of misclassifying each observation&rsquo;s class, and eta the
learning rate:

'AdaBoostM1'
Two classes. Each tree is grown with the weights d ; h is +1
where it predicts the first class and -1 elsewhere, e its weighted
error, and its weight eta * log ((1 - e) / e) / 2 . The weights are
then multiplied by exp (-weight * y .* h) .
'AdaBoostM2'
More than two classes. A weight is kept for each observation and each
class other than its own, and each tree is grown with their sums; its
pseudo-loss e over its class probabilities gives its weight as for
AdaBoostM1, and the scores are the weighted sums of the class
probabilities.
'RUSBoost'
Two or more classes, for classes of unequal size. Each tree is grown
without weights on a sample of every class, round (r * m) rows,
m being the size of the smallest class and r the class&rsquo;s
element of 'RatioToSmallest' , drawn in proportion to d and
with replacement only when the class holds fewer rows. Its pseudo-loss
e over all the observations, the weight of each spread evenly over
the classes other than its own, gives its weight as for AdaBoostM1, the
weights are then multiplied by the mean over those classes of
exp (-weight * (1 + h_true - h_k)) , and the scores are as for
AdaBoostM2. A perfect tree is kept as for AdaBoostM2.
'LPBoost'
Two or more classes. Each tree is grown with the weights d , and its
margins and edge are as for TotalBoost. A linear program over the trees
with the new one, solved by GLPK, gives the least over distributions of
their largest edge; when the smallest edge is no more than
'MarginPrecision' above it, the new tree is not kept and the fit
stops. Otherwise the program gives the learner weights that maximise the
smallest margin, and as its dual the next weights d . The scores are
as for TotalBoost. Where the program has several solutions, MATLAB and
this package may choose different ones: the learner weights, and the
weights d with the trees grown on them, then differ, and so may the
number of trees kept. MATLAB R2024a keeps a tree only when that gap is also
above 0.01, so a 'MarginPrecision' below 0.01 acts there as 0.01;
here it is taken as given.
'TotalBoost'
Two or more classes. Each tree is grown with the weights d ; its
margin on an observation is the probability it gives the observation&rsquo;s
class less the largest it gives another, and its edge is those margins
weighted by d . The fit stops, without that tree, once the least over
distributions of the largest edge of the trees exceeds the smallest edge
less 'MarginPrecision' . Otherwise d takes one quadratic step
towards the least relative entropy to the starting weights, every edge held
at most the smallest edge less 'MarginPrecision' , and the learner
weights are those that maximise the smallest margin, a linear program solved
by GLPK. A tree scores each class with twice its probability less one.
Where several learner weights maximise that margin equally, MATLAB and this
package may choose different ones, and the scores then differ.
'GentleBoost'
Two classes. Each regression tree is fitted to y with the weights
d , its prediction h added to the score times eta , and the
weights multiplied by exp (-eta * y .* h) .
'LogitBoost'
Two classes. With p the probability of the first class, each
regression tree is fitted to (y01 - p) ./ (p .* (1 - p)) with the
weights d .* p .* (1 - p) ; its prediction times eta / 2 is
added to the score f , and p = 1 ./ (1 + exp (-f)) .

The 'Subspace' method fits each learner, a nearest neighbour or
discriminant classifier, on NPredToSample predictors drawn at random
without replacement, or on every combination of that many with
'NumLearningCycles' set to 'AllPredictorCombinations' , and
scores each observation with the plain average of the learners&rsquo; class
probabilities. UsePredForLearner records the predictors of each
learner; every combination is taken in the order of nchoosek , which
MATLAB R2024a reverses for some subset sizes, changing the order of the
learners but not the scores. MATLAB takes observation weights here and
passes them to the learners; the learners in this package take none, so
weights that are not uniform are refused.

A boosting method resamples when 'Resample' is 'on' or
'FResample' or 'Replace' is given; RUSBoost and Subspace
cannot. Each learner is then grown on ceil (FResample * N) rows,
drawn with replacement in proportion to d , each draw weighing the
same, or without replacement uniformly, each row keeping its weight in
d . Its error is taken on those rows with those weights, and only
they are reweighted, rescaled to the weight they carried over their draws.
AdaBoostM2 then keeps one weight per observation, spread evenly over the
classes other than its own, as RUSBoost does, and LogitBoost advances the
score of the rows drawn only. The ensemble is a
ClassificationBaggedEnsemble , which records the rows each learner
drew and estimates the out-of-bag error. These rules reproduce MATLAB
R2024a&rsquo;s fits on its own draws, except LogitBoost with replacement, whose
reweighting in MATLAB was not identified; here it follows the others.

A boosting method whose tree classifies the data without error, zero error
for AdaBoostM1 or zero pseudo-loss for AdaBoostM2, keeps that tree with the
weight an error of eps gives and stops; one whose error is greater
than 0.5 is not kept and stops. MATLAB discards a perfect tree, so a fit
whose first tree is perfect is empty there. GentleBoost applies the
learning rate to the fit itself, as the other boosting methods do; MATLAB
scales only the learner weights, growing the same trees whatever the
rate.

Name-Value arguments:

Name Value
'Method' 'AdaBoostM1' ,
'AdaBoostM2' , 'RUSBoost' , 'GentleBoost' ,
'LogitBoost' , 'LPBoost' , 'TotalBoost' ,
'Bag' or 'Subspace' . The default is
'LogitBoost' for two classes and 'AdaBoostM2' for more.
'NumLearningCycles' A positive integer, the number
of learners to grow, or for Subspace 'AllPredictorCombinations' .
The default is 100.
'NPredToSample' A positive integer less than the
number of predictors, the predictors each Subspace learner is fitted on.
The default is 1. Subspace only.
'Learners' For Subspace 'knn' (default),
'discriminant' , or a template from templateKNN or
templateDiscriminant . Otherwise 'tree' (default) or a
template from templateTree , whose options override the defaults: for
boosting MaxNumSplits 10, MinParentSize 2 and
MinLeafSize 1, the regression trees of GentleBoost and LogitBoost
taking MinParentSize 10; for Bag unlimited splits,
MinParentSize 2, MinLeafSize 1 and
NumVariablesToSample ceil (sqrt (P)) .
'LearnRate' A number greater than 0 and no greater
than 1. The default is 1. Boosting only.
'RatioToSmallest' A nonnegative number, or a vector
with one per class, the size of each class&rsquo;s sample relative to the
smallest class. The default is 1 for every class. RUSBoost only.
'MarginPrecision' A number from 0 to 1, how far
above the linear program LPBoost needs the smallest edge to stay, and how
far below the smallest edge TotalBoost holds every edge. The default is
0.01. LPBoost and TotalBoost only.
'CategoricalPredictors' The predictors whose values
are levels, as indices, as a logical vector with one element per
predictor, or as 'all' . Every tree splits them into sets of
levels, as fitctree does. Not with 'Subspace' .
'FResample' The share of the observations each
learner draws, greater than 0 and no greater than 1. The default is 1.
Given with a boosting method, the ensemble resamples.
'Replace' 'on' (default) or 'off' ,
whether the learners draw with replacement. Given with a boosting method,
the ensemble resamples.
'Resample' 'off' (default) or
'on' , whether a boosting method resamples. Bag always does.
'NPrint' 'off' (default) or a positive
integer n , to print a line after every n trees.
'ClassNames' The classes to fit, in the order their
scores are laid out; by default they are sorted.
'Cost' A KxK matrix of misclassification
costs. The default is 1 - eye (K) .
'Prior' 'empirical' (default),
'uniform' , or a vector with one element per class.
'Weights' A nonnegative vector with one weight per
observation. The default is uniform.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'ResponseName' The name of the response variable.
'ScoreTransform' A transform applied to the
returned scores. The default is 'none' .

'CrossVal' set to 'on' , 'KFold' ,
'Holdout' , 'Leaveout' or 'CVPartition' , only one of
them, fits the ensemble and cross-validates it as crossval does,
returning a ClassificationPartitionedEnsemble .

The method 'RobustBoost' , binning and hyperparameter optimization
are not implemented, and an option asking for one of them is refused.
'CategoricalPredictors' cannot be used with 'Subspace' , its
nearest neighbour and discriminant learners taking no categorical
predictors here; MATLAB passes them to its nearest neighbour learners and
drops them, with a warning, from its discriminant ones.

See also:
ClassificationEnsemble,
ClassificationBaggedEnsemble,
CompactClassificationEnsemble,
templateTree,
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Fit an ensemble of decision trees for classification.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitcgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7247
statistics: Mdl = fitcgam ( X , Y )
statistics: Mdl = fitcgam (&hellip;, name , value )

Fit a Generalized Additive Model (GAM) for binary classification.

Mdl = fitcgam ( X , Y ) returns a GAM classification
model, Mdl , with X being the predictor data, and Y the
binary class labels of observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is N&times;1 numeric vector containing binary class labels,
typically 0 or 1.

Mdl = fitcgam (&hellip;, name , value ) returns a
GAM classification model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'FitMethod' A character vector selecting the weak
learner, either 'boostedtrees' or 'splines' . The default
is 'boostedtrees' , which boosts one shallow decision tree per
predictor and is the scheme MATLAB uses. 'splines' boosts a
smoothing spline per predictor instead and is an Octave extension. The
two take different options and an option meant for one is refused by the
other rather than ignored, so the rows below say which engine each
belongs to.
'PredictorNames' A cell array of character vectors
specifying the names of the predictors. The length of this array must match
the number of columns in X .
'ResponseName' A character vector specifying the
name of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the Discriminant model. ClassNames
are of the same type as the class labels in Y . The model keeps
the classes in this order; by default they are sorted.
'Cost' A N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X where
R is the number of unique categories in Y . If an instance is
correctly classified into its category the cost is calculated to be 1,
otherwise 0. cost matrix can be altered use Mdl.cost = somecost .
default value cost = ones(rows(X),numel(unique(Y))) .
'Formula' (spline option) A model specification given as a
string in
the form 'Y ~ terms' where Y represents the response variable
and terms the predictor variables. The formula can be used to
specify a subset of variables for training model. For example:
'Y ~ x1 + x2 + x3 + x4 + x1:x2 + x2:x3' specifies four linear terms
for the first four columns of for predictor data, and x1:x2 and
x2:x3 specify the two interaction terms for 1st-2nd and 3rd-4th
columns respectively. Only these terms will be used for training the model,
but X must have at least as many columns as referenced in the formula.
If Predictor Variable names have been defined, then the terms in the formula
must reference to those. When 'formula' is specified, all terms used
for training the model are referenced in the IntMatrix field of the
obj class object as a matrix containing the column indexes for each
term including both the predictors and the interactions used.
'Interactions' A logical matrix, a positive integer
scalar, or the string 'all' for defining the interactions between
predictor variables. When given a logical matrix, it must have the same
number of columns as X and each row corresponds to a different
interaction term combining the predictors indexed as true . Each
interaction term is appended as a column vector after the available predictor
column in X . When 'all' is defined, then all possible
combinations of interactions are appended in X before training. At the
moment, parsing a positive integer has the same effect as the 'all'
option. When 'interactions' is specified, only the interaction terms
appended to X are referenced in the IntMatrix field of the
obj class object.
'Knots' (spline option) A scalar or a row vector
with the same
columns as X . It defines the knots for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 5, hence expanded to ones (1, columns (X)) * 5 . You can
parse a row vector with different number of knots for each predictor
variable to be fitted with, although not recommended.
'Order' (spline option) A scalar or a row vector
with the same
columns as X . It defines the order of the polynomial when training the
GAM. As a scalar, it is expanded to a row vector. The default values is 3,
hence expanded to ones (1, columns (X)) * 3 . You can parse a row
vector with different number of polynomial order for each predictor variable
to be fitted with, although not recommended.
'DoF' (spline option) A scalar or a row vector
with the same columns
as X . It defines the degrees of freedom for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 8, hence expanded to ones (1, columns (X)) * 8 . You can
parse a row vector with different degrees of freedom for each predictor
variable to be fitted with, although not recommended.

The rows above marked as spline options require
'FitMethod', 'splines' . The remaining options belong to the
boosted-tree engine and require 'FitMethod', 'boostedtrees' , which
is the default.

Name Value
'NumTreesPerPredictor' A positive integer, the number of
boosting rounds of the predictor phase. It is a budget rather than a
count: a fit that stops improving ends earlier and reports so. The default
is 300.
'NumTreesPerInteraction' A positive integer, the same
budget for the interaction phase. The default is 100.
'MaxNumSplitsPerPredictor' A positive integer, the
largest number of splits any one predictor tree may make. The default is
1, which makes each tree a stump.
'MaxNumSplitsPerInteraction' The same limit for a tree
over a pair of predictors. The default is 4.
'InitialLearnRateForPredictors' A value greater than 0
and at most 1, the step a round of the predictor phase starts at. A round
that fails to improve the fit is retried at half the step, so this is an
initial value rather than a fixed one. The default is 1.
'InitialLearnRateForInteractions' The same for the
interaction phase. The default is 1.
'MaxPValue' A value between 0 and 1. A candidate pair
of predictors is kept only if its interaction test gives a p -value
no larger than this. The default is 1, which keeps every pair asked for.
'Verbose' A non-negative integer. Greater than zero
prints a trace of the fit. The default is 0.
'NumPrint' A positive integer, how often the trace
reports: the first round and then every NumPrint rounds. The
default is 10.
'CategoricalPredictors' The predictors to treat as
categorical: a vector of column indices, a logical vector with one element
per predictor, or 'all' . A tree splits a categorical predictor
into two sets of levels, and a level not seen in training predicts as a
missing value. Its BinEdges and PairDetectionBinEdges are
empty. The default is none.
'Weights' A numeric vector of non-negative observation
weights, one per row of X . Each class carries its 'Prior' ,
spread over its observations in proportion to their weights.

You can parse either a 'Formula' or an 'Interactions'
optional parameter. Parsing both parameters will result an error.
Accordingly, you can only pass up to two parameters among 'Knots' ,
'Order' , and 'DoF' to define the required polynomial for
training the GAM model.

See also:
ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Fit a Generalized Additive Model (GAM) for binary classification.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
fitckernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1171
statistics: Mdl = fitckernel ( X , Y )
statistics: Mdl = fitckernel (&hellip;, name , value )
statistics: [ Mdl , FitInfo ] = fitckernel (&hellip;)

Fit a Gaussian kernel binary classifier.

Mdl = fitckernel ( X , Y ) returns a
ClassificationKernel object fitted to the predictor data X
and the two class response Y , where X is an NxP
numeric matrix and Y has as many rows as X .

Mdl = fitckernel (&hellip;, name , value ) passes
the given Name-Value pairs to the model. They are documented
under ClassificationKernel , and the ones most often wanted are
'Learner' , 'NumExpansionDimensions' ,
'KernelScale' , 'Lambda' , 'BoxConstraint' and
'Standardize' .

[ Mdl , FitInfo ] = fitckernel (&hellip;) also returns a
structure describing the optimization: the objective it reached, the
gradient it left, and the tolerances it was given.

Mdl = fitckernel (&hellip;, cvopt , value ) returns a
ClassificationPartitionedKernel
instead when one of 'CrossVal' , 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' is
given. A cross-validated model describes no single fit, so
FitInfo is not available beside it.

See also:
ClassificationKernel,
ClassificationLinear,
fitclinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Fit a Gaussian kernel binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitcknn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11177
statistics: Mdl = fitcknn ( X , Y )
statistics: Mdl = fitcknn (&hellip;, name , value )

Fit a k-Nearest Neighbor classification model.

Mdl = fitcknn ( X , Y ) returns a k-Nearest Neighbor
classification model, Mdl , with X being the predictor data, and
Y the class labels of observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is N&times;1 matrix or cell matrix containing the class labels of
corresponding predictor data in X . Y can be numerical, logical,
char array or cell array of character vectors. Y must have same number
of rows as X .

Mdl = fitcknn (&hellip;, name , value ) returns a
k-Nearest Neighbor classification model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'Standardize' A boolean flag indicating whether
the data in X should be standardized prior to training.
'CategoricalPredictors' Empty (default) or 'all' ,
which takes every predictor as categorical and makes 'hamming' the
default distance, so observations are compared by the levels they share.
A list of some of the predictors is refused, as MATLAB refuses it.
'PredictorNames' A cell array of character vectors
specifying the predictor variable names. The variable names are assumed to
be in the same order as they appear in the training data X .
'ResponseName' A character vector specifying the name
of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the kNN model. ClassNames are of
the same type as the class labels in Y . The model keeps the classes
in this order; by default they are sorted.
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . Each class carries its prior, spread
over its observations in proportion to their weights, and a neighbour
votes with that weight. An empirical prior sums the weights per class,
standardization uses weighted means and standard deviations, and a row of
zero weight is left out.
'Cost' A N&times;R numeric matrix containing
misclassification cost for the corresponding instances in X where
R is the number of unique categories in Y . If an instance is
correctly classified into its category the cost is calculated to be 1,
otherwise 0. cost matrix can be altered use Mdl.cost = somecost .
default value cost = ones(rows(X),numel(unique(Y))) .
'ScoreTransform' A character vector defining one of
the following functions or a user defined function handle, which is used
for transforming the prediction scores returned by the predict and
resubPredict methods. Default value is 'none' .

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the largest
score to 1, and sets the scores for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x > 0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class with
the largest score to 1, and sets the scores for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1

Name Value
'BreakTies' Tie-breaking algorithm used by predict
when multiple classes have the same smallest cost. By default, ties occur
when multiple classes have the same number of nearest points among the
k nearest neighbors. The available options are specified by the
following character arrays:

Value Description
'smallest' This is the default and it favors the
class with the smallest index among the tied groups, i.e. the one that
appears first in the training labelled data.
'nearest' This favors the class with the nearest
neighbor among the tied groups, i.e. the class with the closest member point
according to the distance metric used.
'random' This randomly picks one class among the
tied groups.

Name Value
'BucketSize' The maximum number of data points in the
leaf node of the Kd-tree and it must be a positive integer. By default, it
is 50. This argument is meaningful only when the selected search method is
'kdtree' .
'NumNeighbors' A positive integer value specifying
the number of nearest neighbors to be found in the kNN search. By default,
it is 1.
'Exponent' A positive scalar (usually an integer)
specifying the Minkowski distance exponent. This argument is only valid when
the selected distance metric is 'minkowski' . By default it is 2.
'Scale' A nonnegative numeric vector specifying the
scale parameters for the standardized Euclidean distance. The vector length
must be equal to the number of columns in X . This argument is only
valid when the selected distance metric is 'seuclidean' , in which
case each coordinate of X is scaled by the corresponding element of
'scale' , as is each query point in Y . By default, the scale
parameter is the standard deviation of each coordinate in X . If a
variable in X is constant, i.e. zero variance, this value is forced
to 1 to avoid division by zero. This is the equivalent of this variable not
being standardized.
'Cov' A square matrix with the same number of columns
as X specifying the covariance matrix for computing the mahalanobis
distance. This must be a positive definite matrix matching. This argument
is only valid when the selected distance metric is 'mahalanobis' .
'Distance' is the distance metric used by
knnsearch as specified below:

Value Description
'euclidean' Euclidean distance.
'seuclidean' standardized Euclidean distance. Each
coordinate difference between the rows in X and the query matrix
Y is scaled by dividing by the corresponding element of the standard
deviation computed from X . To specify a different scaling, use the
'Scale' name-value argument.
'cityblock' City block distance.
'chebychev' Chebychev distance (maximum coordinate
difference).
'minkowski' Minkowski distance. The default exponent
is 2. To specify a different exponent, use the 'P' name-value
argument.
'mahalanobis' Mahalanobis distance, computed using a
positive definite covariance matrix. To change the value of the covariance
matrix, use the 'Cov' name-value argument.
'cosine' Cosine distance.
'correlation' One minus the sample linear correlation
between observations (treated as sequences of values).
'spearman' One minus the sample Spearman&rsquo;s rank
correlation between observations (treated as sequences of values).
'hamming' Hamming distance, which is the percentage
of coordinates that differ.
'jaccard' One minus the Jaccard coefficient, which is
the percentage of nonzero coordinates that differ.
@distfun Custom distance function handle. A distance
function of the form function D2 = distfun ( XI , YI ) ,
where XI is a 1&times;P vector containing a single observation in
P -dimensional space, YI is an N&times;P matrix containing an
arbitrary number of observations in the same P -dimensional space, and
D2 is an N&times;P vector of distances, where ( D2 k) is
the distance between observations XI and ( YI k,:) .

Name Value
'DistanceWeight' A distance weighting function,
specified either as a function handle, which accepts a matrix of nonnegative
distances and returns a matrix the same size containing nonnegative distance
weights, or one of the following values: 'equal' , which corresponds
to no weighting; 'inverse' , which corresponds to a weight equal to
1/distance ; 'squaredinverse' , which corresponds to a weight
equal to 1/distance^2 .
'CacheSize' A positive scalar, the cache size in
megabytes, 1000 by default. It is stored and reported for compatibility
and does not affect the fit or any prediction : a nearest-neighbour
model keeps no Gram matrix to cache, holding its training data and
computing each distance when asked. MATLAB hides the same property from
properties , where this package reports it.
'IncludeTies' A boolean flag to indicate if the
returned values should contain the indices that have same distance as the
K^th neighbor. When false , knnsearch chooses the
observation with the smallest index among the observations that have the same
distance from a query point. When true , knnsearch includes
all nearest neighbors whose distances are equal to the K^th smallest
distance in the output arguments. To specify K , use the 'K'
name-value pair argument.
'NSMethod' is the nearest neighbor search method used
by knnsearch as specified below.

Value Description
'kdtree' Creates and uses a Kd-tree to find nearest
neighbors. 'kdtree' is the default value when the number of columns
in X is less than or equal to 10, X is not sparse, and the
distance metric is 'euclidean' , 'cityblock' ,
'manhattan' , 'chebychev' , or 'minkowski' . Otherwise,
the default value is 'exhaustive' . This argument is only valid when
the distance metric is one of the four aforementioned metrics.
'exhaustive' Uses the exhaustive search algorithm by
computing the distance values from all the points in X to each point in
Y .

Cross Validation Options

Name Value
'Crossval' Cross-validation flag specified as
'on' or 'off' . If 'on' is specified, a 10-fold
cross validation is performed and a ClassificationPartitionedModel is
returned in Mdl . To override this cross-validation setting, use only
one of the following Name-Value pair arguments.
'CVPartition' A cvpartition object that
specifies the type of cross-validation and the indexing for the training and
validation sets. A ClassificationPartitionedModel is returned in
Mdl and the trained model is stored in the Trained property.
'Holdout' Fraction of the data used for holdout
validation, specified as a scalar value in the range [0,1] . When
specified, a randomly selected percentage is reserved as validation data and
the remaining set is used for training. The trained model is stored in the
Trained property of the ClassificationPartitionedModel returned
in Mdl . 'Holdout' partitioning attempts to ensure that each
partition represents the classes proportionately.
'KFold' Number of folds to use in the cross-validated
model, specified as a positive integer value greater than 1. When specified,
then the data is randomly partitioned in k sets and for each set, the
set is reserved as validation data while the remaining k-1 sets are
used for training. The trained models are stored in the Trained
property of the ClassificationPartitionedModel returned in Mdl .
'KFold' partitioning attempts to ensure that each partition
represents the classes proportionately.
'Leaveout' Leave-one-out cross-validation flag
specified as 'on' or 'off' . If 'on' is specified,
then for each of the n observations (where n is the number of
observations, excluding missing observations, specified in the
NumObservations property of the model), one observation is reserved as
validation data while the remaining observations are used for training. The
trained models are stored in the Trained property of the
ClassificationPartitionedModel returned in Mdl .

See also:
ClassificationKNN,
ClassificationPartitionedModel,
knnsearch,
rangesearch,
pdist2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Fit a k-Nearest Neighbor classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
fitclinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1240
statistics: Mdl = fitclinear ( X , Y )
statistics: Mdl = fitclinear (&hellip;, name , value )
statistics: [ Mdl , FitInfo ] = fitclinear (&hellip;)

Fit a linear binary classifier.

Mdl = fitclinear ( X , Y ) returns a
ClassificationLinear object fitted to the predictor data X
and the two class response Y , where X is an NxP
numeric matrix and Y has as many rows as X .

Mdl = fitclinear (&hellip;, name , value ) passes
the given Name-Value pairs to the model. They are documented
under ClassificationLinear , and the ones most often wanted are
'Learner' , 'Regularization' , 'Lambda' ,
'Solver' and 'ObservationsIn' .

[ Mdl , FitInfo ] = fitclinear (&hellip;) also returns a
structure describing the optimization: what it converged to, how far it
got, and which tolerance stopped it. Its fields follow the solver, so a
dual fit reports the dual variables and a mini-batch fit the batch it
stopped on.

Mdl = fitclinear (&hellip;, cvopt , value ) returns a
ClassificationPartitionedLinear
instead when one of 'CrossVal' , 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' is
given. A cross-validated model describes no single fit, so
FitInfo is not available beside it.

See also:
ClassificationLinear,
ClassificationKernel,
fitckernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Fit a linear binary classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
fitcnb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3589
statistics: Mdl = fitcnb ( X , Y )
statistics: Mdl = fitcnb (&hellip;, name , value )

Fit a naive Bayes classification model.

Mdl = fitcnb ( X , Y ) returns a naive Bayes
classification model, Mdl , with X being the predictor data and
Y the class labels of the observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is an N&times;1 matrix or cell matrix containing the class labels
of the corresponding predictor data in X . Y can be numeric,
logical, a character array or a cell array of character vectors. Y
must have the same number of rows as X .

A naive Bayes model fits one univariate density to each predictor within
each class, and treats the predictors as conditionally independent given the
class. An observation&rsquo;s likelihood under a class is therefore the product
of its per-predictor densities, and its posterior follows by Bayes&rsquo; rule
from the class prior.

Mdl = fitcnb (&hellip;, name , value ) returns a naive
Bayes model with additional options specified by Name-Value pair
arguments listed below.

Model Parameters

Name Value
'PredictorNames' A cell array of character vectors
specifying the names of the predictors. The length of this array must match
the number of columns in X .
'ResponseName' A character vector specifying the name of
the response variable.
'ClassNames' Names of the classes in the class labels,
Y , used for fitting the model. ClassNames are of the same
type as the class labels in Y . Naming a subset of the classes keeps
only the observations belonging to them. The model keeps the classes in
this order; by default they are sorted.
'Prior' A numeric vector specifying the prior probability
of each class, in the order of ClassNames , or the character vector
'empirical' (default) to take the class frequencies, or
'uniform' to give every class the same probability.
'Cost' A square numeric matrix of misclassification
costs, where Cost(i,j) is the cost of classifying an observation of
class i into class j . The default is one off the diagonal and
zero on it.
'ScoreTransform' A character vector naming a transform
applied to the posterior returned by predict , or a function handle
taking and returning a matrix of the same size. The default is
'none' .
'DistributionNames' A character vector naming the
distribution fitted to every predictor, or a cell array of character vectors
naming one per predictor. Supported are 'normal' (default),
'kernel' , 'mvmn' for a categorical predictor, and
'mn' for token counts. 'mn' describes the whole predictor
vector at once and so cannot be named for only some predictors.
'Kernel' The smoothing kernel of the predictors fitted
with a kernel density, one of 'normal' (default), 'box' ,
'epanechnikov' or 'triangle' , given once for every predictor
or once per predictor.
'Support' The support of the kernel densities, either
'unbounded' (default), 'positive' , or a two element numeric
vector giving finite bounds.
'Width' The bandwidth of the kernel densities, given as a
scalar, as one value per predictor, as one per class, or as a matrix of one
per class and predictor. By default each density chooses its own.

A predictor that takes one value throughout a class has no normal density
to fit, and that combination of class and predictor is refused rather than
answered. Only the combination is refused, not the model: giving that
predictor a 'kernel' or a 'mvmn' distribution fits the same
data, and leaves the other predictors normal.

See also:
ClassificationNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Fit a naive Bayes classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitcnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6315
statistics: Mdl = fitcnet ( X , Y )
statistics: Mdl = fitcnet (&hellip;, name , value )

Fit a Neural Network classification model.

Mdl = fitcnet ( X , Y ) returns a Neural Network
classification model, Mdl , with X being the predictor data, and
Y the class labels of observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is N&times;1 matrix or cell matrix containing the class labels of
corresponding predictor data in X . Y can contain any type of
categorical data. Y must have same numbers of rows as X .

Mdl = fitcnet (&hellip;, name , value ) returns a
Neural Network classification model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'Standardize' A boolean flag indicating whether
the data in X should be standardized prior to training.
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not has no score.
'PredictorNames' A cell array of character vectors
specifying the predictor variable names. The variable names are assumed to
be in the same order as they appear in the training data X .
'ResponseName' A character vector specifying the name
of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the Neural Network model.
ClassNames are of the same type as the class labels in Y .
The model keeps the classes in this order; by default they are sorted.
'Prior' A numeric vector specifying the prior
probabilities for each class. The order of the elements in Prior
corresponds to the order of the classes in ClassNames .
'LayerSizes' A vector of positive integers that
defines the sizes of the fully connected layers in the neural network model.
Each element in LayerSizes corresponds to the number of outputs for the
respective fully connected layer in the neural network model.
The default value is 10.
'LearningRate' A positive scalar value that defines
the learning rate during the gradient descent. Default value is 0.003.
A larger rate can drive every unit of a hidden layer negative, after which
a rectifier passes no gradient and the network stops training.
Applies only when 'Solver' is 'sgd' .
'Solver' A character vector naming the solver that
trains the network, either 'lbfgs' or 'sgd' . The
default is 'lbfgs' , which minimizes the loss over the whole
training set at once by limited-memory BFGS, as MATLAB does. It takes
no learning rate, stops on the three tolerances below, and reaches a
lower training loss in fewer passes over the data, though each of its
iterations costs several passes where an epoch costs one.
'sgd' visits the samples one at a time and steps down the
gradient of each, running for 'IterationLimit' epochs; it was
the default before version 1.9.0.
'GradientTolerance' A nonnegative scalar. Training
stops once the gradient&rsquo;s infinity norm falls to or below it, which is
the quantity MATLAB tests too. The default is 1e-6 . Applies
only when 'Solver' is 'lbfgs' .
'StepTolerance' A nonnegative scalar. Training
stops once the step&rsquo;s infinity norm falls to or below it, which is the
quantity MATLAB tests too. The default is 1e-6 . Applies only
when 'Solver' is 'lbfgs' .
'LossTolerance' A real scalar. Training stops once
the training loss falls to or below it. The test is on the loss
itself and not on its change, matching MATLAB; pass -Inf to
switch it off. The default is 1e-6 . Applies only when
'Solver' is 'lbfgs' .
'Activations' A character vector or a cellstr vector
specifying the activation functions for the hidden layers of the neural
network (excluding the output layer). The available activation functions
are 'linear' , 'sigmoid' , 'relu' , 'tanh' ,
'softmax' , 'lrelu' , 'prelu' , 'elu' ,
'gelu' , and 'none' . The default value is 'relu' .
'OutputLayerActivation' A character vector specifying
the activation function for the output layer of the neural network. The
available activation functions are the same as for 'Activations' .
The default value is 'softmax' , which makes the returned scores a
probability over the classes and trains the network against cross entropy;
any other value trains it against the mean squared error.
'IterationLimit' A positive integer scalar that
specifies the maximum number of training iterations. The default value is
1000.
Under 'sgd' this counts epochs, under
'lbfgs' solver iterations.
'DisplayInfo' A boolean flag indicating whether to
print information during training. Default is false .
'ScoreTransform' A character vector defining one of
the following functions or a user defined function handle, which is used
for transforming the prediction scores returned by the predict and
resubPredict methods. Default value is 'none' .

Value Description
'doublelogit' 1 ./ (1 + exp (-2 &times; x))
'invlogit' log (x ./ (1 - x))
'ismax' Sets the score for the class with the largest
score to 1, and sets the scores for all other classes to 0
'logit' 1 ./ (1 + exp (-x))
'none' x (no transformation)
'identity' x (no transformation)
'sign' -1 for x < 0, 0 for x = 0, 1 for x > 0
'symmetric' 2 &times; x - 1
'symmetricismax' Sets the score for the class with
the largest score to 1, and sets the scores for all other classes to -1
'symmetriclogit' 2 ./ (1 + exp (-x)) - 1

The weights of each layer are drawn from a uniform range whose half-width
is set by that layer&rsquo;s activation, and the scheme cannot be chosen: a
rectifying activation ( 'relu' , 'lrelu' , 'prelu' ,
'elu' , 'gelu' ) takes the He range
sqrt (6 / fan_in) , because it passes only half of its input, and
the remaining activations take the Glorot range
sqrt (6 / (fan_in + fan_out)) , which accounts for the backward pass
as well. A network whose layers do not share an activation is therefore
built with both schemes. What each layer was given is reported by the
LayerWeightsInitializers field of the fitted model&rsquo;s
ModelParameters .

See also:
ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Fit a Neural Network classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8292
statistics: Mdl = fitcsvm ( X , Y )
statistics: Mdl = fitcsvm (&hellip;, name , value )

Fit a Support Vector Machine classification model.

Mdl = fitcsvm ( X , Y ) returns a Support Vector
Machine classification model, Mdl , with X being the predictor
data, and Y the class labels of observations in X .

X must be a N&times;P numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is N&times;1 matrix or cell matrix containing the class labels of
corresponding predictor data in X . Y can be numerical, logical,
char array or cell array of character vectors. Y must have same number
of rows as X .

Mdl = fitcsvm (&hellip;, name , value ) returns a
Support Vector Machine model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'Standardize' A boolean flag indicating whether
the data in X should be standardized prior to training.
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not has no score.
'PredictorNames' A cell array of character vectors
specifying the predictor variable names. The variable names are assumed to
be in the same order as they appear in the training data X .
'ResponseName' A character vector specifying the name
of the response variable.
'ClassNames' Names of the classes in the class
labels, Y , used for fitting the kNN model. ClassNames are of
the same type as the class labels in Y . The model keeps the classes
in this order; by default they are sorted.
'SVMtype' Specifies the type of SVM used for training
the ClassificationSVM model. By default, the type of SVM is defined
by setting other parameters and/or by the data itself. Setting the
'SVMtype' parameter overrides the default behavior and it accepts the
following options:

Value Description
'C_SVC' It is the standard SVM formulation for
classification tasks. It aims to find the optimal hyperplane that separates
different classes by maximizing the margin between them while allowing some
misclassifications. The parameter 'C' controls the trade-off between
maximizing the margin and minimizing the classification error. It is the
default type, unless otherwise specified.
'nu_SVC' It is a variation of the standard SVM that
introduces a parameter ν (nu) as an upper bound on the fraction of
margin errors and a lower bound on the fraction of support vectors. This
formulation provides more control over the number of support vectors and the
margin errors, making it useful for specific classification scenarios. It is
the default type, when the 'OutlierFraction' parameter is set.
'one_class_SVM' It is used for anomaly detection and
novelty detection tasks. It aims to separate the data points of a single
class from the origin in a high-dimensional feature space. This method is
particularly useful for identifying outliers or unusual patterns in the data.
It is the default type, when the 'Nu' parameter is set or when there
is a single class in Y . When 'one_class_SVM' is set by the
'SVMtype' pair argument, Y has no effect and any classes are
ignored.

Name Value
'OutlierFraction' The expected proportion of outliers
in the training data, specified as a scalar value in the range [0,1] .
When specified, the type of SVM model is switched to 'nu_SVC' and
'OutlierFraction' defines the ν (nu) parameter.
'KernelFunction' A character vector specifying the
method for computing elements of the Gram matrix. The available kernel
functions are 'gaussian' or 'rbf' , 'linear' ,
'polynomial' , and 'sigmoid' . For one-class learning, the
default Kernel function is 'rbf' . For two-class learning the default
is 'linear' .
'PolynomialOrder' A positive integer that specifies
the order of polynomial in kernel function. The default value is 3. Unless
the 'KernelFunction' is set to 'polynomial' , this parameter
is ignored.
'KernelScale' A positive scalar that specifies a
scaling factor for the γ (gamma) parameter, which can be seen as the
inverse of the radius of influence of samples selected by the model as
support vectors. The γ (gamma) parameter is computed as
gamma = KernelScale / (number of features) . The default value
for 'KernelScale' is 1.
'KernelOffset' A nonnegative scalar that specifies
the coef0 in kernel function. For the polynomial kernel, it influences
the polynomial&rsquo;s shift, and for the sigmoid kernel, it affects the hyperbolic
tangent&rsquo;s shift. The default value for 'KernelOffset' is 0.
'Weights' A numeric vector of nonnegative observation
weights, one per row of X . Each observation&rsquo;s box constraint is
n times BoxConstraint times its weight, the weights scaled
so that each class carries its prior times the cost of misclassifying it.
An empirical prior sums the weights per class, standardization uses
weighted means and standard deviations, and a row of zero weight is left
out.
'BoxConstraint' A positive scalar that specifies the
upper bound of the Lagrange multipliers, i.e. the parameter C, which is used
for training 'C_SVC' and 'one_class_SVM' type of models. It
determines the trade-off between maximizing the margin and minimizing the
classification error. The default value for 'BoxConstraint' is 1.
'Nu' A positive scalar, in the range (0,1]
that specifies the parameter ν (nu) for training 'nu_SVC' and
'one_class_SVM' type of models. Unless overridden by setting the
'SVMtype' parameter, setting the 'Nu' parameter always forces
the training model type to 'one_class_SVM' , in which case, the number
of classes in Y is ignored. The default value for 'Nu' is 1.
'CacheSize' A positive scalar that specifies the
memory requirements (in MB) for storing the Gram matrix. The default is 1000.
'Tolerance' A nonnegative scalar that specifies
the tolerance of termination criterion. The default value is 1e-6.
'Shrinking' Specifies whether to use shrinking
heuristics. It accepts either 0 or 1. The default value is 1.

Cross Validation Options

Name Value
'Crossval' Cross-validation flag specified as
'on' or 'off' . If 'on' is specified, a 10-fold
cross validation is performed and a ClassificationPartitionedModel is
returned in Mdl . To override this cross-validation setting, use only
one of the following Name-Value pair arguments.
'CVPartition' A cvpartition object that
specifies the type of cross-validation and the indexing for the training and
validation sets. A ClassificationPartitionedModel is returned in
Mdl and the trained model is stored in the Trained property.
'Holdout' Fraction of the data used for holdout
validation, specified as a scalar value in the range [0,1] . When
specified, a randomly selected percentage is reserved as validation data and
the remaining set is used for training. The trained model is stored in the
Trained property of the ClassificationPartitionedModel returned
in Mdl . 'Holdout' partitioning attempts to ensure that each
partition represents the classes proportionately.
'KFold' Number of folds to use in the cross-validated
model, specified as a positive integer value greater than 1. When specified,
then the data is randomly partitioned in k sets and for each set, the
set is reserved as validation data while the remaining k-1 sets are
used for training. The trained models are stored in the Trained
property of the ClassificationPartitionedModel returned in Mdl .
'KFold' partitioning attempts to ensure that each partition
represents the classes proportionately.
'Leaveout' Leave-one-out cross-validation flag
specified as 'on' or 'off' . If 'on' is specified,
then for each of the n observations (where n is the number of
observations, excluding missing observations, specified in the
NumObservations property of the model), one observation is reserved as
validation data while the remaining observations are used for training. The
trained models are stored in the Trained property of the
ClassificationPartitionedModel returned in Mdl .

See also:
ClassificationSVM,
ClassificationPartitionedModel,
svmtrain,
svmpredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Fit a Support Vector Machine classification model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4388
statistics: Mdl = fitctree ( X , Y )
statistics: Mdl = fitctree (&hellip;, name , value )

Fit a binary decision tree for classification.

Mdl = fitctree ( X , Y ) grows a binary decision tree
on the predictor data X and the class labels Y , and returns it
as a ClassificationTree object.

X must be a NxP numeric matrix of predictor data, where rows
correspond to observations and columns to predictors.

Y must be a Nx1 numeric or logical vector, a character array
with one class name per row, or a cell array of character vectors, holding
the class label of each observation in X . The class names come back
in the type Y was given in.

An observation whose class label is missing is dropped, and the rows kept
are reported in RowsUsed . An observation missing some of its
predictors is kept: it descends the tree as far as the predictors it does
carry allow and is answered there.

Mdl = fitctree (&hellip;, name , value ) takes the
options below.

Name Value
'AlgorithmForCategorical' How a node with three or more
classes splits a categorical predictor: 'exact' ,
'pullleft' , 'pca' or 'ovabyclass' . By default the
exact search is taken when the node holds at most 'MaxNumCategories'
levels, and otherwise the best split of 'ovabyclass' ,
'pca' and 'pullleft' , leaving 'ovabyclass' out above
four classes.
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or
as 'all' . Such a predictor is split into two sets of levels, and an
observation whose level a node did not see stops there.
'ClassNames' The classes to fit, of the same type as
Y . Observations of any other class are dropped. The model keeps
the classes in this order; by default they are sorted.
'Cost' A square matrix with one row and column per
class, where element (i,j) is the cost of classifying an
observation of class i into class j , or a structure with
fields ClassNames and ClassificationCosts . The default is
1 - eye (K) . A non-default cost changes the shape of the tree, not
only what it predicts.
'MaxNumCategories' A nonnegative integer, the most
levels a node with three or more classes searches exactly by default. The
default is 10.
'MaxNumSplits' A nonnegative integer, the largest number
of branch nodes the tree may take. The default is one less than the number
of observations.
'MergeLeaves' 'on' (default) or 'off' .
When on, a pair of leaves whose parent is no worse than the two of them
together is merged back into that parent.
'MinLeafSize' A positive integer, the fewest
observations a leaf may hold. The default is 1.
'MinParentSize' A positive integer, the fewest
observations a node must hold to be split. The default is 10. The value
the fit uses is max (MinParentSize, 2 * MinLeafSize) .
'NumVariablesToSample' A positive integer, the number
of predictors each split is chosen from, drawn afresh at every node, or
'all' (default). A number no smaller than the number of
predictors samples them all and is reported as 'all' . MATLAB also
accepts a fractional number, which is refused here.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'Prior' 'empirical' (default),
'uniform' , a numeric vector with one element per class, or a
structure with fields ClassNames and ClassProbs .
'Prune' 'on' (default) or 'off' . When
on, the cost complexity pruning sequence is estimated and reported in
PruneList and PruneAlpha . The tree returned is the unpruned
one either way; prune takes a subtree out of the sequence.
'PruneCriterion' 'error' , the only criterion
implemented.
'ResponseName' A character vector naming the response.
The default is 'Y' .
'ScoreTransform' A character vector naming a transform
to apply to the scores, or a function handle. The default is
'none' .
'SplitCriterion' 'gdi' (default), the Gini
diversity index, or 'deviance' , the cross entropy.
'Weights' A nonnegative numeric vector with one element
per observation. The default is uniform.

Surrogate splits and the 'twoing' split criterion are not
implemented, and an option asking for one of them is refused rather than
quietly ignored. On a node with three or more classes and more than
'MaxNumCategories' levels, the heuristic splits, the choice between
equally good partitions and which side each set of levels takes may differ
from MATLAB&rsquo;s.

See also:
ClassificationTree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Fit a binary decision tree for classification.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
fitrensemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3368
statistics: Mdl = fitrensemble ( X , Y )
statistics: Mdl = fitrensemble (&hellip;, name , value )

Fit an ensemble of regression trees.

Mdl = fitrensemble ( X , Y ) grows 100 regression
trees by LSBoost on the NxP predictor matrix X and the numeric
response Y , and returns a RegressionEnsemble . With
'Method' set to 'Bag' , or with LSBoost resampling, it
returns a RegressionBaggedEnsemble . A row missing a predictor or the
response is left out.

LSBoost starts from a prediction of zero. Each tree is fitted, with the
observation weights, to the residual of the trees before it, and the
prediction grows by the learning rate times that tree&rsquo;s prediction, the
learning rate being the tree&rsquo;s weight. The first tree therefore fits the
response itself. Bag grows each tree on a sample drawn in proportion to the
weights and averages them.

LSBoost resamples when 'Resample' is 'on' or
'FResample' or 'Replace' is given. Each tree is then fitted
to the residual of ceil (FResample * N) rows, drawn with replacement
in proportion to the weights or without replacement uniformly, while the
prediction and FitInfo run over every row, as in MATLAB R2024a. The
ensemble is a RegressionBaggedEnsemble , which records the rows each
tree drew and estimates the out-of-bag error.

Name-Value arguments:

Name Value
'Method' 'LSBoost' (default) or
'Bag' .
'NumLearningCycles' A positive integer, the number
of trees to grow. The default is 100.
'Learners' 'tree' (default) or a template
from templateTree , whose options override the defaults: for LSBoost
MaxNumSplits 10, MinParentSize 10 and MinLeafSize 5;
for Bag unlimited splits, MinParentSize 10, MinLeafSize 5
and NumVariablesToSample ceil (P / 3) .
'LearnRate' A number greater than 0 and no greater
than 1. The default is 1. LSBoost only.
'FResample' The share of the observations each
tree draws, greater than 0 and no greater than 1. The default is 1. Given
with LSBoost, the ensemble resamples.
'Replace' 'on' (default) or 'off' ,
whether the trees draw with replacement. Given with LSBoost, the ensemble
resamples.
'Resample' 'off' (default) or
'on' , whether LSBoost resamples. Bag always does.
'NPrint' 'off' (default) or a positive
integer n , to print a line after every n trees.
'Weights' A nonnegative vector with one weight per
observation. The default is uniform.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'ResponseName' The name of the response variable.
'ResponseTransform' 'none' (default),
'exp' , 'log' or a function handle, applied to the
predictions. MATLAB R2024a accepts only a function handle here, failing
on the named transforms.

'CrossVal' set to 'on' , 'KFold' ,
'Holdout' , 'Leaveout' or 'CVPartition' , only one of
them, fits the ensemble and cross-validates it as crossval does,
returning a RegressionPartitionedEnsemble .

Binning and hyperparameter optimization are not implemented, and an option
asking for one of them is refused. 'CategoricalPredictors' , as
indices, as a logical vector with one element per predictor, or as
'all' , is passed on to every tree, which splits those predictors
into sets of levels as fitrtree does. An ensemble is
regularized and shrunk afterwards with the regularize , shrink
and cvshrink methods.

See also:
RegressionEnsemble,
RegressionBaggedEnsemble,
CompactRegressionEnsemble,
templateTree,
TreeBagger


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Fit an ensemble of regression trees.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitrgam


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6916
statistics: obj = fitrgam ( X , Y )
statistics: obj = fitrgam ( X , Y , name , value )

Fit a Generalized Additive Model (GAM) for regression.

obj = fitrgam ( X , Y ) returns an object of
class RegressionGAM, with matrix X containing the predictor data and
vector Y containing the continuous response data.

X must be a N&times;P numeric matrix of input data where rows
correspond to observations and columns correspond to features or variables.
X will be used to train the GAM model.

Y must be N&times;1 numeric vector containing the response data
corresponding to the predictor data in X . Y must have same
number of rows as X .

obj = fitrgam (&hellip;, name , value ) returns
an object of class RegressionGAM with additional properties specified by
Name-Value pair arguments listed below.

Name Value
'FitMethod' A character vector selecting the weak
learner, either 'boostedtrees' or 'splines' . The default
is 'boostedtrees' , which boosts one shallow decision tree per
predictor and is the scheme MATLAB uses. 'splines' boosts a
smoothing spline per predictor instead and is an Octave extension. The
two take different options and an option meant for one is refused by the
other rather than ignored, so the rows below say which engine each
belongs to.
'predictors' Predictor Variable names, specified as
a row vector cell of strings with the same length as the columns in X .
If omitted, the program will generate default variable names
(x1, x2, ..., xn) for each column in X .
'responsename' Response Variable Name, specified as
a string. If omitted, the default value is 'Y' .
'formula' (spline option) a model specification given as a
string in
the form 'Y ~ terms' where Y represents the response variable
and terms the predictor variables. The formula can be used to
specify a subset of variables for training model. For example:
'Y ~ x1 + x2 + x3 + x4 + x1:x2 + x2:x3' specifies four linear terms
for the first four columns of for predictor data, and x1:x2 and
x2:x3 specify the two interaction terms for 1st-2nd and 3rd-4th
columns respectively. Only these terms will be used for training the model,
but X must have at least as many columns as referenced in the formula.
If Predictor Variable names have been defined, then the terms in the formula
must reference to those. When 'formula' is specified, all terms used
for training the model are referenced in the IntMatrix field of the
obj class object as a matrix containing the column indexes for each
term including both the predictors and the interactions used.
'interactions' a logical matrix, a positive integer
scalar, or the string 'all' for defining the interactions between
predictor variables. When given a logical matrix, it must have the same
number of columns as X and each row corresponds to a different
interaction term combining the predictors indexed as true . Each
interaction term is appended as a column vector after the available predictor
column in X . When 'all' is defined, then all possible
combinations of interactions are appended in X before training. At the
moment, parsing a positive integer has the same effect as the 'all'
option. When 'interactions' is specified, only the interaction terms
appended to X are referenced in the IntMatrix field of the
obj class object.
'knots' (spline option) a scalar or a row vector with the
same
columns as X . It defines the knots for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 5, hence expanded to ones (1, columns (X)) * 5 . You can
parse a row vector with different number of knots for each predictor
variable to be fitted with, although not recommended.
'order' (spline option) a scalar or a row vector with the
same
columns as X . It defines the order of the polynomial when training the
GAM. As a scalar, it is expanded to a row vector. The default values is 3,
hence expanded to ones (1, columns (X)) * 3 . You can parse a row
vector with different number of polynomial order for each predictor variable
to be fitted with, although not recommended.
'dof' (spline option) a scalar or a row vector with the
same columns
as X . It defines the degrees of freedom for fitting a polynomial when
training the GAM. As a scalar, it is expanded to a row vector. The default
value is 8, hence expanded to ones (1, columns (X)) * 8 . You can
parse a row vector with different degrees of freedom for each predictor
variable to be fitted with, although not recommended.
'tol' (spline option) a positive scalar to set the
tolerance for
convergence during training. By default, it is set to 1e-3 .

The rows above marked as spline options require
'FitMethod', 'splines' . The remaining options belong to the
boosted-tree engine and require 'FitMethod', 'boostedtrees' , which
is the default.

Name Value
'NumTreesPerPredictor' A positive integer, the number of
boosting rounds of the predictor phase. It is a budget rather than a
count: a fit that stops improving ends earlier and reports so. The default
is 300.
'NumTreesPerInteraction' A positive integer, the same
budget for the interaction phase. The default is 100.
'MaxNumSplitsPerPredictor' A positive integer, the
largest number of splits any one predictor tree may make. The default is
1, which makes each tree a stump.
'MaxNumSplitsPerInteraction' The same limit for a tree
over a pair of predictors. The default is 4.
'InitialLearnRateForPredictors' A value greater than 0
and at most 1, the step a round of the predictor phase starts at. A round
that fails to improve the fit is retried at half the step, so this is an
initial value rather than a fixed one. The default is 1.
'InitialLearnRateForInteractions' The same for the
interaction phase. The default is 1.
'MaxPValue' A value between 0 and 1. A candidate pair
of predictors is kept only if its interaction test gives a p -value
no larger than this. The default is 1, which keeps every pair asked for.
'Verbose' A non-negative integer. Greater than zero
prints a trace of the fit. The default is 0.
'NumPrint' A positive integer, how often the trace
reports: the first round and then every NumPrint rounds. The
default is 10.
'CategoricalPredictors' The predictors to treat as
categorical: a vector of column indices, a logical vector with one element
per predictor, or 'all' . A tree splits a categorical predictor
into two sets of levels, and a level not seen in training predicts as a
missing value. Its BinEdges and PairDetectionBinEdges are
empty. The default is none.
'Weights' A numeric vector of non-negative observation
weights, one per row of X . Only their proportions matter.

You can parse either a 'formula' or an 'interactions'
optional parameter. Parsing both parameters will result an error.
Accordingly, you can only pass up to two parameters among 'knots' ,
'order' , and 'dof' to define the required polynomial for
training the GAM model.

See also:
RegressionGAM,
regress,
regress_gp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Fit a Generalized Additive Model (GAM) for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
fitrgp


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 852
statistics: Mdl = fitrgp ( X , Y )
statistics: Mdl = fitrgp (&hellip;, name , value )

Fit a Gaussian process regression model.

Mdl = fitrgp ( X , Y ) returns a RegressionGP
object fitted to the predictor data X and the continuous response
Y , where X is an NxP numeric matrix and Y an
Nx1 numeric vector with as many rows as X .

Mdl = fitrgp (&hellip;, name , value ) passes the
given Name-Value pairs to the model. They are documented under
RegressionGP , and the ones most often wanted are
'KernelFunction' , 'BasisFunction' , 'Standardize' ,
'Sigma' and 'FitMethod' .

When any of 'CrossVal' , 'KFold' , 'Holdout' ,
'Leaveout' or 'CVPartition' is given, a cross validated
model is returned instead, as a RegressionPartitionedModel . Only
one of them may be given at a time.

See also:
RegressionGP,
CompactRegressionGP,
RegressionPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Fit a Gaussian process regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
fitrkernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1170
statistics: Mdl = fitrkernel ( X , Y )
statistics: Mdl = fitrkernel (&hellip;, name , value )
statistics: [ Mdl , FitInfo ] = fitrkernel (&hellip;)

Fit a Gaussian kernel regression model.

Mdl = fitrkernel ( X , Y ) returns a
RegressionKernel object fitted to the predictor data X and
the continuous response Y , where X is an NxP numeric
matrix and Y an Nx1 numeric vector with as many rows as
X .

Mdl = fitrkernel (&hellip;, name , value ) passes
the given Name-Value pairs to the model. They are documented
under RegressionKernel , and the ones most often wanted are
'Learner' , 'Epsilon' ,
'NumExpansionDimensions' , 'KernelScale' ,
'Lambda' and 'BoxConstraint' .

[ Mdl , FitInfo ] = fitrkernel (&hellip;) also returns a
structure describing the optimization: the objective it reached, the
gradient it left, and the tolerances it was given.

Mdl = fitrkernel (&hellip;, cvopt , value ) returns a
RegressionPartitionedKernel
instead when one of 'CrossVal' , 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' is
given. A cross-validated model describes no single fit, so
FitInfo is not available beside it.

See also:
RegressionKernel,
RegressionLinear,
fitrlinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Fit a Gaussian kernel regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 10
fitrlinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1236
statistics: Mdl = fitrlinear ( X , Y )
statistics: Mdl = fitrlinear (&hellip;, name , value )
statistics: [ Mdl , FitInfo ] = fitrlinear (&hellip;)

Fit a linear regression model.

Mdl = fitrlinear ( X , Y ) returns a
RegressionLinear object fitted to the predictor data X and
the continuous response Y , where X is an NxP numeric
matrix and Y an Nx1 numeric vector with as many rows as
X .

Mdl = fitrlinear (&hellip;, name , value ) passes
the given Name-Value pairs to the model. They are documented
under RegressionLinear , and the ones most often wanted are
'Learner' , 'Epsilon' , 'Regularization' ,
'Lambda' and 'Solver' .

[ Mdl , FitInfo ] = fitrlinear (&hellip;) also returns a
structure describing the optimization: what it converged to, how far it
got, and which tolerance stopped it. Its fields follow the solver, so a
dual fit reports the dual variables and a mini-batch fit the batch it
stopped on.

Mdl = fitrlinear (&hellip;, cvopt , value ) returns a
RegressionPartitionedLinear
instead when one of 'CrossVal' , 'KFold' ,
'Holdout' , 'Leaveout' and 'CVPartition' is
given. A cross-validated model describes no single fit, so
FitInfo is not available beside it.

See also:
RegressionLinear,
RegressionKernel,
fitrkernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Fit a linear regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitrnet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 5372
statistics: Mdl = fitrnet ( X , Y )
statistics: Mdl = fitrnet (&hellip;, name , value )

Fit a neural network regression model.

Mdl = fitrnet ( X , Y ) returns a neural network
regression model, Mdl , with X being the predictor data and
Y the continuous response of the observations in X .

X must be an NxP numeric matrix of predictor data, where rows
correspond to observations and columns to features or variables.

Y must be an Nx1 numeric vector holding the response of the
corresponding predictor data in X . Y must have the same number
of rows as X .

The network is trained against the mean squared error and its output layer
applies the identity, so a prediction is an unrestricted real number. Use
fitcnet where the response names a class rather than a quantity.

Mdl = fitrnet (&hellip;, name , value ) returns a
neural network regression model with additional options specified by
Name-Value pair arguments listed below.

Model Parameters

Name Value
'Standardize' A logical scalar indicating whether the
data in X should be centred and scaled before training. The same
transformation is applied by predict . The default is false .
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not has no prediction.
'PredictorNames' A cell array of character vectors
specifying the predictor variable names, in the order they appear in
X .
'ResponseName' A character vector specifying the name of
the response variable. The default is 'Y' .
'ResponseTransform' A character vector naming one of
'none' , 'identity' , 'exp' or 'log' , or a
function handle of one argument, applied to the predicted response by
predict and resubPredict . The default is 'none' .
'LayerSizes' A vector of positive integers defining the
number of units in each fully connected hidden layer. The default value is
10, a single hidden layer of ten units.
'LearningRate' A positive scalar value that defines the
learning rate during the gradient descent. Default value is 0.003. A
larger rate can drive every unit of a hidden layer negative, after which a
rectifier passes no gradient and the network stops training.
Applies only when 'Solver' is 'sgd' .
'Solver' A character vector naming the solver that
trains the network, either 'lbfgs' or 'sgd' . The
default is 'lbfgs' , which minimizes the loss over the whole
training set at once by limited-memory BFGS, as MATLAB does. It takes
no learning rate, stops on the three tolerances below, and reaches a
lower training loss in fewer passes over the data, though each of its
iterations costs several passes where an epoch costs one.
'sgd' visits the samples one at a time and steps down the
gradient of each, running for 'IterationLimit' epochs; it was
the default before version 1.9.0.
'GradientTolerance' A nonnegative scalar. Training
stops once the gradient&rsquo;s infinity norm falls to or below it, which is
the quantity MATLAB tests too. The default is 1e-6 . Applies
only when 'Solver' is 'lbfgs' .
'StepTolerance' A nonnegative scalar. Training
stops once the step&rsquo;s infinity norm falls to or below it, which is the
quantity MATLAB tests too. The default is 1e-6 . Applies only
when 'Solver' is 'lbfgs' .
'LossTolerance' A real scalar. Training stops once
the training loss falls to or below it. The test is on the loss
itself and not on its change, matching MATLAB; pass -Inf to
switch it off. The default is 1e-6 . Applies only when
'Solver' is 'lbfgs' .
'Activations' A character vector or a cellstr vector
specifying the activation functions for the hidden layers of the neural
network, excluding the output layer. The available activation functions
are 'linear' , 'none' , 'sigmoid' , 'relu' ,
'tanh' , 'lrelu' , 'prelu' , 'elu' and
'gelu' . The default value is 'relu' .
'OutputLayerActivation' A character vector specifying
the activation function for the output layer. The available functions are
the same as for 'Activations' . The default value is
'none' , the identity, which is what a regression output calls for;
anything else bounds the prediction to that function&rsquo;s range.
'IterationLimit' A positive integer scalar specifying
the maximum number of training iterations. The default value is 1000.
Under 'sgd' this counts epochs, under
'lbfgs' solver iterations.
'DisplayInfo' A logical scalar indicating whether to
print information during training. Default is false .

The weights of each layer are drawn from a uniform range whose half-width
is set by that layer&rsquo;s activation, and the scheme cannot be chosen: a
rectifying activation ( 'relu' , 'lrelu' , 'prelu' ,
'elu' , 'gelu' ) takes the He range
sqrt (6 / fan_in) , because it passes only half of its input, and
the remaining activations take the Glorot range
sqrt (6 / (fan_in + fan_out)) , which accounts for the backward pass
as well. A network whose layers do not share an activation is therefore
built with both schemes. What each layer was given is reported by the
LayerWeightsInitializers field of the fitted model&rsquo;s
ModelParameters .

See also:
RegressionNeuralNetwork,
fitcnet,
fcnntrain,
fcnnpredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Fit a neural network regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
fitrsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3398
statistics: Mdl = fitrsvm ( X , Y )
statistics: Mdl = fitrsvm (&hellip;, name , value )

Fit a support vector machine regression model.

Mdl = fitrsvm ( X , Y ) returns a support vector
regression model, Mdl , with X being the predictor data and
Y the continuous response of the observations in X .

X must be an NxP numeric matrix of predictor data, where rows
correspond to observations and columns to features or variables.

Y must be an Nx1 numeric vector holding the response of the
corresponding predictor data in X . Y must have the same number
of rows as X .

The model is fitted by epsilon -insensitive regression: an error
smaller than Epsilon costs nothing, so only the observations
outside that tube become support vectors. Use fitcsvm where the
response names a class rather than a quantity.

Mdl = fitrsvm (&hellip;, name , value ) returns a
model with additional options specified by Name-Value pair
arguments listed below.

Model Parameters

Name Value
'Standardize' A logical scalar indicating whether the
data in X should be centred and scaled before training. The same
transformation is applied by predict . The default is false .
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or as
'all' . Each is dummy coded in its place, one column of zeros and
ones per level seen in training, named as in 'x1 == 2' in
ExpandedPredictorNames , and the coded columns are not standardized.
An observation holding a level the training data did not has no prediction.
'PredictorNames' A cell array of character vectors
specifying the predictor variable names, in the order they appear in
X .
'ResponseName' A character vector specifying the name of
the response variable. The default is 'Y' .
'ResponseTransform' A character vector naming one of
'none' , 'identity' , 'exp' or 'log' , or a
function handle of one argument, applied to the predicted response. The
default is 'none' .
'Epsilon' A non-negative scalar, the half-width of the
insensitive tube. The default is iqr ( Y ) / 13.49 , a robust
estimate of a tenth of the response&rsquo;s standard deviation, which is what
MATLAB uses; where that is zero it falls back to 0.1 .
'BoxConstraint' A positive scalar bounding the dual
coefficients, the cost of an error outside the tube. The default is 1.
'KernelFunction' A character vector naming the kernel,
one of 'linear' , the default, 'rbf' , 'gaussian' ,
'polynomial' or 'sigmoid' .
'PolynomialOrder' A positive integer, the order of the
polynomial kernel. The default is 3. It is ignored by every other kernel.
'KernelScale' A positive scalar dividing the predictors
before the kernel is applied. The default is 1.
'KernelOffset' A non-negative scalar added to the kernel
value. The default is 0.
'SVMtype' A character vector selecting the formulation,
either 'eps_svr' , the default, or 'nu_svr' . MATLAB fits
only the epsilon form; 'nu_svr' is an Octave extension.
'Nu' A scalar in (0, 1] used by
'nu_svr' , bounding the fraction of support vectors. The default
is 0.5.
'CacheSize' A positive scalar, the kernel cache in
megabytes. The default is 1000.
'Tolerance' A non-negative scalar, the tolerance of the
termination criterion. The default is 1e-6 .
'Shrinking' Either 0 or 1, whether to use the shrinking
heuristic. The default is 1.

See also:
RegressionSVM,
fitcsvm,
fitrnet,
svmtrain,
svmpredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Fit a support vector machine regression model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
fitrtree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3319
statistics: Mdl = fitrtree ( X , Y )
statistics: Mdl = fitrtree (&hellip;, name , value )

Fit a binary decision tree for regression.

Mdl = fitrtree ( X , Y ) grows a binary decision tree
on the predictor data X and the response Y , and returns it as a
RegressionTree object.

X must be a NxP numeric matrix of predictor data, where rows
correspond to observations and columns to predictors.

Y must be a Nx1 numeric vector holding the response of each
observation in X .

An observation whose response is missing is dropped, and the rows kept are
reported in RowsUsed . An observation missing some of its predictors
is kept: it descends the tree as far as the predictors it does carry allow
and is answered there.

Mdl = fitrtree (&hellip;, name , value ) takes the
options below.

Name Value
'CategoricalPredictors' The predictors whose values are
levels, as indices, as a logical vector with one element per predictor, or
as 'all' . Such a predictor is split into two sets of levels, the
lower mean response on the left, and an observation whose level a node did
not see stops there. MATLAB does not always keep that side, and equally
good splits may be chosen differently.
'MaxNumCategories' A nonnegative integer, recorded in
ModelParameters . The default is 10. Ordering the levels by their
mean response finds the best split whatever the number of levels.
'MaxNumSplits' A nonnegative integer, the largest number
of branch nodes the tree may take. The default is one less than the number
of observations.
'MergeLeaves' 'on' (default) or 'off' .
When on, a pair of leaves whose parent is no worse than the two of them
together is merged back into that parent.
'MinLeafSize' A positive integer, the fewest
observations a leaf may hold. The default is 1.
'MinParentSize' A positive integer, the fewest
observations a node must hold to be split. The default is 10. The value
the fit uses is max (MinParentSize, 2 * MinLeafSize) .
'NumVariablesToSample' A positive integer, the number
of predictors each split is chosen from, drawn afresh at every node, or
'all' (default). A number no smaller than the number of
predictors samples them all and is reported as 'all' . MATLAB also
accepts a fractional number, which is refused here.
'PredictorNames' A cell array of character vectors
naming the columns of X .
'Prune' 'on' (default) or 'off' . When
on, the cost complexity pruning sequence is estimated and reported in
PruneList and PruneAlpha . The tree returned is the unpruned
one either way; prune takes a subtree out of the sequence.
'PruneCriterion' 'mse' , the only criterion a
regression tree has.
'QuadraticErrorTolerance' A positive scalar. A node
whose squared error has fallen to this fraction of the root&rsquo;s is not split
further. The default is 1e-6.
'ResponseName' A character vector naming the response.
The default is 'Y' .
'ResponseTransform' A character vector naming a
transform to apply to the predicted response, or a function handle. The
default is 'none' .
'SplitCriterion' 'mse' , the only criterion a
regression tree has.
'Weights' A nonnegative numeric vector with one element
per observation. The default is uniform.

Surrogate splits are not implemented, and an option asking for them is
refused rather than quietly ignored.

See also:
RegressionTree,
fitctree,
treetrain,
treepredict


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Fit a binary decision tree for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
templateDiscriminant


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1352
statistics: T = templateDiscriminant ()
statistics: T = templateDiscriminant ( name , value )

Create a template for a discriminant analysis classifier.

T = templateDiscriminant () returns a template carrying the
default options of ClassificationDiscriminant . 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 = templateDiscriminant ( name , value ) also stores
the given options. They are the name-value arguments of
fitcdiscr , and any of them may be given here instead.

T = templateDiscriminant ('DiscrimType', 'quadratic');
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationDiscriminant 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,
ClassificationDiscriminant,
fitcdiscr


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 57
Create a template for a discriminant analysis classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
templateEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1895
statistics: T = templateEnsemble ( Method , NLearn , Learners )
statistics: T = templateEnsemble (&hellip;, name , value )

Create a template for an ensemble learner.

T = templateEnsemble ( Method , NLearn ,
Learners ) returns a template for an ensemble grown by Method
from NLearn learners, each fitted as Learners says. A template
names a learner and the options it is to be fitted with, without fitting
anything: it is given to fitcecoc , which grows one such ensemble for
every binary learner it trains.

Method is one of the methods of fitcensemble or
fitrensemble , in any letter case. NLearn is the number of
learning cycles and Learners a learner name, such as
'tree' , or a template of one, such as templateTree returns;
they are the 'NumLearningCycles' and 'Learners' options of
fitcensemble .

T = templateEnsemble (&hellip;, name , value )
also stores the given options. They are the name-value arguments of
fitcensemble , such as 'LearnRate' .

T = templateEnsemble ('GentleBoost', 50, templateTree ('MaxNumSplits', 1));
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type ,
LearnerTemplates , NLearn and one field per option given.
Type is 'regression' for LSBoost and
'classification' for every other method; a 'Type' option
may choose it for Bag, which serves both.

Deviation from MATLAB

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.

Only the method is checked here. The ensemble owns the list of options it
takes and checks them, NLearn and Learners included, when the
template is used, so a value it refuses is refused then rather than now.
MATLAB checks 'LearnRate' already here.

See also:
fitcecoc,
fitcensemble,
templateTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Create a template for an ensemble learner.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
templateKNN


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1288
statistics: T = templateKNN ()
statistics: T = templateKNN ( name , value )

Create a template for a nearest neighbour classifier.

T = templateKNN () returns a template carrying the default
options of ClassificationKNN . 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 = templateKNN ( name , value ) also stores
the given options. They are the name-value arguments of
fitcknn , and any of them may be given here instead.

T = templateKNN ('NumNeighbors', 5, 'Distance', 'cityblock');
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationKNN 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,
ClassificationKNN,
fitcknn


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Create a template for a nearest neighbour classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
templateKernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1348
statistics: T = templateKernel ()
statistics: T = templateKernel ( name , value )

Create a template for a kernel classifier using random feature expansion.

T = templateKernel () returns a template carrying the default
options of ClassificationKernel . 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 = templateKernel ( name , value ) also stores
the given options. They are the name-value arguments of
fitckernel , and any of them may be given here instead.

T = templateKernel ('Learner', 'logistic', 'NumExpansionDimensions', 128);
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationKernel 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,
ClassificationKernel,
fitckernel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Create a template for a kernel classifier using random feature expansion.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
templateLinear


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1328
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.

Deviation from MATLAB

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Create a template for a linear classifier for high dimensional data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
templateNaiveBayes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1323
statistics: T = templateNaiveBayes ()
statistics: T = templateNaiveBayes ( name , value )

Create a template for a naive Bayes classifier.

T = templateNaiveBayes () returns a template carrying the
default options of ClassificationNaiveBayes . 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 = templateNaiveBayes ( name , value ) also stores
the given options. They are the name-value arguments of
fitcnb , and any of them may be given here instead.

T = templateNaiveBayes ('DistributionNames', 'kernel');
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationNaiveBayes 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,
ClassificationNaiveBayes,
fitcnb


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create a template for a naive Bayes classifier.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
templateSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1283
statistics: T = templateSVM ()
statistics: T = templateSVM ( name , value )

Create a template for a support vector machine.

T = templateSVM () returns a template carrying the default
options of ClassificationSVM . 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 = templateSVM ( name , value ) also stores
the given options. They are the name-value arguments of
fitcsvm , and any of them may be given here instead.

T = templateSVM ('KernelFunction', 'rbf', 'BoxConstraint', 2);
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationSVM 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,
ClassificationSVM,
fitcsvm


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Create a template for a support vector machine.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
templateTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1283
statistics: T = templateTree ()
statistics: T = templateTree ( name , value )

Create a template for a binary decision tree.

T = templateTree () returns a template carrying the default
options of ClassificationTree . 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 = templateTree ( name , value ) also stores
the given options. They are the name-value arguments of
fitctree , and any of them may be given here instead.

T = templateTree ('MaxNumSplits', 5, 'MinLeafSize', 3);
Mdl = fitcecoc (X, Y, 'Learners', T);

T is a structure carrying Method , Type and one
field per option given.

Deviation from MATLAB

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. ClassificationTree 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,
ClassificationTree,
fitctree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Create a template for a binary decision tree.





