IDEAS home Printed from https://ideas.repec.org/a/gam/jeners/v18y2025i17p4611-d1738098.html
   My bibliography  Save this article

Forecasting Power Quality Parameters Using Decision Tree and KNN Algorithms in a Small-Scale Off-Grid Platform

Author

Listed:
  • Ibrahim Jahan

    (ENET Centre, CEET, VSB—Technical University of Ostrava, 17. Listopadu 2172/15, 708 00 Ostrava, Czech Republic
    Libyan Authority for Scientific Research, Zawia Str., Tripoli P.O Box 80045, Libya
    These authors contributed equally to this work.)

  • Vojtech Blazek

    (ENET Centre, CEET, VSB—Technical University of Ostrava, 17. Listopadu 2172/15, 708 00 Ostrava, Czech Republic
    These authors contributed equally to this work.)

  • Wojciech Walendziuk

    (Faculty of Electrical Engineering, Bialystok University of Technology, ul. Wiejska 45A, 15-351 Bialystok, Poland
    These authors contributed equally to this work.)

  • Vaclav Snasel

    (Computer Science Department, Faculty of Electrical Engineering and Computer Science, VSB—Technical University of Ostrava, 708 00 Ostrava, Czech Republic
    These authors contributed equally to this work.)

  • Lukas Prokop

    (ENET Centre, CEET, VSB—Technical University of Ostrava, 17. Listopadu 2172/15, 708 00 Ostrava, Czech Republic)

  • Stanislav Misak

    (ENET Centre, CEET, VSB—Technical University of Ostrava, 17. Listopadu 2172/15, 708 00 Ostrava, Czech Republic)

Abstract

This article presents the results of a performance comparison of four forecasting methods for prediction of electric power quality parameters (PQPs) in small-scale off-grid environments. Forecasting PQPs is crucial in supporting smart grid control and planning strategies by enabling better management, enhancing system reliability, and optimizing the integration of distributed energy resources. The following methods were compared: Bagging Decision Tree (BGDT), Boosting Decision Tree (BODT), and the K-Nearest Neighbor (KNN) algorithm with k − 5 and k − 10 nearest neighbors considered by the algorithm when making a prediction. The main goal of this study is to find a relation between the input variables (weather conditions, first and second back steps of PQPs, and consumed power of home appliances) and the power quality parameters as target outputs. The studied PQPs are the amplitude of power voltage ( U ), Voltage Total Harmonic Distortion ( T H D u ), Current Total Harmonic Distortion ( T H D i ), Power Factor ( P F ), and Power Load ( P L ). The Root Mean Square Error (RMSE) was used to evaluate the forecasting results. BGDT accomplished better forecasting results for T H D u , T H D i , and P F . Only BODT obtained a good forecasting result for P L . The KNN ( k = 5) algorithm obtained a good result for P F prediction. The KNN ( k = 10) algorithm predicted acceptable results for U and P F . The computation time was considered, and the KNN algorithm took a shorter time than ensemble decision trees.

Suggested Citation

  • Ibrahim Jahan & Vojtech Blazek & Wojciech Walendziuk & Vaclav Snasel & Lukas Prokop & Stanislav Misak, 2025. "Forecasting Power Quality Parameters Using Decision Tree and KNN Algorithms in a Small-Scale Off-Grid Platform," Energies, MDPI, vol. 18(17), pages 1-27, August.
  • Handle: RePEc:gam:jeners:v:18:y:2025:i:17:p:4611-:d:1738098
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/1996-1073/18/17/4611/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/1996-1073/18/17/4611/
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Wang, Yi & Von Krannichfeldt, Leandro & Zufferey, Thierry & Toubeau, Jean-François, 2021. "Short-term nodal voltage forecasting for power distribution grids: An ensemble learning approach," Applied Energy, Elsevier, vol. 304(C).
    2. Ibrahim Salem Jahan & Vojtech Blazek & Stanislav Misak & Vaclav Snasel & Lukas Prokop, 2022. "Forecasting of Power Quality Parameters Based on Meteorological Data in Small-Scale Household Off-Grid Systems," Energies, MDPI, vol. 15(14), pages 1-20, July.
    3. Matej Žnidarec & Zvonimir Klaić & Damir Šljivac & Boris Dumnić, 2019. "Harmonic Distortion Prediction Model of a Grid-Tie Photovoltaic Inverter Using an Artificial Neural Network," Energies, MDPI, vol. 12(5), pages 1-19, February.
    4. Abou Houran, Mohamad & Salman Bukhari, Syed M. & Zafar, Muhammad Hamza & Mansoor, Majad & Chen, Wenjie, 2023. "COA-CNN-LSTM: Coati optimization algorithm-based hybrid deep learning model for PV/wind power forecasting in smart grid applications," Applied Energy, Elsevier, vol. 349(C).
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Cheng, Fang & Liu, Hui, 2024. "Multi-step electric vehicles charging loads forecasting: An autoformer variant with feature extraction, frequency enhancement, and error correction blocks," Applied Energy, Elsevier, vol. 376(PB).
    2. Yu, Sheng & He, Bin & Fang, Lei, 2025. "Multi-step short-term forecasting of photovoltaic power utilizing TimesNet with enhanced feature extraction and a novel loss function," Applied Energy, Elsevier, vol. 388(C).
    3. Wang, Wenhao & Tang, Aihong & Wei, Feng & Yang, Huiyuan & Xinran, Li & Peng, Jiao, 2025. "Electric vehicle charging load forecasting considering weather impact," Applied Energy, Elsevier, vol. 383(C).
    4. Chen, Fuhao & Yan, Jie & Liu, Yongqian & Yan, Yamin & Tjernberg, Lina Bertling, 2024. "A novel meta-learning approach for few-shot short-term wind power forecasting," Applied Energy, Elsevier, vol. 362(C).
    5. Yang, Mao & Guo, Yunfeng & Huang, Tao & Fan, Fulin & Ma, Chenglian & Fang, Guozhong, 2024. "Wind farm cluster power prediction based on graph deviation attention network with learnable graph structure and dynamic error correction during load peak and valley periods," Energy, Elsevier, vol. 312(C).
    6. Lin, Huapeng & Gao, Liyuan & Cui, Mingtao & Liu, Hengchao & Li, Chunyang & Yu, Miao, 2025. "Short-term distributed photovoltaic power prediction based on temporal self-attention mechanism and advanced signal decomposition techniques with feature fusion," Energy, Elsevier, vol. 315(C).
    7. Huang, Songtao & Zhou, Qingguo & Shen, Jun & Zhou, Heng & Yong, Binbin, 2024. "Multistage spatio-temporal attention network based on NODE for short-term PV power forecasting," Energy, Elsevier, vol. 290(C).
    8. Khan, Zulfiqar Ahmad & Khan, Shabbir Ahmad & Hussain, Tanveer & Baik, Sung Wook, 2024. "DSPM: Dual sequence prediction model for efficient energy management in micro-grid," Applied Energy, Elsevier, vol. 356(C).
    9. Gong, Bin & An, Aimin & Shi, Yaoke & Guan, Haijiao & Jia, Wenchao & Yang, Fazhi, 2024. "An interpretable hybrid spatiotemporal fusion method for ultra-short-term photovoltaic power prediction," Energy, Elsevier, vol. 308(C).
    10. Wang, Da & Yang, Mao & Zhang, Wei & Ma, Chenglian & Su, Xin, 2025. "Short-term power prediction method of wind farm cluster based on deep spatiotemporal correlation mining," Applied Energy, Elsevier, vol. 380(C).
    11. Seyed Morteza Moghimi & Thomas Aaron Gulliver & Ilamparithi Thirumarai Chelvan & Hossen Teimoorinia, 2025. "Occupant-Centric Load Optimization in Smart Green Townhouses Using Machine Learning," Energies, MDPI, vol. 18(13), pages 1-15, June.
    12. Jiahui Wang & Mingsheng Jia & Shishi Li & Kang Chen & Cheng Zhang & Xiuyu Song & Qianxi Zhang, 2024. "Short-Term Power-Generation Prediction of High Humidity Island Photovoltaic Power Station Based on a Deep Hybrid Model," Sustainability, MDPI, vol. 16(7), pages 1-24, March.
    13. Leijiao Ge & Tianshuo Du & Changlu Li & Yuanliang Li & Jun Yan & Muhammad Umer Rafiq, 2022. "Virtual Collection for Distributed Photovoltaic Data: Challenges, Methodologies, and Applications," Energies, MDPI, vol. 15(23), pages 1-24, November.
    14. Ming Cheng & Qiang Zhang & Yue Cao, 2024. "An Early Warning Model for Turbine Intermediate-Stage Flux Failure Based on an Improved HEOA Algorithm Optimizing DMSE-GRU Model," Energies, MDPI, vol. 17(15), pages 1-16, July.
    15. Peng, Simin & Zhu, Junchao & Wu, Tiezhou & Yuan, Caichenran & Cang, Junjie & Zhang, Kai & Pecht, Michael, 2024. "Prediction of wind and PV power by fusing the multi-stage feature extraction and a PSO-BiLSTM model," Energy, Elsevier, vol. 298(C).
    16. Xie, Yang & Zheng, Jianyong & Mei, Fei & Taylor, Gareth & Gao, Ang, 2025. "An efficient approach for regional photovoltaic power forecasting optimization based on texture features from satellite images and transfer learning," Applied Energy, Elsevier, vol. 385(C).
    17. Chen, Yuejiang & Xiao, Jiang-Wen & Wang, Yan-Wu & Luo, Yunfeng, 2025. "Non-crossing quantile probabilistic forecasting of cluster wind power considering spatio-temporal correlation," Applied Energy, Elsevier, vol. 377(PA).
    18. Yang, Mao & Jiang, Yue & Zhang, Wei & Li, Yi & Su, Xin, 2024. "Short-term interval prediction strategy of photovoltaic power based on meteorological reconstruction with spatiotemporal correlation and multi-factor interval constraints," Renewable Energy, Elsevier, vol. 237(PC).
    19. Lakhdar Nadjib Boucetta & Youssouf Amrane & Aissa Chouder & Saliha Arezki & Sofiane Kichou, 2024. "Enhanced Forecasting Accuracy of a Grid-Connected Photovoltaic Power Plant: A Novel Approach Using Hybrid Variational Mode Decomposition and a CNN-LSTM Model," Energies, MDPI, vol. 17(7), pages 1-21, April.
    20. Xu, Aiting & Chen, Jiapeng & Li, Jinchang & Chen, Zheyu & Xu, Shenyi & Nie, Ying, 2025. "Multivariate rolling decomposition hybrid learning paradigm for power load forecasting," Renewable and Sustainable Energy Reviews, Elsevier, vol. 212(C).

    More about this item

    Keywords

    ;
    ;
    ;
    ;
    ;

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jeners:v:18:y:2025:i:17:p:4611-:d:1738098. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.