nearest_neighbors: Nearest neighbors associated with predictions

View source: R/forecasting.R

nearest_neighborsR 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)

tsfknn documentation built on Sept. 4, 2023, 9:06 a.m.