Implements the k-nearest neighbors algorithm
ipfKnn(train_fgp, train_pos, k = 3, method = "euclidean",
weights = "distance", norm = 2, sd = 5, epsilon = 0.001, alpha = 1,
threshold = 20, FUN = NULL, ...)
a data frame containing the fingerprint vectors of the training set
a data frame containing the positions of the training set observations
the k parameter for knn algorithm (number of nearest neighbors)
the method to compute the distance between the RSSI vectors: 'euclidean', 'manhattan', 'norm', 'LGD' or 'PLGD'
the algorithm to compute the weights: 'distance' or 'uniform'
parameter for the 'norm' method
parameter for 'LGD' and 'PLGD' methods
parameter for 'LGD' and 'PLGD' methods
parameter for 'PLGD' method
parameter for 'PLGD' method
an alternative function provided to compute the distance. This function must return a matrix of dimensions: nrow(test) x nrow(train), containing the distances from test observations to train observations. The two first parameters taken by the function must be train and test
additional parameters for provided function FUN
An S4 class object of type ipfModel, with the following slots: params -> a list with the parameters passed to the function data -> a list with the fingerprints and locations
# NOT RUN {
model <- ipfKnn(ipftrain[, 1:168], ipftrain[, 169:170], k = 9, method = 'manhattan')
# }
Run the code above in your browser using DataLab