MATLAB File Help: cv.KNearest/findNearest | Index |
Finds the neighbors and predicts responses for input vectors
results = classifier.findNearest(samples, K)
[results,neiResp,dists,f] = classifier.findNearest(samples, K)
[...] = classifier.findNearest(..., 'OptionName', optionValue, ...)
nsamples-by-nfeatures
.nsamples
elements.nsamples-by-K
.nsamples-by-K
.For each input vector (a row of the matrix samples), the method
finds the K
nearest neighbors. In case of regression, the
predicted result is a mean value of the particular vector's
neighbor responses. In case of classification, the class is
determined by voting.
For each input vector, the neighbors are sorted by their distances to the vector.
The function is parallelized with the TBB library.
Access | public |
Sealed | false |
Static | false |