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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 808
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' 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: 143
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: 186
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: 243
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: 353
ClassificationBaggedEnsemble: obj = ClassificationBaggedEnsemble (X, Y)
ClassificationBaggedEnsemble: obj = ClassificationBaggedEnsemble (..., 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: 166
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: 308
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'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: 161
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: 219
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: 445
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: 103
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: 192
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: 156
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: 199
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: 278
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: 105
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: 104
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: 135
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: 147
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: 138
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: 150
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: 104
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: 146
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: 140
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: 187
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: 151
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: 199
ClassificationBaggedEnsemble: property UseObsForLearner
Which observations each tree drew

An NxNumTrained logical matrix, true where a tree'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: 260
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: 276
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. It has
the class of the 'Weights' given, single or double. 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: 393
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 147
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: 250
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: 319
ClassificationBaggedEnsemble: CVMdl = crossval (obj)
ClassificationBaggedEnsemble: CVMdl = crossval (..., 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: 728
ClassificationBaggedEnsemble: e = edge (obj, X, Y)
ClassificationBaggedEnsemble: e = edge (..., name, value)
ClassificationBaggedEnsemble: e = edge (obj, Tbl, ResponseVarName)
ClassificationBaggedEnsemble: e = edge (obj, Tbl)
Classification edge of a bagged ensemble.

Behaves as CompactClassificationEnsemble.edge.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 728
ClassificationBaggedEnsemble: L = loss (obj, X, Y)
ClassificationBaggedEnsemble: L = loss (obj, Tbl, ResponseVarName)
ClassificationBaggedEnsemble: L = loss (obj, Tbl)
ClassificationBaggedEnsemble: L = loss (..., name, value)
Classification loss of a bagged ensemble.

Behaves as CompactClassificationEnsemble.loss.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 747
ClassificationBaggedEnsemble: m = margin (obj, X, Y)
ClassificationBaggedEnsemble: m = margin (..., name, value)
ClassificationBaggedEnsemble: m = margin (obj, Tbl, ResponseVarName)
ClassificationBaggedEnsemble: m = margin (obj, Tbl)
Classification margins of a bagged ensemble.

Behaves as CompactClassificationEnsemble.margin.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 328
ClassificationBaggedEnsemble: e = oobEdge (obj)
ClassificationBaggedEnsemble: e = oobEdge (..., 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: 455
ClassificationBaggedEnsemble: L = oobLoss (obj)
ClassificationBaggedEnsemble: L = oobLoss (..., 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: 345
ClassificationBaggedEnsemble: m = oobMargin (obj)
ClassificationBaggedEnsemble: m = oobMargin (..., 'Learners', 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: 664
ClassificationBaggedEnsemble: imp = oobPermutedPredictorImportance (obj)
ClassificationBaggedEnsemble: imp = oobPermutedPredictorImportance (..., 'Learners', 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'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: 621
ClassificationBaggedEnsemble: label = oobPredict (obj)
ClassificationBaggedEnsemble: [label, scores] = oobPredict (...)
ClassificationBaggedEnsemble: [...] = oobPredict (..., 'Learners', 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: 353
ClassificationBaggedEnsemble: label = predict (obj, X)
ClassificationBaggedEnsemble: [label, scores] = predict (...)
ClassificationBaggedEnsemble: [...] = predict (..., 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: 400
ClassificationBaggedEnsemble: imp = predictorImportance (obj)
ClassificationBaggedEnsemble: [imp, ma] = predictorImportance (obj)
Estimate the importance of each predictor.

The mean over the trees of each tree'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: 295
ClassificationBaggedEnsemble: e = resubEdge (obj)
ClassificationBaggedEnsemble: e = resubEdge (..., 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: 295
ClassificationBaggedEnsemble: L = resubLoss (obj)
ClassificationBaggedEnsemble: L = resubLoss (..., 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: 306
ClassificationBaggedEnsemble: m = resubMargin (obj)
ClassificationBaggedEnsemble: m = resubMargin (..., 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: 300
ClassificationBaggedEnsemble: label = resubPredict (obj)
ClassificationBaggedEnsemble: [label, scores] = resubPredict (...)
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: 327
ClassificationBaggedEnsemble: B = resume (obj, NumLearningCycles)
ClassificationBaggedEnsemble: B = resume (..., 'NPrint', n)
Grow more trees in a bagged ensemble.

Behaves as ClassificationEnsemble.resume, the new trees' 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: 1440
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: 742
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: 361
ClassificationDiscriminant: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 237
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: 408
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: 3808
ClassificationDiscriminant: obj = ClassificationDiscriminant (X, Y)
ClassificationDiscriminant: obj = ClassificationDiscriminant (Tbl, ResponseVarName)
ClassificationDiscriminant: obj = ClassificationDiscriminant (Tbl, formula)
ClassificationDiscriminant: obj = ClassificationDiscriminant (Tbl, Y)
ClassificationDiscriminant: obj = ClassificationDiscriminant (..., 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 NxP 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 Nx1 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 (..., 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 NxR 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 single or double 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. The model's W keeps
the class of the weights, while every computation runs in double, so
Prior and the predictions are double where MATLAB returns single.
'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: 859
ClassificationDiscriminant: property Coeffs
Coefficient matrices

A KxK 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: 1197
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: 807
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: 475
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'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: 786
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: 270
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: 509
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: 368
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: 617
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: 443
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: 471
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: 263
ClassificationDiscriminant: property Mu
Class means

A KxP 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: 247
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: 241
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: 265
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: 613
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: 168
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: 401
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: 991
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 x 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 x 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: 508
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: 311
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. It has the class of the 'Weights'
given, single or double. 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: 432
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 216
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: 316
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: 280
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: 1027
ClassificationDiscriminant: CVMdl = crossval (obj)
ClassificationDiscriminant: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 1833
ClassificationDiscriminant: err = cvshrink (obj)
ClassificationDiscriminant: [err, gamma] = cvshrink (obj)
ClassificationDiscriminant: [err, gamma, delta] = cvshrink (obj)
ClassificationDiscriminant: [err, gamma, delta, numpred] = cvshrink (obj)
ClassificationDiscriminant: [...] = cvshrink (..., 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'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: 1041
ClassificationDiscriminant: e = edge (obj, X, Y)
ClassificationDiscriminant: e = edge (..., "Weights", w)
ClassificationDiscriminant: e = edge (obj, Tbl, ResponseVarName)
ClassificationDiscriminant: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 968
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, or a table holding them.

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.

A table's variables are matched to the predictors the model was
fitted on by name and not by position: one the model was not fitted on
is passed over, one it needs and cannot find is named, and a value
holding a level is coded as that level was coded at fitting.


# 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: 2220
ClassificationDiscriminant: L = loss (obj, X, Y)
ClassificationDiscriminant: L = loss (obj, Tbl, ResponseVarName)
ClassificationDiscriminant: L = loss (obj, Tbl)
ClassificationDiscriminant: L = loss (..., 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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 matrix or cell matrix containing the class labels
of corresponding predictor data in X. Y must have same
numbers of Rows as X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 1272
ClassificationDiscriminant: M = mahal (obj, X)
ClassificationDiscriminant: M = mahal (..., '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'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, or a table holding them.

M = mahal (..., '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.

A table's variables are matched to the predictors the model was
fitted on by name and not by position: one the model was not fitted on
is passed over, one it needs and cannot find is named, and a value
holding a level is coded as that level was coded at fitting.


# 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: 1275
ClassificationDiscriminant: m = margin (obj, X, Y)
ClassificationDiscriminant: m = margin (obj, Tbl, ResponseVarName)
ClassificationDiscriminant: m = margin (obj, Tbl)
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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 867
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'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: 1686
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 246
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: 609
ClassificationDiscriminant: L = resubLoss (obj)
ClassificationDiscriminant: L = resubLoss (..., 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: 291
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: 611
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'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: 496
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'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: 682
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: 159
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: 132
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: 139
ClassificationECOC: property BinaryLoss
The loss that turns a binary learner'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: 220
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'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: 179
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: 217
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: 630
ClassificationECOC: obj = ClassificationECOC (X, Y)
ClassificationECOC: obj = ClassificationECOC (Tbl, ResponseVarName)
ClassificationECOC: obj = ClassificationECOC (Tbl, formula)
ClassificationECOC: obj = ClassificationECOC (Tbl, Y)
ClassificationECOC: obj = ClassificationECOC (..., 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: 118
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: 146
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: 78
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: 133
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: 195
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: 136
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: 126
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: 105
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: 100
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: 71
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: 104
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: 177
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: 90
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: 213
ClassificationECOC: property W
The observation weights, scaled so that each class carries its prior and
the whole sums to one. It has the class of the 'Weights' given,
single or double. 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: 320
ClassificationECOC: property X
The predictor data the model was fitted on, one row per observation.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 100
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: 353
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: 776
ClassificationECOC: CVMdl = crossval (obj)
ClassificationECOC: CVMdl = crossval (..., name, value)
Cross validate a ClassificationECOC.

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

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: 596
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: 597
ClassificationECOC: e = edge (obj, X, Y)
ClassificationECOC: e = edge (obj, Tbl, ResponseVarName)
ClassificationECOC: e = edge (obj, Tbl)
Classification edge of a ClassificationECOC. See
CompactClassificationECOC.edge.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 597
ClassificationECOC: L = loss (obj, X, Y)
ClassificationECOC: L = loss (obj, Tbl, ResponseVarName)
ClassificationECOC: L = loss (obj, Tbl)
Classification loss of a ClassificationECOC. See
CompactClassificationECOC.loss.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 613
ClassificationECOC: m = margin (obj, X, Y)
ClassificationECOC: m = margin (obj, Tbl, ResponseVarName)
ClassificationECOC: m = margin (obj, Tbl)
Classification margin of a ClassificationECOC. See
CompactClassificationECOC.margin.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 695
ClassificationECOC: label = predict (obj, XC)
ClassificationECOC: [label, NegLoss, PBScore] = predict (...)
ClassificationECOC: [...] = predict (..., 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 116
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: 116
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: 122
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: 146
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: 409
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'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: 619
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: 143
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: 186
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: 243
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: 576
ClassificationEnsemble: obj = ClassificationEnsemble (X, Y)
ClassificationEnsemble: obj = ClassificationEnsemble (Tbl, ResponseVarName)
ClassificationEnsemble: obj = ClassificationEnsemble (Tbl, formula)
ClassificationEnsemble: obj = ClassificationEnsemble (Tbl, Y)
ClassificationEnsemble: obj = ClassificationEnsemble (..., 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: 166
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: 308
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'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: 161
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: 445
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: 103
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: 192
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: 156
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: 199
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: 278
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: 105
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: 104
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: 135
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: 147
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: 138
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: 104
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: 146
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: 140
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: 187
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: 151
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: 260
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: 276
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. It has
the class of the 'Weights' given, single or double. 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: 393
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 147
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: 294
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: 574
ClassificationEnsemble: CVMdl = crossval (obj)
ClassificationEnsemble: CVMdl = crossval (..., 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: 732
ClassificationEnsemble: e = edge (obj, X, Y)
ClassificationEnsemble: e = edge (..., name, value)
ClassificationEnsemble: e = edge (obj, Tbl, ResponseVarName)
ClassificationEnsemble: e = edge (obj, Tbl)
Classification edge of an ensemble.

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

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 732
ClassificationEnsemble: L = loss (obj, X, Y)
ClassificationEnsemble: L = loss (obj, Tbl, ResponseVarName)
ClassificationEnsemble: L = loss (obj, Tbl)
ClassificationEnsemble: L = loss (..., name, value)
Classification loss of an ensemble.

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

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 751
ClassificationEnsemble: m = margin (obj, X, Y)
ClassificationEnsemble: m = margin (..., name, value)
ClassificationEnsemble: m = margin (obj, Tbl, ResponseVarName)
ClassificationEnsemble: m = margin (obj, Tbl)
Classification margins of an ensemble.

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

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 652
ClassificationEnsemble: label = predict (obj, X)
ClassificationEnsemble: [label, scores] = predict (...)
ClassificationEnsemble: [...] = predict (..., name, value)
Classify new data with an ensemble.

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

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 308
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: 265
ClassificationEnsemble: e = resubEdge (obj)
ClassificationEnsemble: e = resubEdge (..., 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: 265
ClassificationEnsemble: L = resubLoss (obj)
ClassificationEnsemble: L = resubLoss (..., 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: 272
ClassificationEnsemble: m = resubMargin (obj)
ClassificationEnsemble: m = resubMargin (..., 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: 322
ClassificationEnsemble: label = resubPredict (obj)
ClassificationEnsemble: [label, scores] = resubPredict (...)
ClassificationEnsemble: [...] = resubPredict (..., 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: 653
ClassificationEnsemble: B = resume (obj, NumLearningCycles)
ClassificationEnsemble: B = resume (..., 'NPrint', 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: 1997
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'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'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: 287
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: 462
ClassificationGAM: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 218
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: 399
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: 3980
ClassificationGAM: obj = ClassificationGAM (X, Y)
ClassificationGAM: obj = ClassificationGAM (Tbl, ResponseVarName)
ClassificationGAM: obj = ClassificationGAM (Tbl, formula)
ClassificationGAM: obj = ClassificationGAM (Tbl, Y)
ClassificationGAM: obj = ClassificationGAM (..., 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 NxP 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 Nx1 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 (..., 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 NxR 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'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'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: 1188
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: 206
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: 293
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: 708
ClassificationGAM: property FitMethod
Which engine fitted the model

A character vector, either 'boostedtrees' or
'splines'. The default is 'boostedtrees', which is the
scheme MATLAB'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: 272
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: 359
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: 556
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: 596
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: 196
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: 192
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: 206
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: 792
ClassificationGAM: property ModelParameters
Parameters the model was fitted with

A structure holding the fitting parameters. Under the boosted-tree
engine it carries MATLAB'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: 267
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: 199
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: 229
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: 223
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: 173
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: 480
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'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: 256
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: 557
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: 537
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: 159
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: 383
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: 1328
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 x 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 x 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'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: 766
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'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: 368
ClassificationGAM: property W
Observation weights

A numeric column vector with one entry per observation used for training,
normalised to sum to one. It has the class of the 'Weights'
given, single or double. 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: 423
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 307
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: 1061
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'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's own: they are
taken in the order nchoosek lists the pairs, where MATLAB ranks
them by how much each contributes. The constructor'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: 233
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: 1012
ClassificationGAM: CVMdl = crossval (obj)
ClassificationGAM: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 860
ClassificationGAM: e = edge (obj, X, Y)
ClassificationGAM: e = edge (..., "Weights", w)
ClassificationGAM: e = edge (obj, Tbl, ResponseVarName)
ClassificationGAM: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1346
ClassificationGAM: L = loss (obj, X, Y)
ClassificationGAM: L = loss (obj, Tbl, ResponseVarName)
ClassificationGAM: L = loss (obj, Tbl)
ClassificationGAM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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'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: 914
ClassificationGAM: m = margin (obj, X, Y)
ClassificationGAM: m = margin (obj, Tbl, ResponseVarName)
ClassificationGAM: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1636
ClassificationGAM: label = predict (obj, XC)
ClassificationGAM: [label, score] = predict (obj, XC)
ClassificationGAM: [label, score] = predict (..., '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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level
was coded at fitting.

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: 165
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: 217
ClassificationGAM: L = resubLoss (obj)
ClassificationGAM: L = resubLoss (..., 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: 171
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: 329
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: 949
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: 458
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'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: 706
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: 352
ClassificationKNN: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 944
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: 323
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: 659
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: 228
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: 399
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: 5755
ClassificationKNN: obj = ClassificationKNN (X, Y)
ClassificationKNN: obj = ClassificationKNN (Tbl, ResponseVarName)
ClassificationKNN: obj = ClassificationKNN (Tbl, formula)
ClassificationKNN: obj = ClassificationKNN (Tbl, Y)
ClassificationKNN: obj = ClassificationKNN (..., 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 NxP 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 Nx1 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 (..., 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 NxR 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 single or double 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. The model's W keeps the
class of the weights, while every computation runs in double, so
Prior is double where MATLAB returns single.
'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: 1178
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: 1259
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: 1036
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 1xN vector containing one row of the predictor
data, ZJ is an M2xN matrix containing multiple rows of the
predictor data, and D2 is an M2x1 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: 716
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: 261
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: 359
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: 445
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: 784
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: 435
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: 402
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: 399
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: 229
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: 223
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: 256
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: 604
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: 159
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: 383
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: 982
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 x 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 x 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: 463
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: 370
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. It has the class of the
'Weights' given, single or double. 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: 423
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 307
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: 988
ClassificationKNN: CVMdl = crossval (obj)
ClassificationKNN: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 1005
ClassificationKNN: e = edge (obj, X, Y)
ClassificationKNN: e = edge (..., "Weights", w)
ClassificationKNN: e = edge (obj, Tbl, ResponseVarName)
ClassificationKNN: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 2166
ClassificationKNN: L = loss (obj, X, Y)
ClassificationKNN: L = loss (obj, Tbl, ResponseVarName)
ClassificationKNN: L = loss (obj, Tbl)
ClassificationKNN: L = loss (..., 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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 matrix or cell matrix containing the class labels
of corresponding predictor data in X. Y must have same
numbers of Rows as X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 1166
ClassificationKNN: m = margin (obj, X, Y)
ClassificationKNN: m = margin (obj, Tbl, ResponseVarName)
ClassificationKNN: m = margin (obj, Tbl)
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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 25
ClassificationKNN.predict


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

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 204
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: 563
ClassificationKNN: L = resubLoss (obj)
ClassificationKNN: L = resubLoss (..., 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: 282
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: 593
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'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: 458
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'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: 1306
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: 309
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: 190
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: 305
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: 2984
ClassificationKernel: obj = ClassificationKernel (X, Y)
ClassificationKernel: obj = ClassificationKernel (Tbl, ResponseVarName)
ClassificationKernel: obj = ClassificationKernel (Tbl, formula)
ClassificationKernel: obj = ClassificationKernel (Tbl, Y)
ClassificationKernel: obj = ClassificationKernel (..., 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 (..., 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'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, as a
single or double vector. Every computation runs in double.
'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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.

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: 594
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: 323
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: 178
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: 235
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: 191
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: 137
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: 236
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: 201
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: 342
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: 215
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: 252
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: 211
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: 132
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: 313
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: 218
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: 668
ClassificationKernel: e = edge (obj, X, Y)
ClassificationKernel: e = edge (..., 'Weights', W)
ClassificationKernel: e = edge (obj, Tbl, ResponseVarName)
ClassificationKernel: e = edge (obj, Tbl)
Weighted mean of the classification margins.

The weights are normalized within each class to that class's prior
before they are applied.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 796
ClassificationKernel: l = loss (obj, X, Y)
ClassificationKernel: l = loss (obj, Tbl, ResponseVarName)
ClassificationKernel: l = loss (obj, Tbl)
ClassificationKernel: l = loss (..., name, value)
Classification loss on new data.

l = loss (obj, X, Y) returns the
misclassification rate.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 673
ClassificationKernel: m = margin (obj, X, Y)
ClassificationKernel: m = margin (obj, Tbl, ResponseVarName)
ClassificationKernel: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 687
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'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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 1228
ClassificationKernel: obj = resume (obj, X, Y)
ClassificationKernel: obj = resume (..., name, value)
ClassificationKernel: obj = resume (obj, Tbl, ResponseVarName)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
The response is then named by ResponseVarName, a variable of the
table, or given beside the table as Y; unlike
ClassificationKernel.loss, it is never taken from the table
unasked.


# 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: 206
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: 1084
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: 198
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: 227
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: 190
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: 398
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: 4473
ClassificationLinear: obj = ClassificationLinear (X, Y)
ClassificationLinear: obj = ClassificationLinear (Tbl, ResponseVarName)
ClassificationLinear: obj = ClassificationLinear (Tbl, formula)
ClassificationLinear: obj = ClassificationLinear (Tbl, Y)
ClassificationLinear: obj = ClassificationLinear (..., 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 (..., 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'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, as a
single or double vector. Every computation runs in double.
'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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.

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: 631
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: 256
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: 272
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: 238
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: 139
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: 267
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: 215
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: 252
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: 132
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: 132
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: 367
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: 736
ClassificationLinear: e = edge (obj, X, Y)
ClassificationLinear: e = edge (..., 'Weights', W)
ClassificationLinear: e = edge (obj, Tbl, ResponseVarName)
ClassificationLinear: e = edge (obj, Tbl)
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's prior before they are applied.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 835
ClassificationLinear: l = loss (obj, X, Y)
ClassificationLinear: l = loss (obj, Tbl, ResponseVarName)
ClassificationLinear: l = loss (obj, Tbl)
ClassificationLinear: l = loss (..., name, value)
Classification loss on new data.

l = loss (obj, X, Y) returns the
misclassification rate, one value per regularization strength.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 741
ClassificationLinear: m = margin (obj, X, Y)
ClassificationLinear: m = margin (obj, Tbl, ResponseVarName)
ClassificationLinear: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 875
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 179
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: 252
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: 1210
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' 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: 487
ClassificationNaiveBayes: property BinEdges
Bin edges

A cell array with one entry per predictor, holding that predictor'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: 246
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: 210
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: 303
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: 641
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (X, Y)
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (Tbl, ResponseVarName)
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (Tbl, formula)
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (Tbl, Y)
ClassificationNaiveBayes: obj = ClassificationNaiveBayes (..., 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: 392
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: 229
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: 419
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: 300
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: 366
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: 224
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: 575
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: 263
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: 240
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: 245
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: 323
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: 164
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: 372
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: 278
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: 307
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: 220
ClassificationNaiveBayes: property Support
Kernel smoothing supports

A cell array with one entry per predictor giving the support of a
'kernel' predictor'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: 376
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 over the
observations belonging to it in proportion to the 'Weights'
given, or evenly when none were. It has the class of the
'Weights' given, single or double. 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: 264
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'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: 415
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 314
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: 389
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: 556
ClassificationNaiveBayes: CVMdl = crossval (obj)
ClassificationNaiveBayes: CVMdl = crossval (..., 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's training part
and returns a ClassificationPartitionedModel.

CVMdl = crossval (..., 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: 811
ClassificationNaiveBayes: e = edge (obj, X, Y)
ClassificationNaiveBayes: e = edge (..., 'Weights', w)
ClassificationNaiveBayes: e = edge (obj, Tbl, ResponseVarName)
ClassificationNaiveBayes: e = edge (obj, Tbl)
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's prior
before they are applied.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 674
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.

X may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.


# 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: 926
ClassificationNaiveBayes: l = loss (obj, X, Y)
ClassificationNaiveBayes: l = loss (obj, Tbl, ResponseVarName)
ClassificationNaiveBayes: l = loss (obj, Tbl)
ClassificationNaiveBayes: l = loss (..., name, value)
Classification loss on new data.

l = loss (obj, X, Y) returns the minimum
expected misclassification cost.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 833
ClassificationNaiveBayes: m = margin (obj, X, Y)
ClassificationNaiveBayes: m = margin (obj, Tbl, ResponseVarName)
ClassificationNaiveBayes: m = margin (obj, Tbl)
Classification margin on new data.

m = margin (obj, X, Y) returns one margin
per observation: the posterior the model gives the observation'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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 892
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 87
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: 179
ClassificationNaiveBayes: l = resubLoss (obj)
ClassificationNaiveBayes: l = resubLoss (..., 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: 91
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: 298
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: 485
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'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: 590
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: 381
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: 362
ClassificationNeuralNetwork: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 238
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: 409
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: 5528
ClassificationNeuralNetwork: obj = ClassificationNeuralNetwork (X, Y)
ClassificationNeuralNetwork: obj = ClassificationNeuralNetwork (Tbl, ResponseVarName)
ClassificationNeuralNetwork: obj = ClassificationNeuralNetwork (Tbl, formula)
ClassificationNeuralNetwork: obj = ClassificationNeuralNetwork (Tbl, Y)
ClassificationNeuralNetwork: obj = ClassificationNeuralNetwork (..., 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 NxP 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 Nx1 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.
'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'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'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: 745
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: 779
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: 184
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: 271
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: 369
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: 206
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: 239
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: 479
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: 290
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: 221
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: 1145
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'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'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: 409
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: 249
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: 243
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: 447
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: 266
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: 618
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: 169
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: 403
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: 992
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 x 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 x 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: 440
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: 276
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: 455
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'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: 517
ClassificationNeuralNetwork: property W
Observation weights

A numeric column vector with one entry per training observation,
summing to one, by which the training loss weighs each observation. It
has the class of the 'Weights' given, single or double. 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, so
that 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: 433
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 317
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: 283
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: 1030
ClassificationNeuralNetwork: CVMdl = crossval (obj)
ClassificationNeuralNetwork: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 1010
ClassificationNeuralNetwork: e = edge (obj, X, Y)
ClassificationNeuralNetwork: e = edge (..., "Weights", w)
ClassificationNeuralNetwork: e = edge (obj, Tbl, ResponseVarName)
ClassificationNeuralNetwork: e = edge (obj, Tbl)
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 (..., "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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1614
ClassificationNeuralNetwork: L = loss (obj, X, Y)
ClassificationNeuralNetwork: L = loss (obj, Tbl, ResponseVarName)
ClassificationNeuralNetwork: L = loss (obj, Tbl)
ClassificationNeuralNetwork: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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'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'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: 991
ClassificationNeuralNetwork: m = margin (obj, X, Y)
ClassificationNeuralNetwork: m = margin (obj, Tbl, ResponseVarName)
ClassificationNeuralNetwork: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1491
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 295
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: 402
ClassificationNeuralNetwork: L = resubLoss (obj)
ClassificationNeuralNetwork: L = resubLoss (..., 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: 286
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: 733
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: 498
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'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: 764
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'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: 128
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: 130
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: 156
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: 153
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: 105
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: 306
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: 138
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: 103
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: 144
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: 94
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: 138
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: 116
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: 141
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: 111
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: 110
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: 115
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: 206
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: 264
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: 94
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: 306
ClassificationPartitionedECOC: property X
The predictor data the folds were fitted on. This property is
read-only.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 112
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: 170
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: 339
ClassificationPartitionedECOC: L = kfoldLoss (obj)
ClassificationPartitionedECOC: L = kfoldLoss (..., 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: 203
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: 498
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: 319
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: 591
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: 123
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: 142
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: 104
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: 277
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: 101
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: 190
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: 94
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: 301
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: 111
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: 136
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: 138
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: 111
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: 113
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: 115
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: 177
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: 227
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: 183
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: 210
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: 281
ClassificationPartitionedEnsemble: property X
Predictor data

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 87
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: 359
ClassificationPartitionedEnsemble: e = kfoldEdge (obj)
ClassificationPartitionedEnsemble: e = kfoldEdge (..., 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: 774
ClassificationPartitionedEnsemble: L = kfoldLoss (obj)
ClassificationPartitionedEnsemble: L = kfoldLoss (..., 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: 281
ClassificationPartitionedEnsemble: m = kfoldMargin (obj)
Cross-validated classification margins.

m holds each observation'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: 552
ClassificationPartitionedEnsemble: label = kfoldPredict (obj)
ClassificationPartitionedEnsemble: [label, scores] = kfoldPredict (obj)
Classify each observation with the fold that held it out.

scores holds each observation'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: 336
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'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: 357
ClassificationPartitionedEnsemble: CVMdl = resume (obj, NumLearningCycles)
ClassificationPartitionedEnsemble: CVMdl = resume (..., 'NPrint', n)
Grow more learners in every fold.

Each fold'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: 923
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: 201
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: 171
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: 1040
ClassificationPartitionedKernel: obj = ClassificationPartitionedKernel (X, Y)
ClassificationPartitionedKernel: obj = ClassificationPartitionedKernel (..., 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 (...,
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'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: 235
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: 178
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: 221
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: 1135
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'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'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: 220
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: 154
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: 144
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: 313
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'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: 143
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: 458
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: 215
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: 196
ClassificationPartitionedKernel: property W
Observation weights

An Nx1 numeric vector summing to one, normalized within each
class to that class'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: 142
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: 363
ClassificationPartitionedKernel: e = kfoldEdge (obj)
ClassificationPartitionedKernel: e = kfoldEdge (..., name, value)
Weighted mean of the out-of-fold classification margins.

e = kfoldEdge (..., 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: 406
ClassificationPartitionedKernel: l = kfoldLoss (obj)
ClassificationPartitionedKernel: l = kfoldLoss (..., name, value)
Out-of-fold classification loss.

l = kfoldLoss (obj) returns the out-of-fold
misclassification rate.

l = kfoldLoss (..., 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: 252
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: 426
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: 914
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: 201
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: 171
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: 1010
ClassificationPartitionedLinear: obj = ClassificationPartitionedLinear (X, Y)
ClassificationPartitionedLinear: obj = ClassificationPartitionedLinear (..., 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 (...,
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'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: 235
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: 178
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: 221
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: 1135
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'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'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: 220
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: 154
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: 144
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: 313
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'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: 143
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: 458
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: 215
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: 196
ClassificationPartitionedLinear: property W
Observation weights

An Nx1 numeric vector summing to one, normalized within each
class to that class'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: 142
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: 363
ClassificationPartitionedLinear: e = kfoldEdge (obj)
ClassificationPartitionedLinear: e = kfoldEdge (..., name, value)
Weighted mean of the out-of-fold classification margins.

e = kfoldEdge (..., 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: 406
ClassificationPartitionedLinear: l = kfoldLoss (obj)
ClassificationPartitionedLinear: l = kfoldLoss (..., name, value)
Out-of-fold classification loss.

l = kfoldLoss (obj) returns the out-of-fold
misclassification rate.

l = kfoldLoss (..., 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: 315
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: 515
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: 406
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: 491
ClassificationPartitionedModel: property BinEdges
Bin edges

A cell array with one entry per predictor, holding that predictor'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: 205
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: 412
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: 444
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: 1429
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: 365
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: 180
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: 1074
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'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'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: 240
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: 725
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: 306
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: 269
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: 665
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: 172
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: 181
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: 300
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: 201
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: 436
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 320
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: 874
ClassificationPartitionedModel: e = kfoldEdge (obj)
ClassificationPartitionedModel: e = kfoldEdge (..., 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 (..., 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: 1068
ClassificationPartitionedModel: L = kfoldLoss (obj)
ClassificationPartitionedModel: L = kfoldLoss (..., 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's
model that did not see it, which is what kfoldPredict returns.

obj must be a ClassificationPartitionedModel object.

L = kfoldLoss (..., 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: 705
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'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'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: 2132
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: 899
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 KxM 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, 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: 708
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: 459
ClassificationSVM: property Alpha
Trained classifier coefficients

The coefficients of the trained SVM classifier specified as an sx1
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: 485
ClassificationSVM: property Beta
Linear predictor coefficients

The linear predictor coefficients specified as a px1 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: 108
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: 352
ClassificationSVM: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 396
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: 228
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: 399
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: 4492
ClassificationSVM: obj = ClassificationSVM (X, Y)
ClassificationSVM: obj = ClassificationSVM (Tbl, ResponseVarName)
ClassificationSVM: obj = ClassificationSVM (Tbl, formula)
ClassificationSVM: obj = ClassificationSVM (Tbl, Y)
ClassificationSVM: obj = ClassificationSVM (..., 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 NxP 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 Nx1 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.
'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 single or double vector of nonnegative
observation weights, one per row of X. Each observation'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. The model's W keeps the class of the
weights, while every computation runs in double, so Prior is
double where MATLAB returns single.
'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: 248
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: 261
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: 359
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: 270
ClassificationSVM: property IsSupportVector
Support vector indicator

An Nx1 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: 369
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: 717
ClassificationSVM: property ModelParameters
SVM training parameters

A structure holding the parameters the fit was given. The engine is
LIBSVM and the record is LIBSVM'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: 438
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: 195
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: 229
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: 223
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: 529
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'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: 256
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: 541
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: 159
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: 383
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: 982
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 x 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 x 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: 472
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: 490
ClassificationSVM: property SupportVectorLabels
Support vector class labels

The support vector class labels specified as an sx1 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: 313
ClassificationSVM: property SupportVectors
Support vectors

The support vectors of the trained SVM classifier specified an sxp
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: 378
ClassificationSVM: property W
Observation weights

A numeric column vector with one entry per training observation,
normalized to sum to one, as MATLAB reports it. It has the class of the
'Weights' given, single or double. 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: 423
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 307
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: 233
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: 1008
ClassificationSVM: CVMdl = crossval (obj)
ClassificationSVM: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 618
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: 1005
ClassificationSVM: e = edge (obj, X, Y)
ClassificationSVM: e = edge (..., "Weights", w)
ClassificationSVM: e = edge (obj, Tbl, ResponseVarName)
ClassificationSVM: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 2162
ClassificationSVM: L = loss (obj, X, Y)
ClassificationSVM: L = loss (obj, Tbl, ResponseVarName)
ClassificationSVM: L = loss (obj, Tbl)
ClassificationSVM: L = loss (..., 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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 matrix or cell matrix containing the class labels
of corresponding predictor data in X. Y must have same
numbers of Rows as X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 1229
ClassificationSVM: m = margin (obj, X, Y)
ClassificationSVM: m = margin (obj, Tbl, ResponseVarName)
ClassificationSVM: m = margin (obj, Tbl)
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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1948
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 204
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: 1498
ClassificationSVM: L = resubLoss (obj)
ClassificationSVM: L = resubLoss (..., 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 (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 282
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: 1515
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: 458
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'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: 1623
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'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: 267
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: 222
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: 271
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: 200
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: 250
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: 212
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: 287
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'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: 4022
ClassificationTree: obj = ClassificationTree (X, Y)
ClassificationTree: obj = ClassificationTree (Tbl, ResponseVarName)
ClassificationTree: obj = ClassificationTree (Tbl, formula)
ClassificationTree: obj = ClassificationTree (Tbl, Y)
ClassificationTree: obj = ClassificationTree (..., 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 (..., 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'.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.
'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 single or double vector with
one element per observation. The default is uniform. The model's
W keeps the class of the weights, while every computation runs in
double, so Prior and the predictions are double where MATLAB
returns single.

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'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: 458
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: 257
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: 309
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: 263
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: 212
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: 295
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: 309
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: 205
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: 189
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: 469
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: 353
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'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: 333
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'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: 253
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: 485
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: 331
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's size is not in general the
sum of its children'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: 295
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: 273
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: 157
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: 170
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: 502
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: 365
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: 437
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: 140
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: 388
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: 226
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: 178
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: 177
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: 173
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: 177
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: 167
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: 209
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: 367
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's prior, and so that all of them together
sum to one. It has the class of the 'Weights' given, single or
double. 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: 394
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 245
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: 379
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: 1024
ClassificationTree: CVMdl = crossval (obj)
ClassificationTree: CVMdl = crossval (..., 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 (..., 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'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: 2072
ClassificationTree: E = cvloss (obj)
ClassificationTree: [E, SE, Nleaf, BestLevel] = cvloss (obj)
ClassificationTree: [...] = cvloss (..., 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
(...) 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.

[...] = cvloss (..., 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's tree is pruned to the level its own sequence gives for the
geometric mean of the parent'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's tree back to its root.

Every fold is grown with the parent's class names, prior, cost and
observation weights, and the loss is weighed by the model's own
weights.

The standard error is not MATLAB'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's is. Its
value is not MATLAB'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'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: 898
ClassificationTree: e = edge (obj, X, Y)
ClassificationTree: e = edge (..., 'Weights', w)
ClassificationTree: e = edge (obj, Tbl, ResponseVarName)
ClassificationTree: e = edge (obj, Tbl)
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's prior
before they are applied.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1012
ClassificationTree: l = loss (obj, X, Y)
ClassificationTree: l = loss (obj, Tbl, ResponseVarName)
ClassificationTree: l = loss (obj, Tbl)
ClassificationTree: l = loss (..., name, value)
Classification loss on new data.

l = loss (obj, X, Y) returns the
minimum expected misclassification cost.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 915
ClassificationTree: m = margin (obj, X, Y)
ClassificationTree: m = margin (obj, Tbl, ResponseVarName)
ClassificationTree: m = margin (obj, Tbl)
Classification margin on new data.

m = margin (obj, X, Y) returns one
margin per observation: the score the model gives the observation'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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 485
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: 1434
ClassificationTree: label = predict (obj, XC)
ClassificationTree: [label, score] = predict (...)
ClassificationTree: [label, score, node] = predict (...)
ClassificationTree: [label, score, node, cnum] = predict (...)
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.

XC may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

[label, score] = predict (...) also returns
score, an NxK matrix holding the class probabilities of
the node each row landed in, after ScoreTransform.

[label, score, node] = predict (...) also
returns the number of the node each row landed in, and
[label, score, node, cnum] = predict
(...) 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: 692
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: 1127
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'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: 220
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: 418
ClassificationTree: l = resubLoss (obj)
ClassificationTree: l = resubLoss (..., 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: 196
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: 309
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: 475
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'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: 394
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'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: 1655
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: 749
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: 244
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: 358
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: 836
CompactClassificationDiscriminant: property Coeffs
Coefficient matrices

A KxK 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: 480
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: 1151
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: 814
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: 482
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'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: 793
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: 277
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: 516
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: 624
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: 450
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: 265
CompactClassificationDiscriminant: property Mu
Class means

A KxP 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: 255
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: 272
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: 564
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: 175
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: 882
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 x 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 x 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: 515
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: 1069
CompactClassificationDiscriminant: e = edge (obj, X, Y)
CompactClassificationDiscriminant: e = edge (..., "Weights", w)
CompactClassificationDiscriminant: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationDiscriminant: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 982
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, or a table holding them.

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.

A table's variables are matched to the predictors the model was
fitted on by name and not by position: one the model was not fitted on
is passed over, one it needs and cannot find is named, and a value
holding a level is coded as that level was coded at fitting.


# 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: 2250
CompactClassificationDiscriminant: L = loss (obj, X, Y)
CompactClassificationDiscriminant: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationDiscriminant: L = loss (obj, Tbl)
CompactClassificationDiscriminant: L = loss (..., 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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 matrix or cell matrix containing the class labels
of corresponding predictor data in X. Y must have same
numbers of rows as X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 1293
CompactClassificationDiscriminant: M = mahal (obj, X)
CompactClassificationDiscriminant: M = mahal (..., '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'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, or a table holding them.

M = mahal (..., '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.

A table's variables are matched to the predictors the model was
fitted on by name and not by position: one the model was not fitted on
is passed over, one it needs and cannot find is named, and a value
holding a level is coded as that level was coded at fitting.


# 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: 1291
CompactClassificationDiscriminant: m = margin (obj, X, Y)
CompactClassificationDiscriminant: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationDiscriminant: m = margin (obj, Tbl)
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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 881
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'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: 1689
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 517
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'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: 667
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: 242
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: 512
CompactClassificationECOC: property BinaryLoss
The loss that turns a binary learner'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: 173
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: 204
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: 229
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: 407
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: 168
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: 252
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: 239
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: 144
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: 125
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: 111
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: 196
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: 610
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: 829
CompactClassificationECOC: e = edge (obj, X, Y)
CompactClassificationECOC: e = edge (..., name, value)
CompactClassificationECOC: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationECOC: e = edge (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1055
CompactClassificationECOC: L = loss (obj, X, Y)
CompactClassificationECOC: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationECOC: L = loss (obj, Tbl)
CompactClassificationECOC: L = loss (..., name, value)
Classification loss of a CompactClassificationECOC.

L = loss (obj, X, Y) returns the
weighted classification loss of X against the true labels
Y.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
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: 1038
CompactClassificationECOC: m = margin (obj, X, Y)
CompactClassificationECOC: m = margin (..., name, value)
CompactClassificationECOC: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationECOC: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1520
CompactClassificationECOC: label = predict (obj, XC)
CompactClassificationECOC: [label, NegLoss] = predict (...)
CompactClassificationECOC: [label, NegLoss, PBScore] = predict (...)
CompactClassificationECOC: [...] = predict (..., 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 (...) also returns
the NxK negated average loss, the largest entry of a row naming
the class that row was given.

[label, NegLoss, PBScore] = predict (...)
also returns the NxL scores the binary learners gave the class
each was trained to call +1.

Name Value
'BinaryLoss' The loss to read the binary
scores with, overriding the BinaryLoss property for this call.
'Decoding' 'lossweighted' (default) or
'lossbased'. The first averages the loss over the learners a
class took part in, the second over every learner, a class that sat a
column out costing the same there as a class at the decision boundary.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 423
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'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: 557
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: 193
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: 195
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: 336
CompactClassificationEnsemble: property CombineWeights
How the weak learners are combined

'WeightedSum' for a boosted ensemble, whose scores are the sum
of each learner's output times its weight, or 'WeightedAverage'
for a bagged one, whose scores are the weighted average of its trees'
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: 273
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: 192
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: 197
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: 134
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: 142
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: 182
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: 131
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: 290
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: 419
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: 158
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: 267
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: 914
CompactClassificationEnsemble: e = edge (obj, X, Y)
CompactClassificationEnsemble: e = edge (..., name, value)
CompactClassificationEnsemble: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationEnsemble: e = edge (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1632
CompactClassificationEnsemble: L = loss (obj, X, Y)
CompactClassificationEnsemble: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationEnsemble: L = loss (obj, Tbl)
CompactClassificationEnsemble: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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'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: 865
CompactClassificationEnsemble: m = margin (obj, X, Y)
CompactClassificationEnsemble: m = margin (..., name, value)
CompactClassificationEnsemble: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationEnsemble: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1535
CompactClassificationEnsemble: label = predict (obj, X)
CompactClassificationEnsemble: [label, scores] = predict (...)
CompactClassificationEnsemble: [...] = predict (..., 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'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's prediction for the first class and
its negative for the second; for AdaBoostM2 and RUSBoost it is the
learner's class probabilities. The scores of a bagged ensemble are the
average of its trees' 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 558
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'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: 284
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: 951
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'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: 294
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: 290
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: 225
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: 349
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: 426
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: 1195
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: 300
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: 186
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: 279
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: 563
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: 603
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: 203
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: 274
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: 230
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: 275
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: 263
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: 270
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: 166
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: 1335
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 x 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 x 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'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: 222
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: 943
CompactClassificationGAM: e = edge (obj, X, Y)
CompactClassificationGAM: e = edge (..., "Weights", w)
CompactClassificationGAM: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationGAM: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

See also:
CompactClassificationGAM,
ClassificationGAM,
CompactClassificationGAM.margin,
CompactClassificationGAM.loss,
CompactClassificationGAM.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: 1429
CompactClassificationGAM: L = loss (obj, X, Y)
CompactClassificationGAM: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationGAM: L = loss (obj, Tbl)
CompactClassificationGAM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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'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,
CompactClassificationGAM.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: 990
CompactClassificationGAM: m = margin (obj, X, Y)
CompactClassificationGAM: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationGAM: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

See also:
CompactClassificationGAM,
ClassificationGAM,
CompactClassificationGAM.edge,
CompactClassificationGAM.loss,
CompactClassificationGAM.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: 1704
CompactClassificationGAM: label = predict (obj, XC)
CompactClassificationGAM: [label, score] = predict (obj, XC)
CompactClassificationGAM: [label, score] = predict (..., '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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level
was coded at fitting.

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: 505
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'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: 574
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: 253
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: 188
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: 209
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: 285
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: 177
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: 214
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: 229
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: 207
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: 198
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: 185
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: 167
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: 165
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: 155
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: 185
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: 215
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: 199
CompactClassificationNaiveBayes: property Support
Kernel smoothing supports

A cell array giving the support of each kernel predictor'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: 225
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: 607
CompactClassificationNaiveBayes: e = edge (obj, X, Y)
CompactClassificationNaiveBayes: e = edge (..., 'Weights', w)
CompactClassificationNaiveBayes: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationNaiveBayes: e = edge (obj, Tbl)
Classification edge on new data.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 681
CompactClassificationNaiveBayes: 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.

X may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.


# 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: 692
CompactClassificationNaiveBayes: l = loss (obj, X, Y)
CompactClassificationNaiveBayes: l = loss (obj, Tbl, ResponseVarName)
CompactClassificationNaiveBayes: l = loss (obj, Tbl)
CompactClassificationNaiveBayes: l = loss (..., name, value)
Classification loss on new data.

Takes the 'LossFun' and 'Weights' options that
ClassificationNaiveBayes.loss takes.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 558
CompactClassificationNaiveBayes: m = margin (obj, X, Y)
CompactClassificationNaiveBayes: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationNaiveBayes: m = margin (obj, Tbl)
Classification margin on new data.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 645
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 513
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'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: 757
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: 388
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: 235
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: 359
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: 486
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: 754
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: 310
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: 246
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: 486
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: 275
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: 227
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: 237
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: 306
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: 273
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: 257
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: 176
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: 999
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 x 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 x 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: 258
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: 1032
CompactClassificationNeuralNetwork: e = edge (obj, X, Y)
CompactClassificationNeuralNetwork: e = edge (..., "Weights", w)
CompactClassificationNeuralNetwork: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationNeuralNetwork: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1690
CompactClassificationNeuralNetwork: L = loss (obj, X, Y)
CompactClassificationNeuralNetwork: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationNeuralNetwork: L = loss (obj, Tbl)
CompactClassificationNeuralNetwork: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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'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'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: 1077
CompactClassificationNeuralNetwork: m = margin (obj, X, Y)
CompactClassificationNeuralNetwork: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationNeuralNetwork: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1526
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 519
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'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: 704
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: 352
CompactClassificationSVM: property Alpha
Trained classifier coefficients

The coefficients of the trained SVM classifier specified as an sx1
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: 324
CompactClassificationSVM: property Beta
Linear predictor coefficients

The linear predictor coefficients specified as an sx1 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: 115
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: 235
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: 349
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: 426
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: 200
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: 268
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: 313
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: 256
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: 216
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: 263
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: 195
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: 166
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: 989
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 x 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 x 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: 290
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: 489
CompactClassificationSVM: property SupportVectorLabels
Support vector class labels

The support vector class labels specified as an sx1 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: 312
CompactClassificationSVM: property SupportVectors
Support vectors

The support vectors of the trained SVM classifier specified an sxp
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: 625
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: 1033
CompactClassificationSVM: e = edge (obj, X, Y)
CompactClassificationSVM: e = edge (..., "Weights", w)
CompactClassificationSVM: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationSVM: e = edge (obj, Tbl)
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 (..., "Weights", w) takes the
weighted mean instead, with one weight per row of X.
X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 2192
CompactClassificationSVM: L = loss (obj, X, Y)
CompactClassificationSVM: L = loss (obj, Tbl, ResponseVarName)
CompactClassificationSVM: L = loss (obj, Tbl)
CompactClassificationSVM: L = loss (..., 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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 matrix or cell matrix containing the class labels
of corresponding predictor data in X. Y must have same
numbers of Rows as X.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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:
'binodeviance', 'classifcost', 'classiferror', 'exponential',
'hinge', 'logit','mincost', 'quadratic'.

C is a logical matrix of size NxK, 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 NxK, 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 KxK 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: 1236
CompactClassificationSVM: m = margin (obj, X, Y)
CompactClassificationSVM: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationSVM: m = margin (obj, Tbl)
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 NxP numeric matrix of input data where rows
correspond to observations and columns correspond to features or
variables.

Y is Nx1 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1958
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 MxP 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 496
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'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: 709
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: 229
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: 278
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: 207
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: 257
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: 173
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: 294
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'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: 265
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: 624
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'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: 264
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: 316
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: 270
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: 219
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: 302
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: 316
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: 196
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: 360
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'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: 340
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'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: 294
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: 492
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: 338
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's size is not in general the
sum of its children'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: 302
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: 164
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: 177
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: 662
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'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: 372
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: 444
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: 147
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: 233
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: 185
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: 184
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: 180
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: 184
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: 174
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: 216
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: 954
CompactClassificationTree: e = edge (obj, X, Y)
CompactClassificationTree: e = edge (..., 'Weights', w)
CompactClassificationTree: e = edge (obj, Tbl, ResponseVarName)
CompactClassificationTree: e = edge (obj, Tbl)
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's prior
before they are applied.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
edge (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
edge (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1068
CompactClassificationTree: l = loss (obj, X, Y)
CompactClassificationTree: l = loss (obj, Tbl, ResponseVarName)
CompactClassificationTree: l = loss (obj, Tbl)
CompactClassificationTree: l = loss (..., name, value)
Classification loss on new data.

l = loss (obj, X, Y) returns the
minimum expected misclassification cost.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 964
CompactClassificationTree: m = margin (obj, X, Y)
CompactClassificationTree: m = margin (obj, Tbl, ResponseVarName)
CompactClassificationTree: m = margin (obj, Tbl)
Classification margin on new data.

m = margin (obj, X, Y) returns one
margin per observation: the score the model gives the observation'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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 499
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: 1476
CompactClassificationTree: label = predict (obj, XC)
CompactClassificationTree: [label, score] = predict (...)
CompactClassificationTree: [label, score, node] = predict (...)
CompactClassificationTree: [label, score, node, cnum] = predict (...)
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.

XC may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

[label, score] = predict (...) also returns
score, an NxK matrix holding the class probabilities of
the node each row landed in, after ScoreTransform.

[label, score, node] = predict (...) also
returns the number of the node each row landed in, and
[label, score, node, cnum] = predict
(...) 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: 685
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: 496
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'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: 408
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'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: 512
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: 189
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: 291
CompactRegressionEnsemble: property CombineWeights
How the trees are combined

'WeightedSum' for LSBoost, whose prediction is the sum of each
tree's prediction times its weight, or 'WeightedAverage' for
Bag, whose prediction is the weighted average of its trees'. 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: 253
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: 164
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: 99
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: 138
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: 107
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: 204
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: 140
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: 143
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: 171
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: 1505
CompactRegressionEnsemble: L = loss (obj, X, Y)
CompactRegressionEnsemble: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionEnsemble: L = loss (obj, Tbl)
CompactRegressionEnsemble: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 995
CompactRegressionEnsemble: yfit = predict (obj, X)
CompactRegressionEnsemble: yfit = predict (..., 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's prediction times its weight for LSBoost, or the weighted
average of the trees' 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 462
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'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: 237
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: 1108
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'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: 307
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: 139
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: 221
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: 402
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: 296
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: 128
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: 227
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: 559
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: 599
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: 190
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: 284
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: 227
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: 161
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: 196
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: 211
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: 146
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: 315
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: 152
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: 1119
CompactRegressionGAM: L = loss (obj, X, Y)
CompactRegressionGAM: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionGAM: L = loss (obj, Tbl)
CompactRegressionGAM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 2261
CompactRegressionGAM: yFit = predict (obj, Xfit)
CompactRegressionGAM: yFit = predict (..., Name, Value)
CompactRegressionGAM: [yFit, ySD, yInt] = predict (...)
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 (..., 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level
was coded at fitting.

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: 430
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: 1036
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: 121
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: 122
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: 205
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: 158
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: 141
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: 158
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: 159
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: 279
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: 150
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: 126
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: 146
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: 188
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: 113
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: 145
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: 133
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: 155
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: 114
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: 203
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: 118
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: 757
CompactRegressionGP: L = loss (obj, X, Y)
CompactRegressionGP: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionGP: L = loss (obj, Tbl)
CompactRegressionGP: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.


# 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: 788
CompactRegressionGP: yFit = predict (obj, XC)
CompactRegressionGP: [yFit, ySD, yInt] = predict (obj, XC)
CompactRegressionGP: [...] = predict (..., '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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 191
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: 874
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: 213
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: 189
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: 462
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: 178
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: 174
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: 180
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: 176
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: 217
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: 131
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: 228
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: 143
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: 132
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: 270
CompactRegressionNeuralNetwork: property ResponseTransform
Transformation applied to the predicted response

A function handle, applied by predict to the network'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: 234
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: 1408
CompactRegressionNeuralNetwork: L = loss (obj, X, Y)
CompactRegressionNeuralNetwork: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionNeuralNetwork: L = loss (obj, Tbl)
CompactRegressionNeuralNetwork: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 819
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 341
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: 851
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: 218
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: 214
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: 179
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: 179
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: 402
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: 240
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: 168
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: 309
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: 207
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: 121
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: 133
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: 122
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: 258
CompactRegressionSVM: property ResponseTransform
Transformation applied to the predicted response

A function handle, applied by predict to the model'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: 224
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: 194
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: 592
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: 1364
CompactRegressionSVM: L = loss (obj, X, Y)
CompactRegressionSVM: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionSVM: L = loss (obj, Tbl)
CompactRegressionSVM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 779
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 311
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: 682
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: 225
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: 274
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: 203
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: 245
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: 260
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: 312
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: 266
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: 215
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: 298
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: 312
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: 192
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: 213
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'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: 272
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: 256
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: 261
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: 334
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's size is not in general the
sum of its children'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: 298
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: 160
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: 173
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: 368
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: 440
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: 143
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: 290
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: 181
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: 180
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: 176
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: 180
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: 170
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: 212
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: 1175
CompactRegressionTree: L = loss (obj, X, Y)
CompactRegressionTree: L = loss (obj, Tbl, ResponseVarName)
CompactRegressionTree: L = loss (obj, Tbl)
CompactRegressionTree: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 491
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: 966
CompactRegressionTree: yFit = predict (obj, XC)
CompactRegressionTree: [yFit, node] = predict (...)
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.

XC may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

[yFit, node] = predict (...) 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: 701
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: 472
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'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: 400
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'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: 546
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: 39
CompactTreeBagger.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 221
CompactTreeBagger: 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: 28
CompactTreeBagger.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 250
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: 231
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: 390
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: 237
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'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: 118
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: 288
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'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: 141
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: 171
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: 248
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: 188
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: 309
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: 1732
CompactTreeBagger: err = error (obj, X, Y)
CompactTreeBagger: err = error (..., name, value)
CompactTreeBagger: err = error (obj, Tbl, ResponseVarName)
CompactTreeBagger: err = error (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
error (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
error (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1118
CompactTreeBagger: m = margin (obj, X, Y)
CompactTreeBagger: m = margin (..., name, value)
CompactTreeBagger: m = margin (obj, Tbl, ResponseVarName)
CompactTreeBagger: m = margin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1450
CompactTreeBagger: [S, E] = mdsprox (obj, X)
CompactTreeBagger: [S, E] = mdsprox (..., 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.

X holding predictor data may also be a table, whose variables
are matched to the predictors the model was fitted on by name and not
by position: one the model was not fitted on is passed over, one it
needs and cannot find is named, and a value holding a level is coded as
that level was coded at fitting.

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: 873
CompactTreeBagger: mm = meanMargin (obj, X, Y)
CompactTreeBagger: mm = meanMargin (..., name, value)
CompactTreeBagger: mm = meanMargin (obj, Tbl, ResponseVarName)
CompactTreeBagger: mm = meanMargin (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
meanMargin (obj, Tbl, ResponseVarName)
takes the response from the variable ResponseVarName names, and
meanMargin (obj, Tbl) from the variable the model
was fitted on. The response may also be given beside the table as
Y.

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: 1434
CompactTreeBagger: out = outlierMeasure (obj, X)
CompactTreeBagger: out = outlierMeasure (..., 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.

X holding predictor data may also be a table, whose variables
are matched to the predictors the model was fitted on by name and not
by position: one the model was not fitted on is passed over, one it
needs and cannot find is named, and a value holding a level is coded as
that level was coded at fitting.

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: 1967
CompactTreeBagger: label = predict (obj, X)
CompactTreeBagger: [label, scores] = predict (...)
CompactTreeBagger: [label, scores, stdevs] = predict (...)
CompactTreeBagger: [Yfit, stdevs] = predict (...)
CompactTreeBagger: ... = predict (..., 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' 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 663
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.

X may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

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: 477
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: 15
PredictiveModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 886
statistics: PredictiveModel
A fitted model that answers for new observations.

PredictiveModel is the superclass of every classification and
regression model in this package that carries a predict method,
and of nothing else. The models fitted by fitlm and its
relatives derive from it as the learners do. The cross-validated
classes answer through kfoldPredict over their folds rather than
through predict, and so do not derive from it.

The class is abstract and cannot be instantiated. It is where
behaviour shared by all those models is written once rather than once
per class, and isa (obj, 'PredictiveModel') is how
to ask whether an object is a model that can be told to predict. The
only data it holds is the levels a predictor read from a table was
coded through, which every model needs to read a table again at
prediction and which MATLAB carries by keeping the table itself.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
A fitted model that answers for new observations.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
PredictiveModel.partialDependence


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 597
PredictiveModel: pd = partialDependence (obj, Vars)
PredictiveModel: pd = partialDependence (obj, Vars, Labels)
PredictiveModel: pd = partialDependence (..., Data)
PredictiveModel: pd = partialDependence (..., name, value)
PredictiveModel: [pd, x, y] = partialDependence (...)
Compute partial dependence.

partialDependence (obj, Vars) is the same call as
partialDependence the function, written on the model instead of
before it, and takes and returns exactly what it does. See
partialDependence for the arguments and for what pd,
x and y hold.

See also:
partialDependence,
plotPartialDependence


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Compute partial dependence.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
RegressionBaggedEnsemble


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 740
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: 139
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: 182
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: 153
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: 157
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: 215
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: 207
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: 99
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: 188
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: 114
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: 100
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: 238
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: 101
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: 92
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: 131
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: 111
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: 335
RegressionBaggedEnsemble: obj = RegressionBaggedEnsemble (X, Y)
RegressionBaggedEnsemble: obj = RegressionBaggedEnsemble (..., 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: 218
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: 146
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: 100
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: 140
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: 142
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: 133
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: 136
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: 195
RegressionBaggedEnsemble: property UseObsForLearner
Which observations each tree drew

An NxNumTrained logical matrix, true where a tree'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: 164
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: 183
RegressionEnsemble: property W
Observation weights

The weights given, normalized to sum to one. It has the class of the
'Weights' given, single or double. 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: 335
RegressionEnsemble: property X
Predictor data

The predictors the ensemble was fitted on, one row per observation.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 158
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: 241
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: 295
RegressionBaggedEnsemble: CVMdl = crossval (obj)
RegressionBaggedEnsemble: CVMdl = crossval (..., 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: 285
RegressionBaggedEnsemble: [vals, nlearn] = cvshrink (obj)
RegressionBaggedEnsemble: [vals, nlearn] = cvshrink (..., 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: 696
RegressionBaggedEnsemble: L = loss (obj, X, Y)
RegressionBaggedEnsemble: L = loss (obj, Tbl, ResponseVarName)
RegressionBaggedEnsemble: L = loss (obj, Tbl)
RegressionBaggedEnsemble: L = loss (..., name, value)
Regression loss of a bagged ensemble.

Behaves as CompactRegressionEnsemble.loss.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 436
RegressionBaggedEnsemble: L = oobLoss (obj)
RegressionBaggedEnsemble: L = oobLoss (..., 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: 644
RegressionBaggedEnsemble: imp = oobPermutedPredictorImportance (obj)
RegressionBaggedEnsemble: imp = oobPermutedPredictorImportance (..., 'Learners', 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'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: 463
RegressionBaggedEnsemble: yfit = oobPredict (obj)
RegressionBaggedEnsemble: yfit = oobPredict (..., 'Learners', 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: 283
RegressionBaggedEnsemble: yfit = predict (obj, X)
RegressionBaggedEnsemble: yfit = predict (..., 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: 380
RegressionBaggedEnsemble: imp = predictorImportance (obj)
RegressionBaggedEnsemble: [imp, ma] = predictorImportance (obj)
Estimate the importance of each predictor.

The mean over the trees of each tree'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: 271
RegressionBaggedEnsemble: B = regularize (obj)
RegressionBaggedEnsemble: B = regularize (..., 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: 271
RegressionBaggedEnsemble: L = resubLoss (obj)
RegressionBaggedEnsemble: L = resubLoss (..., 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: 296
RegressionBaggedEnsemble: yfit = resubPredict (obj)
RegressionBaggedEnsemble: yfit = resubPredict (..., 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: 318
RegressionBaggedEnsemble: B = resume (obj, NumLearningCycles)
RegressionBaggedEnsemble: B = resume (..., 'NPrint', n)
Grow more trees in a bagged regression ensemble.

Behaves as RegressionEnsemble.resume, the new trees' 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: 304
RegressionBaggedEnsemble: C = shrink (obj)
RegressionBaggedEnsemble: C = shrink (..., 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: 473
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: 139
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: 182
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: 153
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: 157
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: 207
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: 99
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: 188
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: 114
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: 100
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: 238
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: 101
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: 92
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: 131
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: 111
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: 534
RegressionEnsemble: obj = RegressionEnsemble (X, Y)
RegressionEnsemble: obj = RegressionEnsemble (Tbl, ResponseVarName)
RegressionEnsemble: obj = RegressionEnsemble (Tbl, formula)
RegressionEnsemble: obj = RegressionEnsemble (Tbl, Y)
RegressionEnsemble: obj = RegressionEnsemble (..., 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: 218
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: 100
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: 140
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: 142
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: 133
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: 136
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: 164
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: 183
RegressionEnsemble: property W
Observation weights

The weights given, normalized to sum to one. It has the class of the
'Weights' given, single or double. 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: 335
RegressionEnsemble: property X
Predictor data

The predictors the ensemble was fitted on, one row per observation.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 158
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: 285
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: 533
RegressionEnsemble: CVMdl = crossval (obj)
RegressionEnsemble: CVMdl = crossval (..., 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: 1225
RegressionEnsemble: [vals, nlearn] = cvshrink (obj)
RegressionEnsemble: [vals, nlearn] = cvshrink (..., 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'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: 700
RegressionEnsemble: L = loss (obj, X, Y)
RegressionEnsemble: L = loss (obj, Tbl, ResponseVarName)
RegressionEnsemble: L = loss (obj, Tbl)
RegressionEnsemble: L = loss (..., name, value)
Regression loss of an ensemble.

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

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 587
RegressionEnsemble: yfit = predict (obj, X)
RegressionEnsemble: yfit = predict (..., name, value)
Predict the response with a regression ensemble.

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

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 288
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: 1696
RegressionEnsemble: B = regularize (obj)
RegressionEnsemble: B = regularize (..., name, value)
Find lasso weights for the trees of a regression ensemble.

B = regularize (obj) fits the training response by
the trees' 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'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: 245
RegressionEnsemble: L = resubLoss (obj)
RegressionEnsemble: L = resubLoss (..., 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: 258
RegressionEnsemble: yfit = resubPredict (obj)
RegressionEnsemble: yfit = resubPredict (..., 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: 451
RegressionEnsemble: B = resume (obj, NumLearningCycles)
RegressionEnsemble: B = resume (..., 'NPrint', 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: 968
RegressionEnsemble: C = shrink (obj)
RegressionEnsemble: C = shrink (..., 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: 872
statistics: RegressionGAM
Generalized additive model for regression.

A RegressionGAM object holds a generalized additive model fitted to
a continuous response, and predicts the response for new data with the
predict method. The model is a sum of one shape function per
predictor, and optionally one per pair of predictors, each learned from the
data rather than assumed.

Two engines fit it. 'boostedtrees', the default, boosts shallow
decision trees one predictor at a time; 'splines' boosts smoothing
splines. The properties describing the engine that was not used are empty.

The object keeps its training data, which resubPredict,
resubLoss and crossval work on; compact drops it and
returns a CompactRegressionGAM, which still predicts.

Create a RegressionGAM object with fitrgam or the class
constructor.

See also:
fitrgam,
CompactRegressionGAM,
ClassificationGAM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
Generalized additive model for regression.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
RegressionGAM.BaseModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 300
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: 458
RegressionGAM: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 214
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: 190
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: 289
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: 498
RegressionGAM: property FitMethod
Which engine fitted the model

A character vector, either 'boostedtrees' or
'splines'. The default is 'boostedtrees', the scheme
MATLAB'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: 220
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: 355
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: 552
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: 592
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: 183
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: 277
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: 199
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: 351
RegressionGAM: property ModelParameters
Parameters the model was fitted with

A structure holding the fitting parameters. Under the boosted-tree
engine it carries MATLAB'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: 220
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: 223
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: 154
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: 187
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: 476
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'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: 204
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: 336
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: 6217
RegressionGAM: obj = RegressionGAM (X, Y)
RegressionGAM: obj = RegressionGAM (Tbl, ResponseVarName)
RegressionGAM: obj = RegressionGAM (Tbl, formula)
RegressionGAM: obj = RegressionGAM (Tbl, Y)
RegressionGAM: obj = RegressionGAM (..., name, value)
Fit a generalized additive model for regression.

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 NxP 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 Nx1 numeric vector containing the response data
corresponding to the predictor data in X. Y must have same
number of rows as X.

obj = RegressionGAM (..., 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'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'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'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: 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: 139
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: 308
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: 375
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: 200
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: 416
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: 279
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. It has the class of the 'Weights' given, single or
double. 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: 358
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 145
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: 1053
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'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's own: they are
taken in the order nchoosek lists the pairs, where MATLAB ranks
them by how much each contributes. The constructor'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: 245
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: 992
RegressionGAM: CVMdl = crossval (obj)
RegressionGAM: CVMdl = crossval (..., 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 'on' or 'off'.
'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: 1062
RegressionGAM: L = loss (obj, X, Y)
RegressionGAM: L = loss (obj, Tbl, ResponseVarName)
RegressionGAM: L = loss (obj, Tbl)
RegressionGAM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 2233
RegressionGAM: yFit = predict (obj, Xfit)
RegressionGAM: yFit = predict (..., Name, Value)
RegressionGAM: [yFit, ySD, yInt] = predict (...)
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 (..., 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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level
was coded at fitting.

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: 356
RegressionGAM: L = resubLoss (obj)
RegressionGAM: L = resubLoss (..., 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: 251
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: 937
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: 203
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: 838
statistics: RegressionGP
Gaussian process regression model.

A RegressionGP object holds a Gaussian process fitted to a
continuous response, and predicts the response for new data with the
predict method, which also returns the standard deviation of each
prediction and a prediction interval. The response is modelled as an
explicit basis times Beta, plus a draw from a process whose
covariance is given by the kernel function, plus independent noise of
standard deviation Sigma. The kernel parameters and Sigma
are estimated by maximizing the log marginal likelihood.

The object keeps its training data, which resubPredict,
resubLoss and crossval work on; compact drops it and
returns a CompactRegressionGP, which still predicts.

Create a RegressionGP object with fitrgp or the class
constructor.

See also:
fitrgp,
CompactRegressionGP


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
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: 392
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: 114
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: 115
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: 280
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: 230
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: 271
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: 182
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: 183
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: 301
RegressionGP: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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: 226
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: 253
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: 267
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: 354
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: 170
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: 191
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: 242
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: 170
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: 1110
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: 272
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: 106
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: 198
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: 147
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: 208
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: 5914
RegressionGP: obj = RegressionGP (X, Y)
RegressionGP: obj = RegressionGP (Tbl, ResponseVarName)
RegressionGP: obj = RegressionGP (Tbl, formula)
RegressionGP: obj = RegressionGP (Tbl, Y)
RegressionGP: obj = RegressionGP (..., name, value)
Fit 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 HxBeta 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 (..., 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. A predictor may be named rather than
indexed, as a character matrix of one padded name per row, a string array
or a cellstr; a name must match an entry of 'PredictorNames'
exactly, its case included.
'Weights' An Nx1 single or double vector of
non-negative observation weights. The default is a vector of ones. The
model's W keeps the class of the weights, while every computation
runs in double.
'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; ...; SigmaF]
'ardsquaredexponential' [LengthScale1; ...; SigmaF]
'ardmatern32' [LengthScale1; ...; SigmaF]
'ardmatern52' [LengthScale1; ...; SigmaF]
'ardrationalquadratic' [LengthScale1; ...; 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: 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: 107
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: 196
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: 281
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: 111
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: 220
RegressionGP: property W
Observation weights

An Nx1 vector, one weight per observation used to train the
model, scaled to sum to one and of the class of the 'Weights'
given, single or double. 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: 323
RegressionGP: property X
Predictor data

An NxP numeric matrix, as it was supplied to the constructor.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 129
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: 277
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: 373
RegressionGP: CVMdl = crossval (obj)
RegressionGP: CVMdl = crossval (..., 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 (..., 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: 866
RegressionGP: L = loss (obj, X, Y)
RegressionGP: L = loss (obj, Tbl, ResponseVarName)
RegressionGP: L = loss (obj, Tbl)
RegressionGP: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 559
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: 1186
RegressionGP: yFit = predict (obj, XC)
RegressionGP: [yFit, ySD, yInt] = predict (obj, XC)
RegressionGP: [...] = predict (..., '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 (...) 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.

[...] = predict (..., 'Alpha', alpha) sets
the significance level of the intervals, so that they are
100 x (1 - alpha) per cent intervals. alpha must be
a scalar in the range [0, 1] and defaults to 0.05.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 274
RegressionGP: L = resubLoss (obj)
RegressionGP: L = resubLoss (..., 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: 321
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: 176
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: 1286
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: 305
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: 186
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: 361
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: 319
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: 183
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: 224
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: 187
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: 137
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: 232
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: 197
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: 338
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: 211
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: 2810
RegressionKernel: obj = RegressionKernel (X, Y)
RegressionKernel: obj = RegressionKernel (Tbl, ResponseVarName)
RegressionKernel: obj = RegressionKernel (Tbl, formula)
RegressionKernel: obj = RegressionKernel (Tbl, Y)
RegressionKernel: obj = RegressionKernel (..., 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 (..., 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'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, as a
single or double vector. Every computation runs in double.
'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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.

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: 207
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: 128
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: 200
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: 214
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: 816
RegressionKernel: l = loss (obj, X, Y)
RegressionKernel: l = loss (obj, Tbl, ResponseVarName)
RegressionKernel: l = loss (obj, Tbl)
RegressionKernel: l = loss (..., name, value)
Regression loss on new data.

l = loss (obj, X, Y) returns the mean
squared error.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 524
RegressionKernel: yFit = predict (obj, XC)
Predict the response of new observations.

yFit = predict (obj, XC) maps each row of
XC through the model's own random basis and returns the
predicted response, with ResponseTransform applied.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 1184
RegressionKernel: obj = resume (obj, X, Y)
RegressionKernel: obj = resume (..., name, value)
RegressionKernel: obj = resume (obj, Tbl, ResponseVarName)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
The response is then named by ResponseVarName, a variable of the
table, or given beside the table as Y; unlike
RegressionKernel.loss, it is never taken from the table
unasked.


# 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: 208
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: 1077
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: 194
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: 223
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: 186
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: 361
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: 252
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: 277
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: 234
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: 135
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: 263
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: 211
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: 3987
RegressionLinear: obj = RegressionLinear (X, Y)
RegressionLinear: obj = RegressionLinear (Tbl, ResponseVarName)
RegressionLinear: obj = RegressionLinear (Tbl, formula)
RegressionLinear: obj = RegressionLinear (Tbl, Y)
RegressionLinear: obj = RegressionLinear (..., 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 (..., 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'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, as a
single or double vector. Every computation runs in double.
'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.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.

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: 128
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: 128
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: 200
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: 855
RegressionLinear: l = loss (obj, X, Y)
RegressionLinear: l = loss (obj, Tbl, ResponseVarName)
RegressionLinear: l = loss (obj, Tbl)
RegressionLinear: l = loss (..., name, value)
Regression loss on new data.

l = loss (obj, X, Y) returns the mean
squared error, one value per regularization strength.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

l = loss (..., 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: 530
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.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.


# 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: 181
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: 248
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: 795
statistics: RegressionNeuralNetwork
Neural network regression model.

A RegressionNeuralNetwork object holds a fully connected
feedforward neural network fitted to a continuous response, and predicts
the response for new data with the predict method. The network is
trained against the mean squared error and its output layer applies the
identity, so a prediction is an unrestricted real number; otherwise the
engine is the one ClassificationNeuralNetwork uses.

The object keeps its training data, which resubPredict,
resubLoss and crossval work on; compact drops it and
returns a CompactRegressionNeuralNetwork, which still predicts.

Create a RegressionNeuralNetwork object with fitrnet or the
class constructor.

See also:
fitrnet,
CompactRegressionNeuralNetwork,
ClassificationNeuralNetwork


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
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: 238
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: 358
RegressionNeuralNetwork: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 234
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: 572
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: 130
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: 267
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: 365
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: 142
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: 230
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: 251
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: 257
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: 217
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: 1143
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'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'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: 210
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: 220
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: 152
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: 235
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: 157
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: 5262
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (X, Y)
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (Tbl, ResponseVarName)
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (Tbl, formula)
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (Tbl, Y)
RegressionNeuralNetwork: obj = RegressionNeuralNetwork (..., name, value)
Fit 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 (..., 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. A predictor may be named rather than indexed, as
a character matrix of one padded name per row, a string array or a
cellstr; a name must match an entry of 'PredictorNames' exactly,
its case included.
'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'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'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: 38
Fit 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: 125
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: 309
RegressionNeuralNetwork: property ResponseTransform
Transformation applied to the predicted response

A function handle, applied by predict and resubPredict to
the network'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: 395
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: 227
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: 209
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: 411
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'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: 332
RegressionNeuralNetwork: property W
Observation weights

A numeric column vector with one entry per training observation,
summing to one, by which the training loss weighs each observation. It
defaults to a uniform weight for every observation, and has the class of
the 'Weights' given, single or double. 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: 387
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 140
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: 380
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: 887
RegressionNeuralNetwork: CVMdl = crossval (obj)
RegressionNeuralNetwork: CVMdl = crossval (..., 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 (..., 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: 1408
RegressionNeuralNetwork: L = loss (obj, X, Y)
RegressionNeuralNetwork: L = loss (obj, Tbl, ResponseVarName)
RegressionNeuralNetwork: L = loss (obj, Tbl)
RegressionNeuralNetwork: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 850
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's output before it is returned.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 420
RegressionNeuralNetwork: L = resubLoss (obj)
RegressionNeuralNetwork: L = resubLoss (..., 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: 411
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: 321
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: 547
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: 119
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: 138
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: 147
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: 90
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: 297
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: 107
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: 129
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: 134
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: 107
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: 265
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: 111
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: 257
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: 215
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: 175
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: 197
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: 277
RegressionPartitionedEnsemble: property X
Predictor data

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 84
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: 762
RegressionPartitionedEnsemble: L = kfoldLoss (obj)
RegressionPartitionedEnsemble: L = kfoldLoss (..., 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: 355
RegressionPartitionedEnsemble: yfit = kfoldPredict (obj)
Predict each observation with the fold that held it out.

yfit holds each observation'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: 328
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'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: 331
RegressionPartitionedEnsemble: CVMdl = resume (obj, NumLearningCycles)
RegressionPartitionedEnsemble: CVMdl = resume (..., 'NPrint', n)
Grow more trees in every fold.

Each fold'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: 1020
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: 197
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: 174
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: 217
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: 1131
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'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'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: 216
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: 150
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: 140
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: 942
RegressionPartitionedKernel: obj = RegressionPartitionedKernel (X, Y)
RegressionPartitionedKernel: obj = RegressionPartitionedKernel (..., 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 (..., 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'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: 139
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: 331
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: 207
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: 126
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: 129
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: 433
RegressionPartitionedKernel: l = kfoldLoss (obj)
RegressionPartitionedKernel: l = kfoldLoss (..., name, value)
Out-of-fold regression loss.

l = kfoldLoss (obj) returns the out-of-fold mean
squared error.

l = kfoldLoss (..., 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: 302
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: 881
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: 197
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: 174
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: 217
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: 1131
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'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'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: 216
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: 150
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: 140
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: 926
RegressionPartitionedLinear: obj = RegressionPartitionedLinear (X, Y)
RegressionPartitionedLinear: obj = RegressionPartitionedLinear (..., 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 (..., 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'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: 139
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: 331
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: 207
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: 126
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: 129
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: 433
RegressionPartitionedLinear: l = kfoldLoss (obj)
RegressionPartitionedLinear: l = kfoldLoss (..., name, value)
Out-of-fold regression loss.

l = kfoldLoss (obj) returns the out-of-fold mean
squared error.

l = kfoldLoss (..., 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: 369
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: 571
statistics: RegressionPartitionedModel
Cross-validated regression model.

A RegressionPartitionedModel object holds a regression model cross
validated over a partition of its training data: one compact model per
fold, in Trained, each fitted without the observations that fold
tests on. kfoldPredict, kfoldLoss and kfoldfun answer
for every observation with a model that never saw it.

Create a RegressionPartitionedModel object with the crossval
method of a regression model or with the class constructor.

See also:
crossval,
cvpartition,
ClassificationPartitionedModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Cross-validated regression model.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 528
RegressionPartitionedModel: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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: 185
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: 354
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: 815
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's
subclass shows it, because that subclass also moves
ResponseTransform to the end and no single order can match both
of MATLAB'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: 114
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: 1091
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'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'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: 131
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: 721
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: 131
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: 139
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: 1009
RegressionPartitionedModel: obj = RegressionPartitionedModel (Mdl, Partition)
Cross-validate a regression model 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 RegressionGP, a
RegressionNeuralNetwork, a RegressionSVM or a
RegressionTree 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,
RegressionGP,
RegressionNeuralNetwork,
RegressionSVM,
RegressionTree


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Cross-validate a regression model over a partition of its training data.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 128
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: 205
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: 218
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: 143
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: 392
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 134
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: 1042
RegressionPartitionedModel: L = kfoldLoss (obj)
RegressionPartitionedModel: L = kfoldLoss (..., 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 (..., 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: 1405
RegressionPartitionedModel: yFit = kfoldPredict (obj)
RegressionPartitionedModel: [yFit, ySD, yInt] = kfoldPredict (obj)
RegressionPartitionedModel: [...] = kfoldPredict (..., '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'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.

[...] = kfoldPredict (..., '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: 797
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 KxM 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, 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: 760
statistics: RegressionSVM
Support vector machine regression model.

A RegressionSVM object holds a support vector machine fitted to a
continuous response by epsilon-insensitive regression, and predicts
the response for new data with the predict method. Errors smaller
than Epsilon cost nothing, so only the observations outside that
tube become support vectors, and a prediction is a weighted sum of kernel
evaluations against them. The fit is carried out by LIBSVM.

The object keeps its training data, which resubPredict,
resubLoss and crossval work on; compact drops it and
returns a CompactRegressionSVM, which still predicts.

Create a RegressionSVM object with fitrsvm or the class
constructor.

See also:
fitrsvm,
CompactRegressionSVM,
ClassificationSVM


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
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: 411
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'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: 273
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: 172
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: 348
RegressionSVM: property BinEdges
Bin edges of the predictors

A cell array with one entry per predictor, holding that predictor'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'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: 385
RegressionSVM: property BoxConstraints
Box constraints

A numeric column vector with one entry per observation, holding the box
constraint the fit applied to it: n times BoxConstraint
times the observation's weight in W, which is
BoxConstraint for every observation when no weights were given.
An observation missing a predictor is not fitted and holds NaN.
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: 172
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: 225
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: 161
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: 355
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: 181
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: 365
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: 727
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'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: 200
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: 210
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: 114
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: 126
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: 4333
RegressionSVM: obj = RegressionSVM (X, Y)
RegressionSVM: obj = RegressionSVM (Tbl, ResponseVarName)
RegressionSVM: obj = RegressionSVM (Tbl, formula)
RegressionSVM: obj = RegressionSVM (Tbl, Y)
RegressionSVM: obj = RegressionSVM (..., name, value)
Fit 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's standard deviation, which is what MATLAB uses.

obj = RegressionSVM (..., 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 weighted lower
median of the training response. A predictor may be named rather than
indexed, as a character matrix of one padded name per row, a string
array or a cellstr; a name must match an entry of
'PredictorNames' exactly, its case included.
'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.
'Weights' A nonnegative single or double vector of
observation weights, one per row of X. An observation's box
constraint is n times BoxConstraint times its weight, the
weights scaled to sum to one; standardization uses weighted means and
standard deviations, and a row of zero or missing weight is left out.
The model's W keeps the class of the weights, while every
computation runs in double. The default is uniform.
'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: 46
Fit 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: 115
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: 297
RegressionSVM: property ResponseTransform
Transformation applied to the predicted response

A function handle, applied by predict and resubPredict to
the model'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: 375
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: 217
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: 223
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: 246
RegressionSVM: property W
Observation weights

A numeric column vector with one entry per training observation,
normalized to sum to one, as MATLAB reports it. It has the class of the
'Weights' given, single or double. 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: 324
RegressionSVM: property X
Predictor data

An NxP numeric matrix, as it was supplied to the constructor.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.

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: 130
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: 353
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: 847
RegressionSVM: CVMdl = crossval (obj)
RegressionSVM: CVMdl = crossval (..., 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 (..., 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: 585
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: 1466
RegressionSVM: L = loss (obj, X, Y)
RegressionSVM: L = loss (obj, Tbl, ResponseVarName)
RegressionSVM: L = loss (obj, Tbl)
RegressionSVM: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 785
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's output before it is returned.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 388
RegressionSVM: L = resubLoss (obj)
RegressionSVM: L = resubLoss (..., 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: 329
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: 291
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: 1868
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'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'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: 263
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: 218
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: 267
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: 196
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: 253
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: 305
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: 259
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: 208
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: 291
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: 305
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: 201
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: 185
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: 603
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: 206
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'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: 265
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: 249
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: 254
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: 327
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's size is not in general the
sum of its children'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: 291
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: 269
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: 153
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: 166
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: 361
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: 433
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: 2941
RegressionTree: obj = RegressionTree (X, Y)
RegressionTree: obj = RegressionTree (Tbl, ResponseVarName)
RegressionTree: obj = RegressionTree (Tbl, formula)
RegressionTree: obj = RegressionTree (Tbl, Y)
RegressionTree: obj = RegressionTree (..., 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 (..., 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'.
A predictor may be named rather than indexed, as a character matrix of
one padded name per row, a string array or a cellstr; a name must match
an entry of 'PredictorNames' exactly, its case included.
'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'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 single or double vector with
one element per observation. The default is uniform. The model's
W keeps the class of the weights, while every computation runs in
double, so the predictions are double where MATLAB returns single.

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: 136
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: 283
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: 384
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: 174
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: 173
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: 169
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: 173
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: 163
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: 205
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: 267
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. It has
the class of the 'Weights' given, single or double. 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: 390
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 175
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: 360
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: 895
RegressionTree: CVMdl = crossval (obj)
RegressionTree: CVMdl = crossval (..., 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 (..., 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: 1873
RegressionTree: E = cvloss (obj)
RegressionTree: [E, SE, Nleaf, BestLevel] = cvloss (obj)
RegressionTree: [...] = cvloss (..., 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
(...) 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.

[...] = cvloss (..., 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's tree is pruned to the level its own sequence gives for the
geometric mean of the parent'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'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's
own weights.

The standard error is not MATLAB's. This is the standard
error of the loss over the folds, which is what the name means. Its
value is not MATLAB'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: 1133
RegressionTree: L = loss (obj, X, Y)
RegressionTree: L = loss (obj, Tbl, ResponseVarName)
RegressionTree: L = loss (obj, Tbl)
RegressionTree: L = loss (..., 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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
loss (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
loss (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

L = loss (..., 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: 477
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: 938
RegressionTree: yFit = predict (obj, XC)
RegressionTree: [yFit, node] = predict (...)
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.

XC may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

[yFit, node] = predict (...) 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: 680
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: 1099
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'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: 356
RegressionTree: L = resubLoss (obj)
RegressionTree: L = resubLoss (..., 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: 202
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: 451
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'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: 386
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'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: 808
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'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: 32
TreeBagger.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 214
TreeBagger: 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: 21
TreeBagger.ClassNames


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 270
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: 230
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: 273
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: 316
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'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: 343
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: 230
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'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: 198
TreeBagger: property InBagFraction
Size of each tree'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: 154
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: 111
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: 230
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: 281
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'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: 262
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: 131
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: 224
TreeBagger: property OOBIndices
Which observations each tree left out

An NxNumTrees logical matrix, true where an observation is not
in a tree'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: 202
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: 475
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'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: 598
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'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: 461
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'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: 394
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: 147
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: 277
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: 315
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: 185
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: 153
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: 241
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: 216
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: 3626
TreeBagger: B = TreeBagger (NumTrees, X, Y)
TreeBagger: B = TreeBagger (NumTrees, Tbl, ResponseVarName)
TreeBagger: B = TreeBagger (NumTrees, Tbl, formula)
TreeBagger: B = TreeBagger (NumTrees, Tbl, Y)
TreeBagger: B = TreeBagger (..., 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'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's out-of-bag observations. It turns
'OOBPrediction' on.
'Weights' A nonnegative single or double vector
with one weight per observation. The default is uniform. The model's
W keeps the class of the weights, while every computation runs in
double.
'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'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: 181
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: 356
TreeBagger: property W
Observation weights

A column of weights summing to one, one per observation. For
classification each class'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. It has the class of the 'Weights'
given, single or double. 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: 371
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.

Where the model was fitted from a table, the predictors are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the model.


# 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: 187
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: 453
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: 275
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: 718
TreeBagger: err = error (obj, X, Y)
TreeBagger: err = error (..., name, value)
TreeBagger: err = error (obj, Tbl, ResponseVarName)
TreeBagger: err = error (obj, Tbl)
Misclassification probability or mean squared error of the ensemble.

Behaves as CompactTreeBagger.error and takes the same Name-Value
arguments.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
error (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
error (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 593
TreeBagger: B = fillprox (obj)
TreeBagger: B = fillprox (..., 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: 448
TreeBagger: B = growTrees (obj, NumTrees)
TreeBagger: B = growTrees (..., 'NumPrint', 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: 693
TreeBagger: m = margin (obj, X, Y)
TreeBagger: m = margin (..., name, value)
TreeBagger: m = margin (obj, Tbl, ResponseVarName)
TreeBagger: m = margin (obj, Tbl)
Classification margin of each observation.

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

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
margin (obj, Tbl, ResponseVarName) takes the
response from the variable ResponseVarName names, and
margin (obj, Tbl) from the variable the model was
fitted on. The response may also be given beside the table as
Y.

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: 1052
TreeBagger: [S, E] = mdsprox (obj)
TreeBagger: [S, E] = mdsprox (..., 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: 727
TreeBagger: mm = meanMargin (obj, X, Y)
TreeBagger: mm = meanMargin (..., name, value)
TreeBagger: mm = meanMargin (obj, Tbl, ResponseVarName)
TreeBagger: mm = meanMargin (obj, Tbl)
Weighted mean classification margin.

Behaves as CompactTreeBagger.meanMargin and takes the same
Name-Value arguments.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
meanMargin (obj, Tbl, ResponseVarName)
takes the response from the variable ResponseVarName names, and
meanMargin (obj, Tbl) from the variable the model
was fitted on. The response may also be given beside the table as
Y.

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: 606
TreeBagger: err = oobError (obj)
TreeBagger: err = oobError (..., 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: 387
TreeBagger: m = oobMargin (obj)
TreeBagger: m = oobMargin (..., 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: 327
TreeBagger: mm = oobMeanMargin (obj)
TreeBagger: mm = oobMeanMargin (..., 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: 606
TreeBagger: label = oobPredict (obj)
TreeBagger: [label, scores, stdevs] = oobPredict (...)
TreeBagger: [Yfit, stdevs] = oobPredict (...)
TreeBagger: ... = oobPredict (..., 'Trees', 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: 754
TreeBagger: err = oobQuantileError (obj)
TreeBagger: err = oobQuantileError (..., 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: 627
TreeBagger: YFit = oobQuantilePredict (obj)
TreeBagger: [YFit, YW] = oobQuantilePredict (...)
TreeBagger: ... = oobQuantilePredict (..., 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: 751
TreeBagger: label = predict (obj, X)
TreeBagger: [label, scores] = predict (...)
TreeBagger: [label, scores, stdevs] = predict (...)
TreeBagger: [Yfit, stdevs] = predict (...)
TreeBagger: ... = predict (..., name, value)
Predict responses with a bagged ensemble.

Behaves as CompactTreeBagger.predict, and takes the same
'Trees', 'TreeWeights' and 'UseInstanceForTree'
Name-Value arguments.

The new data may be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position:
one the model was not fitted on is passed over, one it needs and
cannot find is named, and a value holding a level is coded as that
level was coded at fitting.

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: 1613
TreeBagger: err = quantileError (obj, X, Y)
TreeBagger: err = quantileError (..., name, value)
TreeBagger: err = quantileError (obj, Tbl, ResponseVarName)
TreeBagger: err = quantileError (obj, Tbl)
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.

X may also be a table Tbl, whose variables are matched to
the predictors the model was fitted on by name and not by position.
quantileError (obj, Tbl, ResponseVarName)
takes the response from the variable ResponseVarName names, and
quantileError (obj, Tbl) from the variable the model
was fitted on. The response may also be given beside the table as
Y.

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: 1970
TreeBagger: YFit = quantilePredict (obj, X)
TreeBagger: [YFit, YW] = quantilePredict (...)
TreeBagger: ... = quantilePredict (..., 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'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.

X may also be a table, whose variables are matched to the
predictors the model was fitted on by name and not by position: one
the model was not fitted on is passed over, one it needs and cannot
find is named, and a value holding a level is coded as that level was
coded at fitting.

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: 2008
statistics: M = designecoc (K, name)
statistics: M = designecoc (..., '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 (..., '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: 3716
statistics: Mdl = fitcdiscr (X, Y)
statistics: Mdl = fitcdiscr (Tbl, ResponseVarName)
statistics: Mdl = fitcdiscr (Tbl, formula)
statistics: Mdl = fitcdiscr (Tbl, Y)
statistics: Mdl = fitcdiscr (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is Nx1 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 (..., 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 single or double 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. The model's W keeps the class of the weights,
while every computation runs in double, so Prior and the predictions
are double where MATLAB returns single.
'Cost' A NxR 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: 4465
statistics: Mdl = fitcecoc (X, Y)
statistics: Mdl = fitcecoc (Tbl, ResponseVarName)
statistics: Mdl = fitcecoc (Tbl, formula)
statistics: Mdl = fitcecoc (Tbl, Y)
statistics: Mdl = fitcecoc (..., 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 single or double vector with
one element per observation. The default is uniform. The model's W
keeps the class of the weights, while every computation runs in double, so
Prior is double where MATLAB returns single.
'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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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'
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's are. This follows
R's ebmc and adabag packages and scikit-learn, whose
AdaBoostClassifier and imbalanced-learn's RUSBoostClassifier
built on it scale a boosted ensemble'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.

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: 10309
statistics: Mdl = fitcensemble (X, Y)
statistics: Mdl = fitcensemble (Tbl, ResponseVarName)
statistics: Mdl = fitcensemble (Tbl, formula)
statistics: Mdl = fitcensemble (Tbl, Y)
statistics: Mdl = fitcensemble (..., 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'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'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'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' 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'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'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'.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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 single or double vector with
one weight per observation. The default is uniform. The model's W
keeps the class of the weights, while every computation runs in double, so
Prior is double where MATLAB returns single.
'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: 8058
statistics: Mdl = fitcgam (X, Y)
statistics: Mdl = fitcgam (Tbl, ResponseVarName)
statistics: Mdl = fitcgam (Tbl, formula)
statistics: Mdl = fitcgam (Tbl, Y)
statistics: Mdl = fitcgam (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is Nx1 numeric vector containing binary class labels,
typically 0 or 1.

Tbl may stand in place of X, the response named by one of its
variables, written into a model formula holding main effects,
'Y ~ x1 + x2', or given beside it as Y. A variable holding
levels rather than numbers is a categorical predictor without being named
one, and 'CategoricalPredictors' adds to that set rather than
replacing it. PredictorNames and ResponseName come from the
table.

Mdl = fitcgam (..., 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 NxR 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'Weights' A single or double 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.
The model's W keeps the class of the weights, while every computation
runs in double, so Prior and the predictions are double where MATLAB
returns single.

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: 1250
statistics: Mdl = fitckernel (X, Y)
statistics: Mdl = fitckernel (Tbl, ResponseVarName)
statistics: Mdl = fitckernel (Tbl, formula)
statistics: Mdl = fitckernel (Tbl, Y)
statistics: Mdl = fitckernel (..., name, value)
statistics: [Mdl, FitInfo] = fitckernel (...)
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 (..., 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 (...) also returns a
structure describing the optimization: the objective it reached, the
gradient it left, and the tolerances it was given.

Mdl = fitckernel (..., 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: 11312
statistics: Mdl = fitcknn (X, Y)
statistics: Mdl = fitcknn (Tbl, ResponseVarName)
statistics: Mdl = fitcknn (Tbl, formula)
statistics: Mdl = fitcknn (Tbl, Y)
statistics: Mdl = fitcknn (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is Nx1 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 (..., 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 single or double 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. The model's W keeps the class of the
weights, while every computation runs in double, so Prior is double
where MATLAB returns single.
'Cost' A NxR 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 x 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 x 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'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 1xP vector containing a single observation in
P-dimensional space, YI is an NxP matrix containing an
arbitrary number of observations in the same P-dimensional space, and
D2 is an NxP vector of distances, where (D2k) is
the distance between observations XI and (YIk,:).

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: 1320
statistics: Mdl = fitclinear (X, Y)
statistics: Mdl = fitclinear (Tbl, ResponseVarName)
statistics: Mdl = fitclinear (Tbl, formula)
statistics: Mdl = fitclinear (Tbl, Y)
statistics: Mdl = fitclinear (..., name, value)
statistics: [Mdl, FitInfo] = fitclinear (...)
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 (..., 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 (...) 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 (..., 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: 4190
statistics: Mdl = fitcnb (X, Y)
statistics: Mdl = fitcnb (Tbl, ResponseVarName)
statistics: Mdl = fitcnb (Tbl, formula)
statistics: Mdl = fitcnb (Tbl, Y)
statistics: Mdl = fitcnb (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is an Nx1 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's likelihood under a class is therefore the product
of its per-predictor densities, and its posterior follows by Bayes' rule
from the class prior.

Mdl = fitcnb (..., 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.
'Weights' A nonnegative single or double vector of
observation weights, one per row of X. An empirical prior sums them
per class; a normal density takes weighted means and standard deviations, a
kernel density weighs its observations but chooses its bandwidth from them
alone, and the multinomials count each observation by its weight. A row of
zero or missing weight is left out. The model's W keeps the class of
the weights, while every computation runs in double, so Prior is
double where MATLAB returns single. The default is uniform.

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: 7126
statistics: Mdl = fitcnet (X, Y)
statistics: Mdl = fitcnet (Tbl, ResponseVarName)
statistics: Mdl = fitcnet (Tbl, formula)
statistics: Mdl = fitcnet (Tbl, Y)
statistics: Mdl = fitcnet (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is Nx1 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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'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'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.
'Weights' A nonnegative single or double vector of
observation weights, one per row of X. An empirical prior sums them
per class, and each class carries its prior spread over its observations in
proportion to them; the network is trained on the loss so weighted, which
is how a prior other than the empirical one enters the fit as well.
Standardization weighs the observations the same way, and a row of zero or
missing weight is left out. The model's W keeps the class of the
weights, while every computation runs in double, so Prior is double
where MATLAB returns single. The default is uniform.
'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 x 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 x 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'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'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: 8681
statistics: Mdl = fitcsvm (X, Y)
statistics: Mdl = fitcsvm (Tbl, ResponseVarName)
statistics: Mdl = fitcsvm (Tbl, formula)
statistics: Mdl = fitcsvm (Tbl, Y)
statistics: Mdl = fitcsvm (..., 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 NxP numeric matrix of predictor data where rows
correspond to observations and columns correspond to features or variables.

Y is Nx1 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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's shift, and for the sigmoid kernel, it affects the hyperbolic
tangent's shift. The default value for 'KernelOffset' is 0.
'Weights' A single or double vector of nonnegative
observation weights, one per row of X. Each observation'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. The model's W keeps the class of the
weights, while every computation runs in double, so Prior is double
where MATLAB returns single.
'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: 5694
statistics: Mdl = fitctree (X, Y)
statistics: Mdl = fitctree (Tbl, ResponseVarName)
statistics: Mdl = fitctree (Tbl, formula)
statistics: Mdl = fitctree (Tbl, Y)
statistics: Mdl = fitctree (..., 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.

Mdl = fitctree (Tbl, ResponseVarName) takes both
from the table Tbl: ResponseVarName names the variable holding
the class labels and every other variable is a predictor.
Mdl = fitctree (Tbl, formula) names them with a
model formula instead, 'Y ~ x1 + x2', which holds main effects
only and so takes no product, power or wildcard.
Mdl = fitctree (Tbl, Y) takes the predictors from
the table and the class labels from Y.

A table variable holding levels rather than numbers, which is a
categorical, a logical, a character array or a cell array of
character vectors, is a categorical predictor without being named one, and
'CategoricalPredictors' adds to that set rather than replacing it.
PredictorNames and ResponseName come from the table, and a
level is coded at prediction as it was coded at fitting, so a table given
to predict may hold only some of the levels.

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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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 single or double vector with one
element per observation. The default is uniform. The model's W keeps
the class of the weights, while every computation runs in double, so
Prior and the predictions are double where MATLAB returns single.

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'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: 3623
statistics: Mdl = fitrensemble (X, Y)
statistics: Mdl = fitrensemble (Tbl, ResponseVarName)
statistics: Mdl = fitrensemble (Tbl, formula)
statistics: Mdl = fitrensemble (Tbl, Y)
statistics: Mdl = fitrensemble (..., 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's prediction, the
learning rate being the tree'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 single or double vector with
one weight per observation. The default is uniform. The model's W
keeps the class of the weights, while every computation runs in double, so
the predictions are double where MATLAB returns single.
'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: 7728
statistics: obj = fitrgam (X, Y)
statistics: obj = fitrgam (Tbl, ResponseVarName)
statistics: obj = fitrgam (Tbl, formula)
statistics: obj = fitrgam (Tbl, 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 NxP 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 Nx1 numeric vector containing the response data
corresponding to the predictor data in X. Y must have same
number of rows as X.

Tbl may stand in place of X, the response named by one of its
variables, written into a model formula holding main effects,
'Y ~ x1 + x2', or given beside it as Y. A variable holding
levels rather than numbers is a categorical predictor without being named
one, and 'CategoricalPredictors' adds to that set rather than
replacing it. PredictorNames and ResponseName come from the
table.

obj = fitrgam (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'Weights' A single or double vector of non-negative
observation weights, one per row of X. Only their proportions matter.
The model's W keeps the class of the weights, while every computation
runs in double, so the predictions are double where MATLAB returns single.

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: 942
statistics: Mdl = fitrgp (X, Y)
statistics: Mdl = fitrgp (Tbl, ResponseVarName)
statistics: Mdl = fitrgp (Tbl, formula)
statistics: Mdl = fitrgp (Tbl, Y)
statistics: Mdl = fitrgp (..., 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 (..., 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: 1249
statistics: Mdl = fitrkernel (X, Y)
statistics: Mdl = fitrkernel (Tbl, ResponseVarName)
statistics: Mdl = fitrkernel (Tbl, formula)
statistics: Mdl = fitrkernel (Tbl, Y)
statistics: Mdl = fitrkernel (..., name, value)
statistics: [Mdl, FitInfo] = fitrkernel (...)
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 (..., 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 (...) also returns a
structure describing the optimization: the objective it reached, the
gradient it left, and the tolerances it was given.

Mdl = fitrkernel (..., 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: 1316
statistics: Mdl = fitrlinear (X, Y)
statistics: Mdl = fitrlinear (Tbl, ResponseVarName)
statistics: Mdl = fitrlinear (Tbl, formula)
statistics: Mdl = fitrlinear (Tbl, Y)
statistics: Mdl = fitrlinear (..., name, value)
statistics: [Mdl, FitInfo] = fitrlinear (...)
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 (..., 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 (...) 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 (..., 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: 6064
statistics: Mdl = fitrnet (X, Y)
statistics: Mdl = fitrnet (Tbl, ResponseVarName)
statistics: Mdl = fitrnet (Tbl, formula)
statistics: Mdl = fitrnet (Tbl, Y)
statistics: Mdl = fitrnet (..., 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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'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'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'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.
'Weights' A nonnegative single or double vector of
observation weights, one per row of X. The network is trained on the
loss weighted by them, standardization and the prediction for a row missing
a predictor weigh the observations the same way, and a row of zero or
missing weight is left out. The model's W keeps the class of the
weights, while every computation runs in double, so the predictions are
double where MATLAB returns single. The default is uniform.

The weights of each layer are drawn from a uniform range whose half-width
is set by that layer'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'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: 4088
statistics: Mdl = fitrsvm (X, Y)
statistics: Mdl = fitrsvm (Tbl, ResponseVarName)
statistics: Mdl = fitrsvm (Tbl, formula)
statistics: Mdl = fitrsvm (Tbl, Y)
statistics: Mdl = fitrsvm (..., 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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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'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.
'Weights' A nonnegative single or double vector of
observation weights, one per row of X. An observation's box
constraint is n times BoxConstraint times its weight, the
weights scaled to sum to one; standardization uses weighted means and
standard deviations, and a row of zero or missing weight is left out. The
model's W keeps the class of the weights, while every computation
runs in double. The default is uniform.
'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: 4617
statistics: Mdl = fitrtree (X, Y)
statistics: Mdl = fitrtree (Tbl, ResponseVarName)
statistics: Mdl = fitrtree (Tbl, formula)
statistics: Mdl = fitrtree (Tbl, Y)
statistics: Mdl = fitrtree (..., 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.

Mdl = fitrtree (Tbl, ResponseVarName) takes both
from the table Tbl: ResponseVarName names the variable holding
the response and every other variable is a predictor.
Mdl = fitrtree (Tbl, formula) names them with a
model formula instead, 'Y ~ x1 + x2', which holds main effects
only and so takes no product, power or wildcard.
Mdl = fitrtree (Tbl, Y) takes the predictors from
the table and the response from Y.

A table variable holding levels rather than numbers, which is a
categorical, a logical, a character array or a cell array of
character vectors, is a categorical predictor without being named one, and
'CategoricalPredictors' adds to that set rather than replacing it.
PredictorNames and ResponseName come from the table, and a
level is coded at prediction as it was coded at fitting, so a table given
to predict may hold only some of the levels.

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 (..., 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.
A predictor may be named rather than indexed, as a character matrix of one
padded name per row, a string array or a cellstr; a name must match an entry
of 'PredictorNames' exactly, its case included.
'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'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 single or double vector with one
element per observation. The default is uniform. The model's W keeps
the class of the weights, while every computation runs in double, so the
predictions are double where MATLAB returns single.

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: 4
lime


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2893
statistics: lime
Local interpretable model-agnostic explanations for a fitted model.

A lime object explains one prediction by fitting a simple model,
a linear one or a shallow decision tree, over observations drawn around
the query point and weighted by how near they lie to it. The simple
model is readable where the fitted one is not, and it is accurate near
the query point rather than everywhere.

explainer = lime (Mdl) builds an explainer for the
fitted model Mdl over the observations it was fitted on. A compact
model keeps none, so it must be given them as X, and so must a
function handle. The observations to fit the simple model on are drawn
at once, and nothing is explained until a query point is given, either to
the constructor as 'QueryPoint' or afterwards to fit.

explainer = lime (Mdl, X) takes the observations
the draw is fitted to as X, a real numeric matrix of one column per
predictor.

X may also be a table, and so may 'QueryPoint',
'CustomSyntheticData' and what fit is given. Where the
model names its predictors the table is read by those names and not by
the order its columns come in, so a column the model was not fitted on is
passed over and a value holding a level is coded as that level was coded
at fitting. A function handle names nothing, so a table given for one
names the predictors itself and its columns are taken in the order they
come.

explainer = lime (fun, X) takes a function
handle in place of a model. fun is called with a matrix of
observations and answers with one column holding one value for each, and
'Type' must say whether those values are a response or a label.

Name Value
'Type' Whether the model answers with a response,
'regression', or with a label, 'classification'. It is
taken from a fitted model and is required for a function handle.
'DataLocality' Where the observations are drawn
from: 'global', the default, fits the distribution to the whole
of X; 'local' fits it to the 'NumNeighbors'
observations nearest the query point, which must then be known.
'NumNeighbors' How many neighbours
'local' fits to, 1500 by default.
'NumSyntheticData' How many observations to draw,
5000 by default.
'CustomSyntheticData' Observations to use instead
of drawing any, one row each. Nothing is drawn where it is given.
'CategoricalPredictors' The predictors whose
values are levels, taken as by every learner of this package. It applies
only to a function handle, a model being asked for its own.
'QueryPoint' The observation to explain. Given
with 'NumImportantPredictors' it is explained at once, otherwise
it is left to fit.
'NumImportantPredictors' How many predictors the
simple model is fitted on.

Every option fit takes may also be given here, in which case it
stands as the default for every later fit.

'UseParallel' is not implemented and is refused rather than
ignored.

See also:
shapley,
partialDependence,
PredictiveModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 67
Local interpretable model-agnostic explanations for a fitted model.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
lime.BlackboxFitted


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 110
lime: property BlackboxFitted
What the explained model answers at the query point

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 51
What the explained model answers at the query point



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
lime.BlackboxModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 153
lime: property BlackboxModel
The model being explained

The fitted model, or the function handle, the explainer was built on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
The model being explained



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
lime.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 175
lime: property CategoricalPredictors
The categorical predictors

The indices of the predictors whose values are levels, empty where
there are none. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
The categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
lime.DataLocality


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 223
lime: property DataLocality
Where the observations were drawn from

'global' where the distribution was fitted to the whole of
X, 'local' where it was fitted to the neighbours of
the query point. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Where the observations were drawn from



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
lime.Fitted


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 245
lime: property Fitted
What the model answers over the drawn observations

One response per observation for a regression model, or one label for
a classifier, keeping the type of the response the model was fitted
with. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
What the model answers over the drawn observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
lime.ImportantPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 181
lime: property ImportantPredictors
The predictors the simple model was fitted on

Their indices, in increasing order, empty until a query point is
given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
The predictors the simple model was fitted on



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
lime.NumImportantPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 204
lime: property NumImportantPredictors
How many predictors the simple model was asked for

Empty until a query point is given. Fewer may be used, where a
predictor adds nothing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
How many predictors the simple model was asked for



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
lime.NumSyntheticData


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 93
lime: property NumSyntheticData
How many observations were drawn

This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
How many observations were drawn



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
lime.QueryPoint


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 157
lime: property QueryPoint
The observation explained

One row holding one value per predictor, empty until a query point is
given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
The observation explained



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
lime.SimpleModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 476
lime: property SimpleModel
The simple model fitted around the query point

A RegressionLinear, ClassificationLinear,
RegressionTree or ClassificationTree, fitted on the
important predictors alone and weighted by nearness to the query
point. For a classifier it answers 1 for the class the
explained model predicted and -1 for any other, which is what
makes it a single model however many classes there are. It is empty
until a query point is given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
The simple model fitted around the query point



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
lime.SimpleModelFitted


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 205
lime: property SimpleModelFitted
What the simple model answers at the query point

Where the two agree the simple model is worth reading; where they do
not, it explains nothing. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
What the simple model answers at the query point



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
lime.SyntheticData


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 193
lime: property SyntheticData
The observations the simple model is fitted over

One row each, drawn around the query point or given outright as
'CustomSyntheticData'. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
The observations the simple model is fitted over



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
lime.Type


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 110
lime: property Type
What the model answers with

'regression' or 'classification'. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
What the model answers with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
lime.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 352
lime: property X
The observations the draw was fitted to

A real numeric matrix of one row per observation and one column per
predictor. This property is read-only.

Where the observations were given as a table, they are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the object.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
The observations the draw was fitted to



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
lime.fit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1306
lime: obj = fit (obj, queryPoint, numImportantPredictors)
lime: obj = fit (..., name, value)
Fit the simple model around one query point.

queryPoint is one row holding one value per predictor, or a
table read by the names the explainer holds, and
numImportantPredictors how many predictors the simple model is
fitted on. Fewer are used where a predictor adds nothing, and
ImportantPredictors says which were.

Name Value
'Distance' How nearness to the query point is
measured. Where the predictors hold numbers it is one of
'euclidean', the default, 'squaredeuclidean',
'seuclidean', 'mahalanobis', 'cityblock',
'minkowski', 'chebychev', 'cosine',
'correlation' and 'spearman'; where they hold levels
it is 'goodall3', the default, or 'ofd'. A function
handle is also taken, which MATLAB does not; see below.
'KernelWidth' How sharply the weight falls
away with distance, from just above 0 to 1. The default is 0.75.
'SimpleModelType' 'linear', the
default, or 'tree'.
'BetaTolerance' Relative tolerance the linear
simple model is fitted to, 10^{-4} by default.
'Cov', 'P', 'Scale' Passed to
the distance that takes them, as pdist2 takes them.

The weight of a drawn observation is
exp (-0.5 (d / max (d) / w)^2), with d its distance
from the query point and w the kernel width.

See also:
lime,
lime.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Fit the simple model around one query point.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
lime.lime


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 445
lime: obj = lime (Mdl)
lime: obj = lime (Mdl, X)
lime: obj = lime (fun, X)
lime: obj = lime (..., name, value)
Build a local interpretable model-agnostic explainer.

The arguments are those described for the class. The observations
the simple model is fitted over are drawn here; where
'QueryPoint' and 'NumImportantPredictors' are both
given the explanation is computed at once, otherwise it is left to
fit.

See also:
lime,
lime.fit,
lime.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Build a local interpretable model-agnostic explainer.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
lime.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 329
lime: plot (obj)
lime: f = plot (obj)
Plot what the simple model says about the query point.

A horizontal bar per important predictor, holding the coefficient of
a linear simple model or the predictor importance of a tree, in the
order the predictors come in rather than by size. f is the
figure drawn.

See also:
lime,
lime.fit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Plot what the simple model says about the query point.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2971
statistics: pd = partialDependence (Mdl, Vars)
statistics: pd = partialDependence (Mdl, Vars, Labels)
statistics: pd = partialDependence (..., Data)
statistics: pd = partialDependence (fun, Vars, Data)
statistics: pd = partialDependence (..., name, value)
statistics: [pd, x, y] = partialDependence (...)
Compute partial dependence.

pd = partialDependence (Mdl, Vars) returns the
partial dependence of the response of the regression model Mdl on the
predictors named by Vars, averaged over the observations Mdl
was fitted on. Vars names one predictor or two, by column index or
by name, and a model that does not keep its observations must be given
them as Data.

pd = partialDependence (Mdl, Vars, Labels)
does the same for a classification model, averaging the score of each class
named by Labels rather than a response. Labels is required for
such a model and refused for any other.

pd = partialDependence (fun, Vars, Data)
takes a function handle in place of a model. fun is called with a
matrix of observations and answers with one row for each, and Data is
then required.

pd is a 1xnumX vector for a regression model varying one
predictor and a numYxnumX matrix for two, where numX and
numY count the query points of the first and second. For a
classification model it gains a leading dimension of one row per class,
giving numxnumX and numxnumYxnumX.

x and y hold the query points of the first and the second
predictor, y empty where only one was named. Where a predictor is
categorical they are its levels.

Name Value
'QueryPoints' The points to answer at, as a vector
for one predictor and, for two, either a matrix of one column each or a
cell holding a vector for each, which is how they may differ in length.
The default is 100 points evenly spaced between the smallest and the
largest value the predictor takes among the observations averaged over,
and the levels themselves where it is categorical.
'NumObservationsToSample' How many observations to
draw, without replacement, from those averaged over. The default is all of
them, and so is a number reaching or exceeding how many there are. The
default query points span what was drawn.
'CategoricalPredictors' The predictors whose values
are levels, taken as by every learner of this package. It applies only to
a function handle, a model being asked for its own.
'IncludeInteractions' Whether the interaction terms
of a generalized additive model are included. It applies only to such a
model, and the default is the model's own.
'IncludeIntercept' Whether the intercept of a
generalized additive model is included, true by default. Excluding
it takes the intercept off the result.
'OutputColumns' Which of the columns a function
handle answers with are wanted, as indices or as 'all', which is
the default. It applies only to a function handle.

'UseParallel' and 'PredictionForMissingValue' are not
implemented and are refused rather than ignored.

See also:
plotPartialDependence,
PredictiveModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Compute partial dependence.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
plotPartialDependence


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1794
statistics: plotPartialDependence (Mdl, Vars)
statistics: plotPartialDependence (Mdl, Vars, Labels)
statistics: plotPartialDependence (..., Data)
statistics: plotPartialDependence (fun, Vars, Data)
statistics: plotPartialDependence (..., name, value)
statistics: ax = plotPartialDependence (...)
Plot partial dependence and individual conditional expectation.

plotPartialDependence (Mdl, Vars) draws the partial
dependence of the model Mdl on the predictors named by Vars:
a line where one is named and a surface where two are. The arguments are
those of partialDependence, which computes what is drawn, and
Labels is required for a classification model in the same way.

ax is the axes drawn into.

Name Value
'Conditional' What to draw:
'none' (default) draws the partial dependence alone;
'absolute' draws a curve per observation, a marker where each one
sits on its own curve, and the mean of those curves over them;
'centered' draws the same with every curve shifted to start at
zero. Only one predictor may be varied, and a classification model may
name only one class.
'Parent' The axes to draw into. The default is
gca.

Every other name-value pair is passed to partialDependence; see
there for 'QueryPoints', 'NumObservationsToSample' and the
rest.

The line a conditional plot draws is the mean of the curves drawn with it,
which is not always what partialDependence returns. A decision
tree, an ensemble of bagged trees and a generalized additive model are
answered over the distribution they were fitted on, while a curve belongs
to one observation and must come from predict, so the two part
company for those models whenever the observations are not the ones the
model was fitted on. MATLAB R2024a draws it this way and so does this.

See also:
partialDependence,
PredictiveModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Plot partial dependence and individual conditional expectation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
shapley


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3053
statistics: shapley
Shapley values for a fitted model at one or more query points.

A Shapley value says how much one predictor contributed to the deviation
of a prediction from the average prediction. The values of a query point
sum to that deviation exactly, which is the property the computation is
built to keep.

explainer = shapley (Mdl) builds an explainer for the
fitted model Mdl over the observations it was fitted on. A compact
model keeps none, so it must be given them as X, and so must a
function handle. Nothing is computed until query points are given, either
to the constructor as 'QueryPoints' or afterwards to
fit.

explainer = shapley (Mdl, X) takes the
observations to average over as X, a real numeric matrix of one
column per predictor.

X may also be a table, and so may 'QueryPoints' and what
fit is given. Where the model names its predictors the table is
read by those names and not by the order its columns come in, so a
column the model was not fitted on is passed over and a value holding a
level is coded as that level was coded at fitting. A function handle
names nothing, so a table given for one names the predictors itself and
its columns are taken in the order they come.

explainer = shapley (fun, X) takes a function
handle in place of a model. fun is called with a matrix of
observations and answers with one real numeric column holding one value
for each, so an explainer built on a handle always has a single column of
values.

Name Value
'QueryPoints' The observations to explain, one per
row, with one column per predictor. The default is none, which leaves the
values unfitted.
'NumObservationsToSample' How many observations to
draw, without replacement, from those averaged over, or 'all' for
every one of them. The default is 100, and so is any number reaching or
exceeding how many there are. A drawn sample makes the values differ from
one call to the next; 'all' is what makes them reproducible.
'CategoricalPredictors' The predictors whose
values are levels, taken as by every learner of this package. It applies
only to a function handle, a model being asked for its own.
'MaxNumSubsets' How many predictor subsets at
most to compute over, an integer above 1. The default is the lesser of
2^M, which is every subset of the M predictors, and 1024.
Every subset gives the values exactly; fewer estimates them, and fewer
than 2M+2 estimates them poorly enough to warn about. Giving it
at all asks for the subsets, so a linear model or a decision tree that
would otherwise be answered from its own structure is answered over
them instead.
'Method' The algorithm, 'interventional'
by default, which averages over the observations as they stand.
'conditional' averages instead over the tenth of them lying
nearest the query point in the predictors being held, which stands in
for conditioning on those predictors. It asks more of the data and is
the dearer of the two.

'UseParallel' is not implemented and is refused rather than
ignored.

See also:
partialDependence,
plotPartialDependence,
PredictiveModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 62
Shapley values for a fitted model at one or more query points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
shapley.BlackboxFitted


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 338
shapley: property BlackboxFitted
What the model answers at the query points

The response of a regression model or the predicted label of a
classifier, one for each query point, empty until query points are
given. A label keeps the type of the response the model was fitted
with, as everywhere in this package. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
What the model answers at the query points



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
shapley.BlackboxModel


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 156
shapley: property BlackboxModel
The model being explained

The fitted model, or the function handle, the explainer was built on.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
The model being explained



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
shapley.CategoricalPredictors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 178
shapley: property CategoricalPredictors
The categorical predictors

The indices of the predictors whose values are levels, empty where
there are none. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
The categorical predictors



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
shapley.Intercept


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 324
shapley: property Intercept
The average prediction

The mean of what the model answers over the observations averaged over,
a scalar for a regression model or a function handle and one value per
class for a classifier. The values of a query point sum to the
deviation of its prediction from this. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
The average prediction



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
shapley.MeanAbsoluteShapley


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 257
shapley: property MeanAbsoluteShapley
The mean absolute Shapley value of each predictor

A table laid out as Shapley, holding the mean over the query
points of the absolute values. With one query point it is their
absolute value. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 49
The mean absolute Shapley value of each predictor



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
shapley.Method


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 727
shapley: property Method
The algorithm the values were computed with

A character vector. 'interventional-linear' where the model
predicts a weighted sum of its predictors, which is answered from the
weights alone; 'interventional-tree' for a decision tree and
for an ensemble of them, which is answered leaf by leaf;
'interventional-kernel' for
every other model, which enumerates every subset of the predictors
where the budget allows it and estimates the values by weighted least
squares where it does not; and 'conditional-kernel' where
'Method' asked for conditioning. A tree and a linear model
are answered exactly however many predictors they have, where the
budget stops the subsets at 1024. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
The algorithm the values were computed with



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
shapley.NumSubsets


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 224
shapley: property NumSubsets
How many predictor subsets the values were computed over

The lesser of what 'MaxNumSubsets' allowed and two raised to
the number of predictors, which is every subset. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 56
How many predictor subsets the values were computed over



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
shapley.QueryPoints


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 171
shapley: property QueryPoints
The observations explained

A real numeric matrix of one row per query point, empty until query
points are given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
The observations explained



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
shapley.SampledObservationIndices


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
shapley: property SampledObservationIndices
The rows of X that were averaged over

A sorted column of indices into X, holding every row where
'NumObservationsToSample' did not draw a sample. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
The rows of X that were averaged over



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
shapley.Shapley


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 377
shapley: property Shapley
The Shapley values

A table of one row per predictor, holding the predictor names in
Predictor and the values in Value for a regression
model or a function handle, and in one variable per class, named after
it, for a classifier. Each such variable holds one column per query
point. It is empty until query points are given. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
The Shapley values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
shapley.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 449
shapley: property X
The observations averaged over

A real numeric matrix of one row per observation and one column per
predictor, either given outright or taken from the model. It is the
whole of what was given, before any sampling. This property is
read-only.

Where the observations were given as a table, they are the coded
matrix and not the table: a variable holding levels is stored as its
level codes, and the coding is kept with the object.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
The observations averaged over



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
shapley.boxchart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 934
shapley: boxchart (obj)
shapley: boxchart (obj, name, value)
shapley: boxchart (ax, ...)
shapley: b = boxchart (...)
Draw a box chart of the Shapley values over the query points.

One box per predictor, the least important at the bottom, spread over
the query points the values were fitted at. The chart is titled
'Shapley Summary Plot' and lies horizontally.

ax is the axes to draw into, the current one where none is
given. b is the stats.chart.BoxChart drawn.

Name Value
'NumImportantPredictors' How many predictors
to draw, the ten most important by default. Whatever is left over is
left out rather than summed, a box over a sum meaning nothing.
'ClassName' The one class to draw, for a
classification model. The default is the first class of the model.
'JitterOutliers' Whether outlier markers are
spread across the width of the box, 'off' by default.

See also:
shapley,
shapley.plot,
shapley.swarmchart,
stats.chart.BoxChart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 61
Draw a box chart of the Shapley values over the query points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
shapley.fit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 307
shapley: obj = fit (obj, QueryPoints)
Compute the Shapley values at the given query points.

QueryPoints is a real numeric matrix of one row per query point
and one column per predictor, or a table read by the names the
explainer holds. The values already held are replaced, not added to.

See also:
shapley


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
Compute the Shapley values at the given query points.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
shapley.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1041
shapley: plot (obj)
shapley: plot (obj, name, value)
shapley: plot (ax, ...)
shapley: b = plot (...)
Plot the Shapley values as a horizontal bar chart.

One bar per predictor, the least important at the bottom. Over one
query point the bars hold the values themselves and the chart is
titled 'Shapley Explanation'; over several they hold the mean
of the absolute values and it is titled
'Shapley Importance Plot'.

ax is the axes to draw into, the current one where none is
given. b holds one bar series per class drawn.

Name Value
'NumImportantPredictors' How many predictors
to draw on their own, the ten most important by default. Over
several query points whatever is left over is drawn as one further
bar holding its sum; over one query point it is left out.
'ClassNames' The classes to draw, for a
classification model. The default is the predicted class over one
query point and every class over several.
'QueryPointIndices' Which query points to
draw, all of them by default.

See also:
shapley,
shapley.boxchart,
shapley.swarmchart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 50
Plot the Shapley values as a horizontal bar chart.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
shapley.plotDependence


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1291
shapley: plotDependence (obj, predictor)
shapley: plotDependence (obj, predictor, name, value)
shapley: plotDependence (ax, ...)
shapley: p = plotDependence (...)
Draw the Shapley values of one predictor against its own values.

predictor names or indexes the predictor. Where it holds
numbers the chart is a scatter of its value at each query point
against the value it was given there; where it holds levels the chart
is a box of the values at each level.

The chart is titled 'Shapley Dependence Plot' and its
vertical axis is labelled after the predictor drawn.

ax is the axes to draw into, the current one where none is
given. p is the scatter object, or the
stats.chart.BoxChart, drawn.

Name Value
'ClassName' The one class to draw, for a
classification model. The default is the first class of the model.
'ColorPredictor' A second predictor to colour
the points by, none by default. Its values are read as they stand,
the range of the axes carrying the scale, and a colour bar is drawn
beside the chart. It applies only where the predictor drawn holds
numbers.
'ColorMap' The colour map the colouring
predictor is read through, as a name or as a matrix of one RGB
triplet per row. The default is the one the axes already carries.

See also:
shapley,
shapley.plot,
shapley.swarmchart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Draw the Shapley values of one predictor against its own values.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
shapley.shapley


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 337
shapley: obj = shapley (Mdl)
shapley: obj = shapley (Mdl, X)
shapley: obj = shapley (fun, X)
shapley: obj = shapley (..., name, value)
Build a Shapley explainer.

The arguments are those described for the class. Where
'QueryPoints' is given the values are computed at once,
otherwise they are left to fit.

See also:
shapley,
shapley.fit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Build a Shapley explainer.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
shapley.swarmchart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1189
shapley: swarmchart (obj)
shapley: swarmchart (obj, name, value)
shapley: swarmchart (ax, ...)
shapley: s = swarmchart (...)
Draw a swarm chart of the Shapley values over the query points.

One row of points per predictor, the least important at the bottom,
one point per query point spread vertically by how crowded its
neighbourhood is. Each point is coloured by the value the predictor
takes at that query point, the least of them at one end of the
colour map and the greatest at the other. The chart is titled
'Shapley Summary Plot'.

ax is the axes to draw into, the current one where none is
given. s holds one scatter object per predictor drawn.

Name Value
'NumImportantPredictors' How many predictors
to draw, the ten most important by default.
'ClassName' The one class to draw, for a
classification model. The default is the first class of the model.
'YJitter' How the points of a row are spread,
'density' by default, or 'rand', 'randn' or
'none'.
'ColorMap' The colour map the predictor
values are read through, as a name or as a matrix of one RGB triplet
per row. The default is the one the axes already carries.

See also:
shapley,
shapley.plot,
shapley.boxchart,
swarmchart


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 63
Draw a swarm chart of the Shapley values over the query points.



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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1341
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: 1863
statistics: T = templateEnsemble (Method, NLearn, Learners)
statistics: T = templateEnsemble (..., 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 (..., 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: 1277
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: 1337
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: 1317
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: 1312
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: 1272
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: 1272
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.





