Learn R Programming

tsfknn (version 0.6.0)

nearest_neighbors: 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)

Value

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

Arguments

forecast

A knnForecast object.

Examples

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

Run the code above in your browser using DataLab