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

Hybrid Forecasting for Energy Consumption in South Africa: LSTM and XGBoost Approach

Author

Listed:
  • Thokozile Mazibuko

    (Department of Electrical Power Engineering, Durban University of Technology, Durban 4001, South Africa)

  • Kayode Akindeji

    (Department of Electrical Power Engineering, Durban University of Technology, Durban 4001, South Africa)

Abstract

The precise forecasting of renewable energy production and usage is essential for the stability, efficiency, and sustainability of contemporary power systems. This requirement is especially urgent in South Africa, a nation currently grappling with considerable energy issues, such as recurrent load shedding, outdated coal-fired power plants, and an increasing electricity demand. As the country moves towards a more renewable-focused energy portfolio, the capacity to anticipate future energy requirements is crucial for effective planning, operational stability, and grid resilience. This study introduces a hybrid approach that combines deep learning and machine learning techniques, specifically integrating long short-term memory (LSTM) neural networks with extreme gradient boosting (XGBoost) to provide more accurate and detailed forecasts of energy demand. LSTM networks are particularly effective in capturing long-term temporal dependencies in sequential data, such as patterns of energy usage. At the same time, XGBoost delivers high-performance gradient-boosted decision trees that can manage non-linear relationships and noise present in extensive datasets. The proposed hybrid LSTM-XGBoost model was trained and assessed using high-resolution data on energy consumption and weather conditions gathered from a coastal municipality in KwaZulu-Natal, South Africa, a country that exemplifies the convergence of renewable energy potential and challenges related to energy reliability. The preprocessing steps, including normalization, feature selection, and sequence modeling, were implemented to enhance the input data for both models. The performance of the model was thoroughly evaluated using standard statistical metrics, specifically the mean absolute error (MAE), the root mean squared error (RMSE), and the coefficient of determination (R 2 ). The hybrid model achieved an MAE of merely 192.59 kWh and an R 2 of approximately 0.71, significantly surpassing the performance of the individual LSTM and XGBoost models. These findings highlight the enhanced predictive capabilities of the hybrid model in capturing both temporal trends and feature interactions in energy consumption behavior.

Suggested Citation

  • Thokozile Mazibuko & Kayode Akindeji, 2025. "Hybrid Forecasting for Energy Consumption in South Africa: LSTM and XGBoost Approach," Energies, MDPI, vol. 18(16), pages 1-25, August.
  • Handle: RePEc:gam:jeners:v:18:y:2025:i:16:p:4285-:d:1722558
    as

    Download full text from publisher

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

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

    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:16:p:4285-:d:1722558. 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.

    We have no bibliographic references for this item. You can help adding them by using 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.