k-nearest neighbor classifier template
returns
a k-nearest neighbor (KNN) learner template suitable
for training ensembles or error-correcting output code (ECOC) multiclass
models.t
= templateKNN()
If you specify a default template, then the software uses default values for all input arguments during training.
Specify t
as a learner in fitcensemble
or fitcecoc
.
creates
a template with additional options specified by one or more name-value
pair arguments.t
= templateKNN(Name,Value
)
For example, you can specify the nearest neighbor search method, the number of nearest neighbors to find, or the distance metric.
If you display t
in the Command Window, then
all options appear empty ([]
), except those that
you specify using name-value pair arguments. During training, the
software uses default values for empty options.
ClassificationKNN
| ExhaustiveSearcher
| fitcecoc
| fitcensemble