loss
Classification error
Syntax
L = loss(obj,X,Y)
L = loss(obj,X,Y,Name,Value)
Description
returns the classification loss, which
is a scalar representing how well L
= loss(obj
,X
,Y
)obj
classifies the data in
X
, when Y
contains the true
classifications.
When computing the loss, loss
normalizes the class
probabilities in Y
to the class probabilities used for training,
stored in the Prior
property of obj
.
returns the loss with additional options specified by one or more
L
= loss(obj
,X
,Y
,Name,Value
)Name,Value
pair arguments.
Note
If the predictor data X
contains any missing values and
LossFun
is not set to "mincost"
or
"classiferror"
, the loss
function can return NaN. For more information, see loss can return NaN for predictor data with missing values.
Input Arguments
|
Discriminant analysis classifier of class |
|
Matrix where each row represents an observation, and each column
represents a predictor. The number of columns in |
|
Class labels, with the same data type as exists 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.
|
Built-in loss function name (character vector or string scalar in the table) or function handle.
For more details on loss functions, see Classification Loss. Default: | ||||||||||||||||||
|
Numeric vector of length Default: |
Output Arguments
|
Classification
loss, a scalar. The interpretation of |
Examples
More About
Extended Capabilities
Version History
See Also
ClassificationDiscriminant
| fitcdiscr
| edge
| margin
| predict