knn: KNN prediction for several series

View source: R/KNN_classifier_with_custom_distance_function.R

knnR Documentation

KNN prediction for several series

Description

KNN prediction for several series

Usage

knn(x_fit, x_pred, k, func = "dist", weighted_pred = FALSE, p = NULL)

Arguments

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

Value

a vector of predicted class labels


juancbellass/time-series-r-package documentation built on Aug. 26, 2023, 8:06 p.m.