View source: R/KNN_classifier_with_custom_distance_function.R
knn | R Documentation |
KNN prediction for several series
knn(x_fit, x_pred, k, func = "dist", weighted_pred = FALSE, p = NULL)
x_fit |
a data frame with reference time series (by row) and first column as class label |
x_pred |
a data frame with time series to classify (by row) and first column as class label |
k |
number of nearest neighbors |
func |
distance measure |
weighted_pred |
whether to use weighted prediction or not |
p |
extra parameter for the distance measure function |
a vector of predicted class labels
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.