https://github.com/cran/tsfknn
Raw File
Tip revision: 71a26cefc92d5de046b866de5dde4f749c6dcf72 authored by Francisco Martinez on 20 December 2023, 16:20:02 UTC
version 0.6.0
Tip revision: 71a26ce
README.md
# tsfknn

The goal of tsfknn is to forecast time series using KNN regression

## Installation

You can install tsfknn from github with:

``` r
# install.packages("devtools")
devtools::install_github("franciscomartinezdelrio/tsfknn")
```

## Example

This is a basic example which shows you how to forecast with tsfknn:

``` r
library(tsfknn)
pred <- knn_forecasting(USAccDeaths, h = 12, k = 3)
pred$prediction # To see a time series with the forecasts
plot(pred) # To see a plot with the forecast
library(ggplot2)
autoplot(pred, highlight = "neighbors")  # To see the nearest neighbors
```
back to top