Skip to main content

A New Forecasting Algorithm Based on Neighbors for Streaming Electricity Time Series

  • Conference paper
  • First Online:
Hybrid Artificial Intelligent Systems (HAIS 2020)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 12344))

Included in the following conference series:


This work presents a new forecasting algorithm for streaming electricity time series. This algorithm is based on a combination of the K-means clustering algorithm along with both the Naive Bayes classifier and the K nearest neighbors algorithm for regression. In its offline phase it firstly divide data into clusters. Then, the nearest neighbors algorithm is applied for each cluster producing a list of trained regression models, one per each cluster. Finally, a Naive Bayes classifier is trained for predicting the cluster label of an instance using as training the cluster assignments previously generated by K-means. The algorithm is able to be updated incrementally for online learning from data streams. The proposed algorithm has been tested using electricity consumption with a granularity of 10 min for 4-h-ahead predicting. Our algorithm widely overcame other four well-known effective online learners used as benchmark algorithms, achieving the smallest error.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
EUR 32.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others


  1. Box, G., Jenkins, G.: Time Series Analysis: Forecasting and Control. John Wiley, Hoboken (2008)

    Book  Google Scholar 

  2. Martínez-Álvarez, F., Troncoso, A., Asencio-Cortés, G., Riquelme, J.C.: A survey on data mining techniques applied to electricity-related time series forecasting. Energies 8(11), 13162–13193 (2015)

    Article  Google Scholar 

  3. Pérez-Chacón, R., Luna-Romera, J.M., Troncoso, A., Martínez-Álvarez, F., Riquelme, J.C.: Big data analytics for discovering electricity consumption patterns in smart cities. Energies 11, 683 (2018)

    Article  Google Scholar 

  4. Torres, J.F., Galicia, A., Troncoso, A., Martínez-Álvarez, F.: A scalable approach based on deep learning for big data time series forecasting. Integr. Comput.-Aided Eng. 25(4), 335–348 (2018)

    Article  Google Scholar 

  5. Galicia, A., Torres, J.F., Martínez-Álvarez, F., Troncoso, A.: A novel spark-based multi-step forecasting algorithm for big data time series. Inf. Sci. 467, 800–818 (2018)

    Article  Google Scholar 

  6. Laurinec, P., Lucká, M.: Interpretable multiple data streams clustering with clipped streams representation for the improvement of electricity consumption forecasting. Data Mining Knowl. Disc. 33(2), 413–445 (2018).

    Article  MathSciNet  Google Scholar 

  7. Luo, H., Cai, H., Yu, H., Sun, Y., Bi, Z., Jiang, L.: A short-term energy prediction system based on edge computing for smart city. Fut. Gener. Comput. Syst. 101, 444–457 (2019)

    Article  Google Scholar 

  8. Kwak, Y., Seo, D., Jang, C., Huh, J.-H.: Feasibility study on a novel methodology for short-term real-time energy demand prediction using weather forecasting data. Energy Build. 57, 250–260 (2013)

    Article  Google Scholar 

  9. Ahmad, T., Chen, H.: A review on machine learning forecasting growth trends and their real-time applications in different energy systems. Sustain. Cities Soc. 54, 102010 (2020)

    Article  Google Scholar 

  10. Gama, J., Rodrigues, P.P.: Stream-based electricity load forecast. In: Proceedings of the Knowledge Discovery in Databases, pp. 446–453 (2007)

    Google Scholar 

  11. MacQueen, J.: Some methods for classification and analysis of multivariate observations. In: Proceedings of the 5th Berkeley Symposium on Mathematical Statistics and Probability, vol. 1, pp. 281–297 (1967)

    Google Scholar 

  12. John, G.H., Langley, P.: Estimating continuous distributions in bayesian classifiers. In: Proceedings of the 11th Conference on Uncertainty in Artificial Intelligence, pp. 338–345 (1995)

    Google Scholar 

  13. Aha, D., Kibler, D.: Instance-based learning algorithms. Mach. Learn. 6, 37–66 (1991)

    MATH  Google Scholar 

  14. Bifet, A., Holmes, G., Kirkby, R., Pfahringer, B.: MOA: massive online analysis. J. Mach. Learn. Res. 11, 1601–1604 (2010)

    Google Scholar 

  15. Ikonomovska, E., Gama, J., Džeroski, S.: Learning model trees from evolving data streams. Data Mining Knowl. Disc. 23(1), 128–168 (2011)

    Article  MathSciNet  Google Scholar 

  16. Duchi, J., Hazan, E., Singer, Y.: Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res. 12, 2121–2159 (2011)

    MathSciNet  MATH  Google Scholar 

  17. Almeida, E., Ferreira, C., Gama, J.: Adaptive model rules from data streams. In: Proceedings of the Machine Learning and Knowledge Discovery in Databases, pp. 480–492 (2013)

    Google Scholar 

  18. Basseville, M.: Detecting changes in signals and systems-a survey. Automatica 24(3), 309–326 (1988)

    Article  MathSciNet  Google Scholar 

  19. Bifet, A., Holmes, G., Pfahringer, B., Frank, E.: Fast perceptron decision tree learning from evolving data streams. In: Proceedings of the Advances in Knowledge Discovery and Data Mining, pp. 299–310 (2010)

    Google Scholar 

  20. Hulten, G., Spencer, L., Domingos, P.: Mining time-changing data streams. In: Proceedings of the Knowledge Discovery on Databases, pp. 97–106 (2001)

    Google Scholar 

Download references


The authors would like to thank the Spanish Ministry of Science, Innovation and Universities for the support under the project TIN2017-88209-C2-1-R.

Author information

Authors and Affiliations


Corresponding author

Correspondence to A. Troncoso .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Jiménez-Herrera, P., Melgar-García, L., Asencio-Cortés, G., Troncoso, A. (2020). A New Forecasting Algorithm Based on Neighbors for Streaming Electricity Time Series. In: de la Cal, E.A., Villar Flecha, J.R., Quintián, H., Corchado, E. (eds) Hybrid Artificial Intelligent Systems. HAIS 2020. Lecture Notes in Computer Science(), vol 12344. Springer, Cham.

Download citation

  • DOI:

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-61704-2

  • Online ISBN: 978-3-030-61705-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics