nearest_neighbors function

Nearest neighbors associated with predictions

Nearest neighbors associated with predictions

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

nearest_neighbors(forecast)

Arguments

  • forecast: A knnForecast object.

Returns

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)