`m = margin(mdl,tbl,ResponseVarName)`

`m = margin(mdl,tbl,Y)`

`m = margin(mdl,X,Y)`

returns
the classification margins for the matrix of predictors `m`

= margin(`mdl`

,`tbl`

,`ResponseVarName`

)`X`

and
class labels `Y`

. For the definition, see Margin.

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

The *score* of a classification is the
posterior probability of the classification. The posterior probability
is the number of neighbors that have that classification, divided
by the number of neighbors. For a more detailed definition that includes
weights and prior probabilities, see Posterior Probability.

Was this topic helpful?