Please write python code for Time Series Modelling using k-Nearest Neighbour Algorithm
Describe in detail how the k-nearest neighbour algorithm can be used in time series modelling. In your discussion,
you must consider the following two approaches to time series modelling:
_ Prediction of the next value in the time-series, i.e. it is a regression problem.
_ Prediction of trends, where trends are Up, Down and No Change, i.e. it is a classi_cation problem.
In your discussion, consider the impact of the number of neighbours.