mahal
Mahalanobis distance to class means of discriminant analysis classifier
Syntax
M = mahal(obj,X)
M = mahal(obj,X,Name,Value)
Description
returns
the squared Mahalanobis distances from observations in M
= mahal(obj
,X
)X
to
the class means in obj
.
computes
the squared Mahalanobis distance with additional options specified
by one or more M
= mahal(obj
,X
,Name,Value
)Name,Value
pair arguments.
Input Arguments
|
Discriminant analysis classifier of class |
|
Numeric matrix of size |
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.
|
Class labels consisting of |
Output Arguments
|
Size and meaning of output
|
Examples
Find the Mahalanobis distances from the mean of the Fisher iris data to the class means, using distinct covariance matrices for each class:
load fisheriris obj = fitcdiscr(meas,species,... 'DiscrimType','quadratic'); mahadist = mahal(obj,mean(meas)) mahadist = 220.0667 5.0254 30.5804