[Paper Review] Applying k-nearest neighbors to time series forecasting : two new approaches
This paper proposes two novel k-nearest neighbors (k-NN) approaches for time series forecasting: Classical Parameters Tuning in Weighted Nearest Neighbors (CPTO-WNN) and Fast Parameters Tuning in Weighted Nearest Neighbors (FPTO-WNN). CPTO-WNN compares the most recent subsequence with all past subsequences of the same length to select neighbors, while FPTO-WNN reduces the search space to lower computational cost. Both methods use a cross-validation-inspired tuning process for optimal k and feature selection, demonstrating superior accuracy over SARIMA, Holt-Winters, and ETS models on real U.S. retail and U.K. milk production data.
K-nearest neighbors algorithm is one of the prominent techniques used in classification and regression. Despite its simplicity, the k-nearest neighbors has been successfully applied in time series forecasting. However, the selection of the number of neighbors and feature selection is a daunting task. In this paper, we introduce two methodologies to forecasting time series that we refer to as Classical Parameters Tuning in Weighted Nearest Neighbors and Fast Parameters Tuning in Weighted Nearest Neighbors. The first approach uses classical parameters tuning that compares the most recent subsequence with every possible subsequence from the past of the same length. The second approach reduces the neighbors' search set, which leads to significantly reduced grid size and hence a lower computational time. To tune the models' parameters, both methods implement an approach inspired by cross-validation for weighted nearest neighbors. We evaluate the forecasting performance and accuracy of our models. Then, we compare them to some classical approaches, especially, Seasonal Autoregressive Integrated Moving Average, Holt-Winters and Exponential Smoothing State Space Model. Real data examples on retail and food services sales in the USA and milk production in the UK are analyzed to demonstrate the application and the efficiency of the proposed approaches.
Motivation & Objective
- Address the challenge of selecting optimal k and features in k-NN for time series forecasting, which significantly impacts model performance.
- Reduce computational burden in k-NN-based forecasting by limiting the neighbor search set without sacrificing accuracy.
- Develop automated, robust parameter tuning procedures for weighted k-NN models using a cross-validation-inspired approach.
- Evaluate the proposed methods against classical time series models like SARIMA, Holt-Winters, and ETS on real-world datasets.
- Demonstrate the effectiveness and efficiency of the proposed approaches on diverse time series data, including retail sales and milk production.
Proposed method
- CPTO-WNN performs a full comparison of the most recent subsequence with every possible past subsequence of the same length to identify the k-nearest neighbors.
- FPTO-WNN reduces the neighbor search set to significantly decrease computational time while maintaining forecasting accuracy.
- Both methods use a modified cross-validation technique to tune the number of neighbors (k) and select relevant features by minimizing average error across test sets.
- The forecasting is based on weighted averages of the next values of the k-nearest subsequences, where weights are inversely proportional to distance.
- Feature selection is integrated into the tuning process to improve model performance by focusing on informative subsequences.
- The methods are applied to real datasets: U.S. Retail and Food Services Sales and U.K. Cow’s Milk Production, using MAPE as the primary accuracy metric.
Experimental results
Research questions
- RQ1Can a systematic parameter tuning approach improve k-NN forecasting performance in time series by optimizing k and feature selection?
- RQ2How does the computational cost of full neighbor search in k-NN affect scalability, and can it be reduced without degrading accuracy?
- RQ3How do the proposed CPTO-WNN and FPTO-WNN methods compare in accuracy and efficiency to classical models like SARIMA, Holt-Winters, and ETS?
- RQ4Does the proposed cross-validation-inspired tuning procedure consistently yield better forecasting results than default or heuristic parameter choices?
- RQ5How does model performance vary across different forecast horizons, and which method maintains robustness over longer horizons?
Key findings
- CPTO-WNN outperforms FPTO-WNN, SARIMA, Holt-Winters, and ETS in terms of MAPE across multiple forecast horizons on U.S. Retail and Food Services Sales data.
- On the U.K. milk production dataset, both CPTO-WNN and FPTO-WNN significantly outperform SARIMA, Holt-Winters, and ETS across all horizons, with FPTO-WNN showing the lowest computational cost.
- For the U.S. retail data, CPTO-WNN achieves the lowest MAPE (1.285574) at horizon 7, while FPTO-WNN achieves 1.371099, both outperforming ETS (1.519837) and SARIMA (1.588464).
- The Holt-Winters method fails to converge at horizons 1 and 2 in the U.S. retail data, indicating instability under the proposed tuning framework.
- As forecast horizon increases, MAPE increases across all models, but CPTO-WNN and FPTO-WNN maintain significantly lower error rates than classical models.
- FPTO-WNN is computationally more efficient than CPTO-WNN due to its reduced neighbor search space, making it suitable for large-scale or real-time applications.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.