loss
Classification error
Syntax
L = loss(ens,tbl,ResponseVarName)
L = loss(ens,tbl,Y)
L = loss(ens,X,Y)
L = loss(___,Name,Value)
Description
returns the classification error for ensemble L
= loss(ens
,tbl
,ResponseVarName
)ens
computed using
table of predictors tbl
and true class labels
tbl.ResponseVarName
.
returns the classification error for ensemble L
= loss(ens
,tbl
,Y
)ens
computed using
table of predictors tbl
and true class labels
Y
.
returns the classification error for ensemble L
= loss(ens
,X
,Y
)ens
computed using
matrix of predictors X
and true class labels
Y
.
computes classification error with additional options specified by one or more
L
= loss(___,Name,Value
)Name,Value
pair arguments, using any of the previous
syntaxes.
When computing the loss, loss
normalizes the class
probabilities in ResponseVarName
or Y
to the
class probabilities used for training, stored in the Prior
property
of ens
.
Note
If the predictor data X
or the predictor variables in
tbl
contain any missing values, the
loss
function can return NaN. For more details,
see loss can return NaN for predictor data with missing values.
Input Arguments
|
Classification ensemble created with |
|
Sample data, specified as a table. Each row of If you trained |
|
Response variable name, specified as the name of a variable in
You must specify |
|
Matrix of data to classify. Each row of If you trained |
|
Class labels of observations in |
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
| Indices of weak learners in the ensemble ranging from Default: | ||||||||||||||||||
|
Loss function, specified as the comma-separated pair consisting of
For more details on loss functions, see Classification Loss. Default: | ||||||||||||||||||
|
Meaning of the output
Default: | ||||||||||||||||||
|
A logical matrix of size When Default: | ||||||||||||||||||
| Indication to perform inference in parallel, specified as Default: | ||||||||||||||||||
|
Vector of observation weights, with nonnegative entries. The length of
Default: |
Output Arguments
|
Classification
loss, by default the fraction of misclassified data.
|