Documentation Center    • Trial Software   • Product Updates
Class: ClassificationKNN  Margin of k-nearest neighbor
classifier by resubstitution   m = resubMargin(mdl)   m =
resubMargin(mdl) returns the classification margins of the data
used to train mdl. For the definition, see Margin.  Input
Arguments  expand all  mdl — Classifier modelclassifier model
object  k-nearest neighbor classifier model, returned as a
classifier model object.  Note that using the 'CrossVal',
'KFold', 'Holdout', 'Leaveout', or 'CVPartition' options results
in a model of class ClassificationPartitionedModel. You cannot
use a partitioned tree for prediction, so this kind of tree does
not have a predict method.  Otherwise, mdl is of class
ClassificationKNN, and you can use the predict method to make
predictions.  Output Arguments   A numeric column vector of
length size(mdl.X,1), where mdl.X is the training data for mdl.
Each entry in m represents the margin for the corresponding row
of mdl.X and (true class) mdl.Y.    The classific