nearest_neighbors {tsfknn}R Documentation

Nearest neighbors associated with predictions

Description

It allows to check the new instances and their nearest neighbors used in a prediction associated with a "knnForecast" object.

Usage

nearest_neighbors(forecast)

Arguments

forecast

A knnForecast object.

Value

A list including the new instances used in KNN regression and their nearest neighbors.

Examples

pred <- knn_forecasting(UKgas, h = 4, lags = 1:4, k = 2, msas = "MIMO")
nearest_neighbors(pred)

[Package tsfknn version 0.6.0 Index]