A vector containing the distances from x to all rows of data.
KNN
Numeric vector, containing the indices of the k nearest neighbors (rows) to the given points
Arguments
X
A vector containing the data point to be compared to data.
Data
A matrix containing the data points to be compared with x.
SelectFeatures
A vector of the same length as x and the rows of data, containing TRUE for all columns of the data to be compared and any other value for columns to be discarded.
method
(Optional) String marking, which distance measure is to be used. Euclidean by default.
p
(Optional) Scalar, The pp-th root of the sum of the pp-th powers of the differences of the components. Default is 2
knn
(Optional) Scalar, gives the number of the indices of the k nearest neighbors returned. Default is 1