Next Article in Journal
The Role of Procedure Duration in the Sustainability Assessment of Contaminated Site Management in Italy
Previous Article in Journal
The Effect of Organic Lake Sediments (Sapropel) on the Properties and Biological Resistance of Unfired Clay Bricks
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Intelligent Hybrid Machine Learning Model for Sustainable Forecasting of Home Energy Demand and Electricity Price

1
School of Engineering, RMIT University, Melbourne 3000, Australia
2
School of Engineering, Deakin University, Geelong 3217, Australia
3
Department of Artificial Intelligence, School of Electronics Engineering, Kyungpook National University, Daegu 37224, Republic of Korea
*
Author to whom correspondence should be addressed.
Sustainability 2024, 16(6), 2328; https://doi.org/10.3390/su16062328
Submission received: 17 January 2024 / Revised: 2 March 2024 / Accepted: 6 March 2024 / Published: 12 March 2024
(This article belongs to the Section Energy Sustainability)

Abstract

:
Home energy systems (HESs) face challenges, including high energy costs, peak load impact, and reliability issues associated with grid connections. To address these challenges, homeowners can implement solutions such as energy management, renewable resources, and energy storage technologies. Understanding consumption patterns and optimizing HES operations are crucial for effective energy management. As a primary step, addressing these concerns requires an efficient forecasting tool to predict home energy demand and electricity prices. Due to the complexity of big data, and uncertainties involved in forecasting, machine learning (ML) methods are necessary. In this study, we develop a hybrid machine learning approach, utilizing one year of data on home energy demand and prices to address the challenge of forecasting home energy consumption. A comprehensive comparison of different deep and non-deep ML models highlights the superiority of the proposed hybrid approach. The performance of these models, measured using metrics such as RMSE, MAE, R2, and RT (running time), are compared. Finally, an optimized hybrid XGBoost (XGB) ML model that combines price and energy demand forecasting is introduced. The proposed ML method’s parameters are optimally determined using Particle Swarm Optimization. The hybrid ML model’s performance is evaluated in predicting both energy demand and consumption prices using historical data from diverse households with various features and consumption patterns. The results indicate that the hybrid ML model achieves accurate predictions for energy consumption and prices, with improvements in RMSE (up to 36.6%), MAE (up to 36.8%), and R2 (up to 3.9), as compared to conventional ML methods. This research contributes to sustainable energy practices by providing an effective tool for forecasting energy consumption and associated costs in the dynamic landscape of home energy systems.

1. Introduction

The building and construction sectors collectively account for approximately 36% of global primary energy consumption and nearly 40% of total direct and indirect carbon dioxide (CO2) emissions worldwide. Additionally, the growth in global electricity demand is projected to increase from 2.6% in 2023 to an average of 3.2% in 2024–2025 [1]. Therefore, managing energy consumption is a crucial task for policymakers and homeowners, as they face a range of challenges, including rising energy costs, grid peak loads, and environmental concerns [2,3]. Accurate household energy forecasting is vital in addressing these challenges, providing homeowners with the information they need to identify potential energy-saving opportunities, optimize the utilization of renewable energy sources, and efficiently manage their energy usage to reduce expenses and contribute to a sustainable and resilient energy system.
Energy demand forecasting studies can generally be categorized into two types: the white box model and the black box model [4]. The first category is based on the physical method and requires numerous detailed features, often associated with limited data and experiments. The second category mainly involves learning methods, dealing with the complexity of big data and uncertainties, including artificial neural networks (ANNs), multiple linear regression, etc. Learning forecasting methods can be divided into three categories: time-series approaches, regression-based methods, and artificial intelligence (AI) methods [5].
Time-series approaches focus on analyzing patterns within historical data over time [5]. Techniques such as moving averages, exponential smoothing, Autoregressive Integrated Moving Average (ARIMA), and seasonal decomposition are commonly employed in time-series forecasting [6,7]. Regression-based methods aim to establish relationships between a dependent variable (the variable to be predicted) and independent variables (features or predictors). Linear regression, polynomial regression, multiple regression, and regularization techniques like ridge and lasso regression are examples of regression-based forecasting methods [8]. These models are particularly useful when there is a clear relationship between input features and the response variable being predicted. AI methods leverage advanced computational techniques, including various ML algorithms and ANNs [9,10].
Employing ML algorithms to analyze large datasets is a common solution for identifying trends and patterns that can be used to make accurate predictions [11]. The use of ML algorithms for price and demand forecasting has gained considerable attention in recent years. Many studies have demonstrated the potential of ML techniques in analyzing large datasets of energy consumption patterns and making accurate predictions.
Various ML models have been applied in the realm of home energy consumption considering big data due to several factors. These include the presence of nonlinear relationships and noise within the data, along with ML models’ proficiency in capturing complex numerical patterns and handling feature interactions effectively. Among the ML models frequently utilized in this domain are ANN, XGB, Feed Forward Neural Network (FFNN), Random Forest (RF), Long Short-Term Memory (LSTM), Support Vector Regression (SVR), and Gradient Boosting (GB). These models have found widespread use in home demand forecasting.
It is worth noting that optimization methods can be highly time-consuming and ineffective when dealing with big data in a dynamic and uncertain environment. Therefore, it is crucial to select ML models with reasonable running times to ensure that robust solutions are obtained. Consequently, we have opted for a subset of well-established ML models known for their efficiency in fast training, including RF, GB, XGB, and SVR.
SVR is a widely utilized ML technique known for its effectiveness in handling nonlinear data. Meng et al. conducted a study employing SVR to analyze historical energy consumption data, demonstrating its superiority over other linear regression methods in energy consumption prediction [12]. Chen et al. proposed an SVR model for short-term load forecasting in office buildings, and their results indicated the model’s superiority over seven other methods [13]. Asl et al. compared the performance of SVR, ANN, and Fuzzy Rule-Based systems for forecasting household electricity consumption in the Honda Smart Home, considering external factors such as outdoor temperature and humidity, as well as the average power consumption of devices [14]. The results demonstrated that SVR generally outperformed other regression methods. In a study by [15], SVR was employed for the hourly prediction of residential building consumption in Austin. The study compared SVR with RF and other conventional time-series methods, revealing SVR’s superior performance over the benchmarks. For optimizing the parameters of an SVR, Li et al. used diverse metaheuristic optimization algorithms for short-term load forecasting [16]. A hybrid method using the Manta Ray Foraging Optimization (MRFO) algorithm and SVR was applied. The results showed that the hybrid method (SVR-MRFO) as the optimizer of SVR is more efficient than using other optimization methods.
RF is frequently applied for electricity consumption prediction owing to its simplicity and interpretability as a decision tree derivative technique. Previous research has extensively employed RF for this purpose, as demonstrated by studies conducted by [17,18,19,20,21]. For example, Ahmad et al. conducted a comparative analysis of ANN and RF in predicting the hourly HVAC energy consumption of a hotel in Madrid [17]. The results indicated that both methods performed similarly, but RF exhibited shorter training times. In a study by [18], various models, including Support Vector Machine (SVM), ANN, and RF, were employed to predict electricity consumption across different time resolutions. The experimental findings revealed that the RF-based model demonstrated the fewest errors and the highest correlation between measured and predicted values. Dudek evaluated the performance of RFs for electricity consumption prediction at a granular level, considering individual household consumption [19]. The study explored the impact of various input features, such as calendar and environmental data, on prediction accuracy. The results demonstrated that RF outperformed other techniques, including ANN, classification and regression tree (CART), ARIMA, and exponential smoothing, highlighting its efficiency for short-term electricity consumption prediction.
Gradient Boosting, an ensemble technique, has also gained attention in various studies, particularly in the context of electricity consumption prediction. Notably, Gradient-Boosting algorithms such as XGB and LightGBM have been explored, enhancing prediction accuracy compared to linear regression, especially when dealing with complex and nonlinear relationships between variables [22]. Touzani et al. studied the application of Gradient Boosting for short-term electricity consumption forecasting in commercial buildings, comparing its performance with linear regression and RF [23]. The results affirmed the superiority of Gradient Boosting over the other methods. In a study by Ribeiro et al., the performance of SVR, RF, and XGB, alongside three deep learning models including Recurrent Neural Networks (RNNs), LSTM, and Gated Recurrent Unit (GRU), as well as ARIMA, were studied for predicting daily energy consumption in a warehouse [24]. The findings revealed that the proposed XGB model outperforms other models for both very short-term load forecasting (VSTLF) and short-term load forecasting (STLF). Qinghe et al. conducted a comparative study of XGB with tuned parameters against the linear regression method for predicting electricity consumption using a dataset with 30 min intervals over a couple of years [25]. The results confirmed that the proposed method outperformed the benchmarks.
Reddy et al. applied XGB as part of a stacking ensemble method for short-term energy forecasting [26]. The results demonstrated that the proposed approach outperformed individual models, achieving outstanding performance in accurately forecasting household electricity consumption. The scalability and efficiency of XGB make it a valuable tool for handling large-scale household energy datasets. A similar study by Divina et al., focused on short-term consumption forecasting using a stacking ensemble learning technique [27]. The proposed stacking method outperformed the other methods when evaluated with a dataset for energy consumption in Spain over nine years.
In addition to ML methods, researchers have investigated the performance of deep learning methods in forecasting electricity consumption. Many studies explore the use of ANNs and their derivatives for predicting short-term consumption. For instance, Khawaja et al. explored improving short-term electricity load forecasting using ANN-based ensemble ML [28]. Ryu et al. proposed a deep neural network (DNN) forecasting model to predict short-term electricity consumption, and the results showed that the proposed method outperformed others, including conventional neural network and regression methods [29]. Similarly, Rahman et al. conducted a comparative analysis of ANN and Recurrent Neural Network (RNN) for predicting electric consumption of a public safety building at one-hour intervals [30]. The results indicated that the proposed RNN method outperformed the conventional ANN. Furthermore, a study by Solyali investigated the performance of ML and deep learning methods to forecast electricity price and load in North Cyprus [31]. The results demonstrated that both SVR and ANN produced effective forecasting results compared to other benchmarks.
The literature review reveals that ANNs have shown promise in predicting electricity consumption. With their ability to capture complex relationships and provide accurate forecasts, ANNs are popular choices in forecasting electricity consumption. However, proper data collection, the tuning of parameters, and regularization techniques are crucial for achieving optimal performance.
LSTM, a type of RNN, is specifically designed for analyzing sequence data, making it particularly suitable for time-series forecasting. It addresses the limitations of traditional RNNs, such as the vanishing gradient problem, which hinders the capture of long-term dependencies in time-series data. Due to its ability to effectively capture patterns and trends over varying time intervals, LSTM is often employed in short-term household electricity consumption analysis. For instance, Zang et al. developed a hybrid model using LSTM and Self Attention Mechanism (SAM) to forecast residential loads for the following day, incorporating weather conditions as model features [32]. The study demonstrated that the proposed model outperformed other benchmarks. Additionally, Kong explored residential load forecasting based on resident behavior, designing an LSTM-based model and comparing its performance with a Feedforward Neural Network (FFNN) and KNN [33]. The results highlighted the superiority of the proposed LSTM model over the benchmark models. In a comprehensive review by Lu, analyzing articles from 2016 to 2021 that utilized ANN-driven methods for building energy prediction, it was observed that LSTM models generally achieved effective solutions with higher accuracy and lower error margins compared to other ANN-based methods [34].
The use of stacking techniques, especially in the context of household electricity consumption forecasting, has gained research attention [16,21,22]. This approach aims to enhance forecasting accuracy by leveraging the strengths of individual models. Stacking shapes its reproductions using diverse learning algorithms and then a combiner algorithm is skilled to make the final forecasts using the forecasts made by the base algorithms. This combiner can be any ensemble technique [27]. For instance, Sujan Reddy applied a combined approach of Gradient Boosting and XGB in short-term energy forecasting, demonstrating that the proposed stacking-based method exhibits outstanding performance [26]. Jihoon Moon et al. also employed the stacking method, combining a DNN with different hidden levels, showcasing its superior performance compared to other methods [21]. This approach contributes to the advancement of household energy forecasting by enabling more accurate predictions and facilitating better energy management decisions.
For daily, weekly, and monthly energy consumption prediction, Nazir et al. utilized a model using the Temporal Fusion Transformer, which considers both primary and valuable data sources and batch training techniques [35]. Ghenai et al. suggested the forecasting model of ANN self-learning capacity with fuzzy inference’s language expression function [36]. They selected the very short-term forecasting of the energy consumption for the forecasting horizon. Lee et al. applied well-known ML algorithms consisting of the decision tree (DT), SVM, Extra trees (ET), RF, Gradient Boosting, CatBoost, and XGB to investigate their performances for predicting the price-setting scheduled energy [37]. Zhang et al. proposed a novel hybrid deep-learning framework for day-ahead electricity price forecasting in the concept of feature pre-processing and a deep-learning-based point prediction module [38]. Bibi et al. suggested an ensemble-based technique for forecasting short-term electricity spot prices in the Italian electricity market [39]. The ensemble model was combined with an autoregressive moving average (ARMA) and different ML models. The results indicated that the ensemble-based model outperforms the others, while the RF and ARMA are highly competitive.
In summary, the literature suggests that ML is a powerful tool for household energy forecasting. However, the effectiveness of these algorithms depends on various factors, including the quality and quantity of available data, the selection of parameters, and the inclusion of relevant features. This review also highlights the critical role of parameter optimization in enhancing performance.
Regarding parameter tuning, various algorithms have been applied to improve the results by enhancing the hyper-parameters. This includes Particle Swarm Optimization (PSO) [40,41], Differential Evolution (DE) [42,43], and Artificial Bee Colony (ABC) Optimization [41], all confirmed to improve the accuracy and robustness of ML models. Additionally, the Genetic Algorithm (GA) has been effective in identifying the optimal combination of hyperparameters for common ML and ensemble methods [22]. Bouktif et al. used a GA and PSO to learn hyper-parameters in the LSTM-RNN model for load forecasting in the context of energy consumption of big data [40]. Gundu and Simon presented a model for electricity price forecasting through a PSO-based LSTM neural network [44]. PSO is normally used to optimize the LSTM network input weights.
The combination of price and demand forecasting, along with the consideration of their interaction, has garnered increased attention in recent years. In power load forecasting, many investigations typically incorporate historical load patterns, climatic conditions, and socio-economic factors, among others. However, in the context of smart grids, demand response heavily relies on real-time pricing. Therefore, neglecting the price factor in forecasting the load could lead to biased predictions. For instance, Reference [45] incorporated real-time pricing as a determinant of power load and introduced a hybrid model based on support vector machines. This model integrated intelligent techniques for feature selection and parameter optimization. The findings demonstrated that integrating real-time pricing not only enhances prediction accuracy but also holds practical significance.
Also, Amjady and Daraeepoura proposed a mixed model for load and price forecasting, considering the interactions of these two forecast processes [46]. Memarzadeh et al. proposed a hybrid forecasting model based on wavelet transform for eliminating fluctuation behaviors of the electricity load and price time series, feature selection based on entropy and mutual information, and deep learning algorithm with LSTM networks for short-term electricity load and price prediction [47]. A short-term load forecasting model, as a multi-scale CNN-LSTM model, considering the real-time electricity price for sufficient feature extraction and high prediction accuracy was proposed by Guo et al. [48]. Amjady and Daraeepour introduced a hybrid forecasting technique for midterm demand prediction, emphasizing the incorporation of price as a crucial input [49]. Sabour, Toub, and Aniba focused on real-time pricing in renewable electricity, emphasizing grid stability through demand-side management [50]. Yuan et al. investigated short-term load forecasting under demand response in multi-type power grid connections with dynamic electricity prices [51]. Alhendi et al. proposed a short-term load and price forecasting model for ISO New England using ANNs and an enhanced Markov chain [52]. Kottath and Singh presented the Influencer Buddy Optimization algorithm and applied it to electricity load and price forecasting [53]. Heydari et al. also addressed short-term electricity price and load forecasting in isolated power grids using a composite neural network and gravitational search optimization algorithm [54]. Memarzadeh and Keynia introduced a new optimal LSTM-NN-based algorithm for short-term electricity load and price forecasting [47]. Nazar et al. presented a hybrid model using a three-stage algorithm for simultaneous load and price forecasting [55]. Zhao et al. examined electricity cost comparison based on load forecasting in household energy management systems [56]. Zhang et al. proposed a novel integrated price and load forecasting method in smart grid environments based on a multi-level structure [57]. Furthermore, Guo et al. introduced a short-term load forecasting model using a multi-scale CNN-LSTM hybrid neural network, considering real-time electricity prices [48]. The examples from the literature presented above confirm the possibility of enhancing the performance of the ML methods in forecasting electricity demand by combining data on consumption and price.
In this study, to acknowledge the significant impact of price on electricity demand, a new hybrid ML method with innovative connectivity between forecasters is proposed for demand forecasting. The proposed hybrid ML method explicitly incorporates price as a crucial input. In this way, two parallel XGB models are employed for price and demand forecasting. The price forecaster employs time-series data and utilizes five subsequent inputs considered as mutual information (MI), including the current and previous time step prices, and several moving averages, to predict the price in the next step. The output of the price forecaster is used as an input alongside other inputs, such as environmental factors and energy consumption from various devices. In other words, the demand forecaster employs different types of inputs such as price, humidity, temperature, and the energy consumption of appliances to forecast the next step in home energy demand. The results demonstrate that the proposed hybrid ML model is superior to the conventional ML methods in accurately forecasting the demand. Additionally, to enhance the performance of the proposed algorithms, a PSO technique is employed to optimally determine the parameters of XGB, namely, learning_rate, max_depth, and n_estimators. This optimization process aims to further refine the accuracy and efficiency of the hybrid ML model in capturing the complex relationships between price and demand in the context of electricity consumption forecasting. Moreover, different machine learning techniques are utilized to model and predict demand based on five distinct datasets. The results indicate that XGB outperforms the other models in terms of minimum Root Mean Square Error (RMSE), R-squared ( R 2 ), and Mean Absolute Error (MAE). Additionally, XGB is notably faster than the other methods. Concisely, the primary innovations of this paper can be outlined as follows:
Development of a novel hybrid ML method integrating price as a crucial input for electricity demand forecasting.
Comparing several ML models in forecasting price and energy demand and utilizing Particle Swarm Optimization (PSO) to optimize the selected ML parameters (XGB). The proposed method enhances the accuracy and efficiency of the hybrid ML model in capturing complex relationships between price and demand in electricity consumption forecasting.
The article’s structure is organized as follows: Section 2 outlines the problems along with the datasets used in the study. Section 3 presents the research methodology and benchmark methods. Section 4 analyzes the results obtained using the proposed hybrid model and benchmarks, discussing the implications of the findings. Finally, Section 5 concludes the paper and summarizes key findings.

2. Problem Statement and Datasets

Our study aims to develop a model for forecasting energy consumption in individual homes rather than across multiple homes simultaneously. Each home has its unique energy consumption patterns influenced by factors such as the types of appliances and utilities used, household habits, and environmental conditions. Therefore, our approach focuses on creating individualized models for each home based on its specific characteristics and historical energy consumption data. The main objective of this study is to demonstrate the effectiveness of the proposed methodology in accurately forecasting energy consumption within individual homes.
Our dataset selection process is based on the availability of comprehensive information, including energy consumption patterns of appliances and environmental conditions. For this purpose, we have utilized the dataset provided by the Laboratory for Advanced System Software (LASS), specifically the UMass Smart Dataset. The data available on the LASS website covers the period between 2014 and 2016. The dataset from LASS has been widely used and validated in various research studies [58]. The datasets were sourced from five distinct homes situated across Massachusetts, USA, each equipped with multiple appliances and devices. The dataset comprises energy consumption data for these appliances and devices throughout the year 2016, recorded at various intervals ranging from one minute to one hour. For detailed information about the dataset, it can be accessed through the following link: (https://traces.cs.umass.edu/index.php/Smart/Smart, accessed on 10 March 2023).
The monthly retail prices available for Massachusetts in [59] have been used for the electricity price. The electricity price exhibits seasonality, monthly variations, and hourly fluctuations (including peak and off-peak hours), resembling the characteristics of a time series. To forecast the price in the upcoming steps, we utilize the moving average technique considering the last certain number of subsequent price data.
Key considerations of the dataset used in this study include the following:
-
The original dataset used in this study consists of information collected from five smart homes, namely, B, C, D, F, and G. Data for each individual consumer in each house was collected using smart meters from 1 January 2016 to 30 December 2016. Samples were selected at 15 min intervals. More detailed information on these homes is given in Table 1.
-
The data for environmental conditions, such as ambient temperature, humidity, and wind speed, were collected at one-hour intervals.
-
A time interval of 15 min was chosen for the analysis. Since the environmental data were available at one-hour intervals, it was assumed that the environmental conditions within each specific hour interval remained constant.
-
The chosen features for analysis encompass various aspects such as the date and time of consumption, as well as environmental and in-house factors. The environmental factors considered are ambient temperature, humidity, and wind speed. In-house factors include specific appliances such as the refrigerator, furnace, and room heating system, which significantly contribute to electricity consumption. Additionally, the presence of an in-house operated solar system was considered for houses C, D, F, and G to partially meet the energy demand. The output variable under consideration is the total energy consumption measured in kWh.
-
In order to ensure the accurate forecasting of energy consumption, the selected features and the output variable were normalized using a mapping technique. This normalization process transformed the values of each feature and the output variable to a range of 0–1.

3. Research Methodology

In this section, the proposed hybrid ML method for demand and price forecasting is presented. In addition, the selected ML methods are introduced, shedding light on their principles and hyper-parameters to provide a comprehensive understanding of their application.

3.1. Hybrid ML for Demand and Price Forecasting

In the realm of electricity consumption, the price of energy stands out as a pivotal parameter influencing both demand and consumption patterns. Consumers naturally exhibit a preference for utilizing electricity during periods of lower prices rather than when costs surge. Acknowledging the significant impact of price on electricity demand, this section proposes a hybrid ML model for demand forecasting that explicitly incorporates price as a crucial input.
The proposed model operates on combining demand and price forecasters to find a more accurate mode for demand forecasting. In this way, the output of the price forecaster serves as an integral input for a broader ML framework designed for demand forecasting. Beyond traditional inputs such as wind speed, humidity, and energy consumption from various devices, the predicted price assumes a pivotal role in shaping the forecasting model’s predictive capabilities. This integration forms a holistic approach to demand forecasting, where considerations of price dynamics become intrinsic to the overall predictive process.
To visually convey the intricacies of this hybrid model, Figure 1 presents a schematic diagram delineating the interactions among the various components. The diagram encapsulates the flow of information, highlighting how the predicted price from the XGB model seamlessly integrates into the broader context of demand forecasting. This visualization aids in comprehending the synergy between the price forecasting component and the other influential parameters, emphasizing the intricate relationships that contribute to the model’s forecasting accuracy. Through this innovative approach, the hybrid ML model strives to enhance the precision and effectiveness of electricity demand forecasts by accounting for the dynamic influence of energy prices.
In the realm of price forecasting, the temporal nature of the data demands an approach that leverages information from previous time steps. As time-series data inherently rely on the sequential nature of events, the integration of historical prices as inputs to ML models becomes pivotal.
In our framework, we utilize historical data to forecast the price of the next step. The electricity price at each step demonstrates strong dependencies on its recent past values, exemplifying a short-term trend alongside daily periodicity. Additionally, there are recurring dependencies on prices from long hours previously, indicating hourly, daily, and weekly periodic patterns. Given the extensive range of potential input features, encompassing lagged price values up to 50 previous steps, utilizing them all for XGB training becomes impractical. To overcome this challenge, in the context of feature selection for ML, mutual information (MI) is applied to evaluate the importance of features and select the most relevant ones [49]. Mutual information (MI) is a measure of the amount of information that can be obtained about one random variable by observing another random variable. In other words, it quantifies the degree of dependence between two variables. Further details about MI can be found in [48]. To perform feature selection using MI, the mutual information score is calculated for each feature with the target variable, and the features are ranked based on their scores. Features with higher MI values are considered more important in the realm of price forecasting. The top k features are selected as the reduced set of features.
In this way, five inputs are selected for price forecasting using MI, the price of current and previous time steps denoted as P t   and P t 1 , and the moving average of the last three subsequent prices, P _ M A n = 1 n i = 0 n 1 P t i , and P t + 1 as output, as shown in Figure 1 (where t represents the current time). So, in Figure 1, P _ M A 2 , P _ M A 3 , and P _ M A 4   stand for the price moving average of two, three, and four previous time steps, respectively.

3.2. Selected ML Model for Demand and Price Forecasting

RF: RF is an ML algorithm that creates an ensemble of decision trees to improve the accuracy and stability of predictions [60]. The algorithm works by randomly selecting subsets of the data and features to create multiple decision trees, which are then combined to make a final prediction. Each decision tree is trained on a subset of the data, and at each node, a random subset of features is considered for splitting. This process creates a diverse set of decision trees that are less prone to overfitting and can capture complex relationships between variables. The final prediction is made by aggregating the predictions of all the decision trees in the ensemble.
Gradient Boosting (GBoost) and XGB: Gradient Boosting is an ML algorithm that combines multiple weak models to create a strong predictive model [61]. XGB boasts several crucial hyperparameters that significantly influence its performance [62]. Among these, the learning rate, n_estimators, and max_depth stand out as particularly pivotal [22]. The learning rate determines the step size at each iteration during the boosting process. A smaller learning rate can help prevent overfitting by ensuring more conservative updates to model weights. On the other hand, a higher learning rate can accelerate the convergence of the algorithm but might lead to overfitting if not carefully tuned. The n_estimators parameter specifies the number of boosting rounds or trees to be built. Increasing the number of estimators can enhance the model’s predictive power, but it also escalates computational cost and the risk of overfitting if not balanced with other parameters. Lastly, the max_depth parameter controls the maximum depth of each tree in the boosting process. Deeper trees can capture more intricate patterns in the data, potentially leading to overfitting. Hence, finding the optimal max_depth is crucial to strike a balance between model complexity and generalization performance. In essence, these hyperparameters play a pivotal role in fine-tuning XGB models to achieve optimal performance while guarding against overfitting and computational inefficiency.
SVR: SVR is an ML algorithm used for regression analysis [63]. It is a variant of the popular SVM algorithm used for classification problems. SVR is used to predict continuous values rather than discrete values. SVR can be used in various domains such as finance, healthcare, and engineering for prediction problems such as stock price prediction, disease diagnosis, and traffic flow prediction. The basic idea behind SVM is to find the best hyperplane that separates the data into two classes, with a maximum margin. The margin is the distance between the hyperplane and the closest data points from each class. In SVR, the goal is to find a hyperplane that maximizes the margin while also fitting as many data points as possible within a certain margin of error.
ANN and FFNN: ANNs are mathematical models composed of interconnected nodes, referred to as neurons. FFNNs are a type of ANN where information flows in only one direction, passing through multiple hidden layers before reaching the final output layer [64]. The outputs of each layer serve as inputs to the next layer. During the training process, the weights and biases of the network are adjusted to minimize a specific loss function, usually through an optimization algorithm like gradient descent. The choice of loss function depends on the specific task, such as regression or classification. Tuning parameters in FFNNs include the number of hidden layers, the number of neurons per layer, and the learning rate. The number of hidden layers determines the depth and complexity of the network, while the number of neurons per layer controls the capacity and expressive power. The learning rate determines the step size by which the weights and biases are updated during training.
LSTM: LSTM is a type of RNN architecture commonly used for sequential data analysis, such as time-series forecasting [65]. It addresses the vanishing gradient problem in traditional RNNs by incorporating a memory cell that can selectively retain and forget information over long sequences. The LSTM unit consists of four main components: the input gate, the forget gate, the output gate, and the cell memory. These components are updated using a set of mathematical equations.

4. Results

In this section, the outcomes of price and demand forecasting are delineated across two distinct phases. In the initial phase, an array of conventional deep and non-deep ML models was deployed across five distinct datasets for demand and price forecasting. Transitioning into the second phase, Particle Swarm Optimization (PSO) takes center stage as it is employed to optimize the XGB model, identified as the most proficient one in the preceding phase. The optimization process aims to refine and enhance the predictive capabilities of XGB. In addition, the hybrid ML model, proposed in Section 3.2, strategically combines insights from both price and demand forecasting. This amalgamation seeks to harness the synergies between these two critical aspects, offering a comprehensive and refined predictive model.

4.1. Demand and Price Forecasting Using Different ML Methods

In the initial phase of demand forecasting, our study harnesses a diverse array of ML techniques, encompassing both ML and deep learning models. The selected methodologies include prominent algorithms such as ANN, XGB, FFNN, RF, LSTM, SVR, and Gradient Boosting (GB). Each of these models brings a unique set of capabilities and characteristics, making them suitable for tackling the intricacies of demand forecasting.
To ensure a comprehensive evaluation, we employ five distinct datasets, as outlined in the preceding section. These datasets capture various aspects of the residential environment, incorporating factors such as solar, wind speed, humidity, and energy consumption from different devices. The diverse range of inputs accounts for the multifaceted nature of demand forecasting, allowing the models to discern intricate patterns and dependencies.
In evaluating the predictive capabilities of ML methods, we follow a conventional approach of partitioning the dataset into two distinct subsets. Specifically, 70% of the data is dedicated to training the models, enabling them to comprehend and adapt to underlying patterns. The remaining 30% is set aside for the prediction set, functioning as a robust evaluation platform to assess the models’ generalization performance. To elaborate, throughout the optimization process, the sets are allocated as follows: 70% × 70% = 49% for training; 70% × 30% = 21% for validation; and 30% for prediction. To conduct a comprehensive comparison of results, we consider various performance metrics, including Root Mean Square Error (RMSE), Mean Absolute Error (MAE), R-squared ( R 2 ), and computational running time (RT). Each of these metrics offers valuable insights into different aspects of the models’ performance, facilitating a nuanced and thorough comparison. For each home, there are four indices (scenarios), including RMSE, MAE, R2, and RT. With five homes in total, the number of scenarios (indices) is 20. Python and its available package libraries have been employed to simulate different ML models.
The summary of our assessment is displayed in Table 2, presenting the outcomes of various ML methods for each household dataset. The table illustrates performance metrics (RMSE, MAE, R 2 , RT) and emphasizes computational efficiency in terms of running time. For instance, concerning the RMSE index for Home B, default-XGB (D-XGB) claims the top spot, followed by RF in second place. Remarkably, XGB consistently achieves the first position in 15 out of 20 scenarios and consistently ranks within the top two in all instances (20 out of 20 scenarios). Additionally, the running time of XGB is significantly lower compared to other methods. It is approximately 40 times faster than Gradient Boosting (GB), which secures the second position in terms of running time. Furthermore, XGB is faster than RF by about 200 times. This substantial superiority in running time alongside its overall outstanding performance in prediction in terms of other metrics highlights the superior performance and precision of D-XGB compared to the other methods.
In this step, we also employed different ML methods for price forecasting. As shown in Figure 1, five inputs are selected for price forecasting using MI, including P t   and P t 1 , P _ M A 2 , P _ M A 3 , and P _ M A 4 , as well as P t + 1 as output, where t represents the current time.
Table 3 displays the performance of various ML methods in price forecasting, considering the five-input-one-output data table. The table incorporates multiple performance indices, such as RMSE, R 2 , MAE, and RT. Notably, all methods demonstrate commendable performance in price forecasting. XGB consistently secures the first rank across all indices, underscoring its consistently strong performance.

4.2. Optimized and Hybrid ML Model for Energy Demand and Price Forecasting

In the first phase of our study, XGB demonstrated superior performance compared to other ML methods in the context of demand and price forecasting. Building on this success, the second phase of our investigation delves into further optimizing the XGB model using PSO for both demand and price forecasting. Considering its speed and effectiveness in optimizing complex and nonlinear problems, PSO serves as a potent tool for enhancing the performance of ML algorithms.
PSO is a population-based optimization algorithm that mimics the social behavior of particles in a swarm. In PSO, a population of potential solutions, referred to as particles, moves through the search space to find the optimal solution. Each particle adjusts its position and velocity based on its own experience (personal best) and the collective experience of the entire swarm (global best). In our optimization endeavor, the parameters of XGB, namely, learningrate, max_depth, and n_estimators, are treated as design variables. The objective function for optimization is set as the Root Mean Square Error (RMSE) of XGB, aiming to minimize validation errors and enhance overall accuracy. As mentioned in Section 3.2, the learning rate, n_estimators, and max_depth are the most important hyperparameters of XGB, and thus they are selected as design variables. It should be noted that, during the optimization process, the training set is split into two distinct subsets: the training set (70%) and the test set (30%). The problem formulation is given through Equations (1) and (2),
RMSE = 1 N i = 1 N y actual i y model i 2
Design variables:
0.01 l e a r n i n g   r a t e 0.4   m a x _ d e p t h = 3 ,   5 ,   7 n _ e s t i m a t o r s = 50 ,   100 ,   150 ,   200
where y represents the total energy consumption of each home as the output. The results with the obtained parameters through PSO in terms of price and demand forecasting are shown in Table 4, showcasing an improvement in XGB’s predictive capabilities. For example, the RMSE of demand forecasting decreases substantially from 0.327 to 0.286, reflecting a notable 12.5% enhancement in model accuracy for the Home B dataset. The optimized results for price forecasting exhibit a modest improvement relative to D-XGB. This outcome was anticipated due to the favorable performance of D-XGB for price forecasting, as evidenced by an impressive R 2 value of 0.99973.
To visually depict the evolutionary progress of PSO, Figure 2 illustrates the trend of the best values obtained through particles across iterations for the Home B dataset. The plot underscores the continual improvement in terms of RMSE, decreasing from 0.904 in the initial generation to 0.286 in the final one. This dynamic evolution serves as a testament to the effectiveness of PSO in iteratively refining the XGB model for superior demand forecasting accuracy.
In this step, the proposed hybrid ML model presented in Section 3.2 is employed for demand forecasting. The results obtained using the proposed hybrid ML, in conjunction with both conventional and optimized XGB models, are detailed in Table 4.
Evidently, across all cases, the hybrid ML exhibits superior prediction capabilities compared to its predecessors. For instance, in the case of the Home C dataset, there is a notable enhancement, with the RMSE and MAE improving by 36.6% and 36.8%, respectively. Furthermore, substantial improvements of 19.2%, 36.6%, 19.7%, 14.6%, and 10.5% in RMSE are observed for Home B, C, D, F, and G datasets, respectively. These results underscore the efficiency of the hybrid ML model in refining the precision of electricity demand forecasts, showcasing its ability to outperform conventional and optimized XGB models. The integration of price forecasting into the broader framework evidently contributes to the model’s enhanced accuracy, validating the proposed approach’s effectiveness in capturing the dynamic influence of energy prices on demand forecasting. It must be noted that all tables/figures have been created by the authors.

5. Conclusions

In the landscape of electricity consumption, our study proposed a hybrid ML model designed for enhanced demand forecasting. This approach notably integrated the pivotal parameter of energy prices, recognizing their profound influence on consumption patterns. The model synergistically combined demand and price forecasting, leveraging predicted prices as crucial inputs within a broader ML framework. Notably, XGB and RF emerged as frontrunners in demand forecasting, underscoring their efficiency in capturing the intricacies of consumption patterns. However, our study went beyond the conventional by incorporating Particle Swarm Optimization (PSO) to refine the XGB model. This optimization process is instrumental in elevating the model’s predictive capabilities, making a significant advancement in forecasting accuracy. The hybrid ML model, marrying insights from both price and demand forecasting, emerges as the star of our findings. It consistently outperformed not only the conventional ML models but also the optimized XGB, illustrating the power of synergies between pricing dynamics and demand forecasting. The results collectively demonstrated that the proposed methodology, augmented by PSO optimization, significantly enhances the accuracy of electricity demand and price forecasts. The obtained forecast models can offer several potential strategies to improve consumption efficiency for households:
  • Peak Demand Management: Identifying peak demand periods and encouraging consumers to shift their energy-intensive activities to off-peak hours can help reduce strain on the grid and minimize costs for both consumers and distribution companies.
  • Energy-Efficient Appliances: Promoting the use of energy-efficient appliances and smart home technologies can significantly reduce overall energy consumption without sacrificing comfort or convenience.
  • Demand Response Programs: Implementing demand response programs that incentivize consumers to adjust their energy usage in response to grid conditions can help mitigate peak demand and stabilize the grid, benefiting both consumers and distribution companies.
These points aim to provide practical recommendations for improving consumption efficiency and fostering a more sustainable energy ecosystem for households and distribution companies alike. The method proposed in this paper does, indeed, necessitate a smart home equipped with the capability to measure the energy consumption of various appliances.

Author Contributions

Conceptualization, B.P., A.J. and H.K.; methodology, B.P., A.J. and H.K.; software, B.P. and A.J.; validation, A.J. and H.K.; formal analysis, B.P., A.J. and H.K.; investigation, A.J. and H.K.; resources, B.P.; data creation, B.P.; writing—original draft preparation, B.P. and A.J.; writing—review and editing, B.P., H.R., A.J. and H.K.; visualization, B.P. and A.J.; supervision, H.K.; project administration, B.P.; funding acquisition, H.R. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by ADL Building Services Pty Ltd. (Applied Solar Energy), research contact number 35155 on 30 March 2022 with RMIT University.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data will be made available upon request.

Conflicts of Interest

The authors declare that this study received funding from funder ADL Building Services Pty Ltd. The funder was not involved in the study design, collection, analysis, interpretation of data, the writing of this article or the decision to submit it for publication.

References

  1. Available online: https://www.iea.org/reports/electricity-market-report-2023/executive-summary (accessed on 20 March 2023).
  2. Ahmadi, S.E.; Rezaei, N.; Khayyam, H. Energy management system of networked microgrids through optimal reliability-oriented day-ahead self-healing scheduling. Sustain. Energy Grids Netw. 2020, 23, 100387. [Google Scholar] [CrossRef]
  3. Tafreshi, S.M.M.; Ranjbarzadeh, H.; Jafari, M.; Khayyam, H. A probabilistic unit commitment model for optimal operation of plug-in electric vehicles in microgrid. Renew. Sustain. Energy Rev. 2016, 66, 934–947. [Google Scholar] [CrossRef]
  4. Tabrizchi, H.; Javidi, M.M.; Amirzadeh, V. Estimates of residential building energy consumption using a multi-verse optimizer-based support vector machine with k-fold cross-validation. Evol. Syst. 2021, 12, 755–767. [Google Scholar] [CrossRef]
  5. Amjady, N. Short-term hourly load forecasting using time-series modeling with peak load estimation capability. IEEE Trans. Power Syst. 2001, 16, 498–505. [Google Scholar] [CrossRef]
  6. Rambabu, M.; Ramakrishna, N.; Polamarasetty, P.K. Prediction and Analysis of Household Energy Consumption by Machine Learning Algorithms in Energy Management. In E3S Web of Conferences; EDP Sciences: Paris, France, 2022; p. 02002. [Google Scholar]
  7. Velasquez, C.E.; Zocatelli, M.; Estanislau, F.B.; Castro, V.F. Analysis of time series models for Brazilian electricity demand forecasting. Energy 2022, 247, 123483. [Google Scholar] [CrossRef]
  8. Li, F.; Lai, L.; Cui, S. On the adversarial robustness of LASSO based feature selection. IEEE Trans. Signal Process. 2021, 69, 5555–5567. [Google Scholar] [CrossRef]
  9. Khayyam, H.; Golkarnarenji, G.; Jazar, R.N. Limited data modelling approaches for engineering applications. In Nonlinear Approaches in Engineering Applications: Energy, Vibrations, and Modern Applications; Springer Nature: Berlin/Heidelberg, Germany, 2018; pp. 345–379. [Google Scholar]
  10. Khayyam, H.; Jamali, A.; Bab-Hadiashar, A.; Esch, T.; Ramakrishna, S.; Jalili, M.; Naebe, M. A novel hybrid machine learning algorithm for limited and big data modeling with application in industry 4.0. IEEE Access 2020, 8, 111381–111393. [Google Scholar] [CrossRef]
  11. Khayyam, H.; Ranjbarzadeh, H.; Marano, V. Intelligent control of vehicle to grid power. J. Power Sources 2012, 201, 1–9. [Google Scholar] [CrossRef]
  12. Meng, Z.; Sun, H.; Wang, X. Forecasting energy consumption based on SVR and Markov model: A case study of China. Front. Environ. Sci. 2022, 10, 883711. [Google Scholar] [CrossRef]
  13. Chen, Y.; Xu, P.; Chu, Y.; Li, W.; Wu, Y.; Ni, L.; Bao, Y.; Wang, K. Short-term electrical load forecasting using the Support Vector Regression (SVR) model to calculate the demand response baseline for office buildings. Appl. Energy 2017, 195, 659–670. [Google Scholar] [CrossRef]
  14. Asl, F.A.; Bodur, M. Comparison of Forecasting Methods of House Electricity Consumption for Honda Smart Home. arXiv 2022, arXiv:2208.07217. [Google Scholar]
  15. Hedén, W. Predicting Hourly Residential Energy Consumption Using Random Forest and Support Vector Regression: An Analysis of the Impact of Household Clustering on the Performance Accuracy; KTH Royal Institute of Technology: Stockholm, Sweden, 2016. [Google Scholar]
  16. Li, S.; Kong, X.; Yue, L.; Liu, C.; Khan, M.A.; Yang, Z.; Zhang, H. Short-term electrical load forecasting using hybrid model of manta ray foraging optimization and support vector regression. J. Clean. Prod. 2023, 388, 135856. [Google Scholar] [CrossRef]
  17. Ahmad, M.W.; Mourshed, M.; Rezgui, Y. Trees vs. Neurons: Comparison between random forest and ANN for high-resolution prediction of building energy consumption. Energy Build. 2017, 147, 77–89. [Google Scholar] [CrossRef]
  18. Zogaan, W.A. Power Consumption prediction using Random Forest model. Int. J. Mech. Eng. 2022, 7, 329–341. [Google Scholar]
  19. Dudek, G. A Comprehensive Study of Random Forest for Short-Term Load Forecasting. Energies 2022, 15, 7547. [Google Scholar] [CrossRef]
  20. Nofal, S. Forecasting next-hour electricity demand in small-scale territories: Evidence from Jordan. Heliyon 2023, 9, e19790. [Google Scholar] [CrossRef] [PubMed]
  21. Moon, J.; Jung, S.; Rew, J.; Rho, S.; Hwang, E. Combination of short-term load forecasting models based on a stacking ensemble approach. Energy Build. 2020, 216, 109921. [Google Scholar] [CrossRef]
  22. Luo, X.; Oyedele, L.O.; Ajayi, A.O.; Akinade, O.O.; Owolabi, H.A.; Ahmed, A. Feature extraction and genetic algorithm enhanced adaptive deep neural network for energy consumption prediction in buildings. Renew. Sustain. Energy Rev. 2020, 131, 109980. [Google Scholar] [CrossRef]
  23. Touzani, S.; Granderson, J.; Fernandes, S. Gradient boosting machine for modeling the energy consumption of commercial buildings. Energy Build. 2018, 158, 1533–1543. [Google Scholar] [CrossRef]
  24. Ribeiro, A.M.N.; do Carmo, P.R.X.; Endo, P.T.; Rosati, P.; Lynn, T. Short-and very short-term firm-level load forecasting for warehouses: A comparison of machine learning and deep learning models. Energies 2022, 15, 750. [Google Scholar] [CrossRef]
  25. Qinghe, Z.; Wen, X.; Boyan, H.; Jong, W.; Junlong, F. Optimised extreme gradient boosting model for short term electric load demand forecasting of regional grid system. Sci. Rep. 2022, 12, 19282. [Google Scholar] [CrossRef]
  26. Reddy, S.; Akashdeep, S.; Harshvardhan, R.; Kamath, S. Stacking Deep learning and Machine learning models for short-term energy consumption forecasting. Adv. Eng. Inform. 2022, 52, 101542. [Google Scholar]
  27. Divina, F.; Gilson, A.; Goméz-Vela, F.; García Torres, M.; Torres, J.F. Stacking ensemble learning for short-term electricity consumption forecasting. Energies 2018, 11, 949. [Google Scholar] [CrossRef]
  28. Khwaja, A.S.; Anpalagan, A.; Naeem, M.; Venkatesh, B. Joint bagged-boosted artificial neural networks: Using ensemble machine learning to improve short-term electricity load forecasting. Electr. Power Syst. Res. 2020, 179, 106080. [Google Scholar] [CrossRef]
  29. Ryu, S.; Noh, J.; Kim, H. Deep neural network based demand side short term load forecasting. Energies 2016, 10, 3. [Google Scholar] [CrossRef]
  30. Rahman, A.; Srikumar, V.; Smith, A.D. Predicting electricity consumption for commercial and residential buildings using deep recurrent neural networks. Appl. Energy 2018, 212, 372–385. [Google Scholar] [CrossRef]
  31. Solyali, D. A comparative analysis of machine learning approaches for short-/long-term electricity load forecasting in Cyprus. Sustainability 2020, 12, 3612. [Google Scholar] [CrossRef]
  32. Zang, H.; Xu, R.; Cheng, L.; Ding, T.; Liu, L.; Wei, Z.; Sun, G. Residential load forecasting based on LSTM fusing self-attention mechanism with pooling. Energy 2021, 229, 120682. [Google Scholar] [CrossRef]
  33. Kong, W.; Dong, Z.Y.; Jia, Y.; Hill, D.J.; Xu, Y.; Zhang, Y. Short-term residential load forecasting based on LSTM recurrent neural network. IEEE Trans. Smart Grid 2017, 10, 841–851. [Google Scholar] [CrossRef]
  34. Lu, C.; Li, S.; Lu, Z. Building energy prediction using artificial neural networks: A literature survey. Energy Build. 2022, 262, 111718. [Google Scholar] [CrossRef]
  35. Nazir, A.; Shaikh, A.K.; Shah, A.S.; Khalil, A. Forecasting energy consumption demand of customers in smart grid using Temporal Fusion Transformer (TFT). Results Eng. 2023, 17, 100888. [Google Scholar] [CrossRef]
  36. Ghenai, C.; Al-Mufti, O.A.A.; Al-Isawi, O.A.M.; Amirah, L.H.L.; Merabet, A. Short-term building electrical load forecasting using adaptive neuro-fuzzy inference system (ANFIS). J. Build. Eng. 2022, 52, 104323. [Google Scholar] [CrossRef]
  37. Lee, D.; Kim, K.; Song, S.H. Machine learning-based day-ahead prediction of price-setting scheduled energy in the Korean electricity trading mechanism. IEEE Access 2023, 11, 58705–58714. [Google Scholar] [CrossRef]
  38. Zhang, R.; Li, G.; Ma, Z. A Deep Learning Based Hybrid Framework for Day-Ahead Electricity Price Forecasting. IEEE Access 2020, 8, 143423–143436. [Google Scholar] [CrossRef]
  39. Bibi, N.; Shah, I.; Alsubie, A.; Ali, S.; Lone, S.A. Electricity Spot Prices Forecasting Based on Ensemble Learning. IEEE Access 2021, 9, 150984–150992. [Google Scholar] [CrossRef]
  40. Bouktif, S.; Fiaz, A.; Ouni, A.; Serhani, M.A. Multi-sequence LSTM-RNN deep learning and metaheuristics for electric load forecasting. Energies 2020, 13, 391. [Google Scholar] [CrossRef]
  41. Zhou, G.; Moayedi, H.; Bahiraei, M.; Lyu, Z. Employing artificial bee colony and particle swarm techniques for optimizing a neural network in prediction of heating and cooling loads of residential buildings. J. Clean. Prod. 2020, 254, 120082. [Google Scholar] [CrossRef]
  42. Wang, L.; Hu, H.; Ai, X.-Y.; Liu, H. Effective electricity energy consumption forecasting using echo state network improved by differential evolution algorithm. Energy 2018, 153, 801–815. [Google Scholar] [CrossRef]
  43. Jamali, A.; Mallipeddi, R.; Salehpour, M.; Bagheri, A. Multi-objective differential evolution algorithm with fuzzy inference-based adaptive mutation factor for Pareto optimum design of suspension system. Swarm Evol. Comput. 2020, 54, 100666. [Google Scholar] [CrossRef]
  44. Gundu, V.; Simon, S.P. PSO–LSTM for short term forecast of heterogeneous time series electricity price signals. J. Ambient Intell. Humaniz. Comput. 2021, 12, 2375–2385. [Google Scholar] [CrossRef]
  45. Dai, Y.; Zhao, P. A hybrid load forecasting model based on support vector machine with intelligent methods for feature selection and parameter optimization. Appl. Energy 2020, 279, 115332. [Google Scholar] [CrossRef]
  46. Amjady, N.; Daraeepour, A. Mixed price and load forecasting of electricity markets by a new iterative prediction method. Electr. Power Syst. Res. 2009, 79, 1329–1336. [Google Scholar] [CrossRef]
  47. Memarzadeh, G.; Keynia, F. Short-term electricity load and price forecasting by a new optimal LSTM-NN based prediction algorithm. Electr. Power Syst. Res. 2021, 192, 106995. [Google Scholar] [CrossRef]
  48. Guo, X.; Zhao, Q.; Zheng, D.; Ning, Y.; Gao, Y. A short-term load forecasting model of multi-scale CNN-LSTM hybrid neural network considering the real-time electricity price. Energy Rep. 2020, 6, 1046–1053. [Google Scholar] [CrossRef]
  49. Amjady, N.; Daraeepour, A. Midterm demand prediction of electrical power systems using a new hybrid forecast technique. IEEE Trans. Power Syst. 2010, 26, 755–765. [Google Scholar] [CrossRef]
  50. Sabour, K.M.; Toub, M.; Aniba, G. Renewable Electricity Real-Time Pricing: Enhancing Grid’s Stability Through Demand Side Management. In Proceedings of the 2021 IEEE PES Innovative Smart Grid Technologies-Asia (ISGT Asia), Brisbane, Australia, 5–8 December 2021; pp. 1–5. [Google Scholar]
  51. Li, Y.; Chen, Y.; Shi, Y.; Zhao, X.; Li, Y.; Lou, Y. Research on short-term load forecasting under demand response of multi-type power grid connection based on dynamic electricity price. In Proceedings of the 2021 IEEE International Conference on Power, Intelligent Computing and Systems (ICPICS), Shenyang, China, 29–31 July 2021; pp. 141–144. [Google Scholar]
  52. Alhendi, A.; Al-Sumaiti, A.S.; Marzband, M.; Kumar, R.; Diab, A.A.Z. Short-term load and price forecasting using artificial neural network with enhanced markov chain for ISO new england. Energy Rep. 2023, 9, 4799–4815. [Google Scholar] [CrossRef]
  53. Kottath, R.; Singh, P. Influencer buddy optimization: Algorithm and its application to electricity load and price forecasting problem. Energy 2023, 263, 125641. [Google Scholar] [CrossRef]
  54. Heydari, A.; Nezhad, M.M.; Pirshayan, E.; Garcia, D.A.; Keynia, F.; De Santoli, L. Short-term electricity price and load forecasting in isolated power grids based on composite neural network and gravitational search optimization algorithm. Appl. Energy 2020, 277, 115503. [Google Scholar] [CrossRef]
  55. Nazar, M.S.; Fard, A.E.; Heidari, A.; Shafie-khah, M.; Catalão, J.P. Hybrid model using three-stage algorithm for simultaneous load and price forecasting. Electr. Power Syst. Res. 2018, 165, 214–228. [Google Scholar] [CrossRef]
  56. Zhao, X.; Gao, W.; Qian, F.; Ge, J. Electricity cost comparison of dynamic pricing model based on load forecasting in home energy management system. Energy 2021, 229, 120538. [Google Scholar] [CrossRef]
  57. Zhang, Y.; Deng, C.; Zhao, R. A novel integrated price and load forecasting method in smart grid environment based on multi-level structure. Eng. Appl. Artif. Intell. 2020, 95, 103852. [Google Scholar] [CrossRef]
  58. Wang, Y.; Rui, L.; Ma, J. A short-term residential load forecasting scheme based on the multiple correlation-temporal graph neural networks. Appl. Soft Comput. 2023, 146, 110629. [Google Scholar] [CrossRef]
  59. Available online: https://www.nationalgridus.com (accessed on 17 October 2023).
  60. Biau, G.; Scornet, E. A random forest guided tour. Test 2016, 25, 197–227. [Google Scholar] [CrossRef]
  61. Friedman, J.H. Stochastic gradient boosting. Comput. Stat. Data Anal. 2002, 38, 367–378. [Google Scholar] [CrossRef]
  62. Chen, T.; Guestrin, C. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar]
  63. Awad, M.; Khanna, R.; Awad, M.; Khanna, R. Support vector regression. In Efficient Learning Machines: Theories, Concepts, and Applications for Engineers and System Designers; Springer Nature: Berlin/Heidelberg, Germany, 2015; pp. 67–80. [Google Scholar]
  64. Abiodun, O.I.; Jantan, A.; Omolara, A.E.; Dada, K.V.; Mohamed, N.A.; Arshad, H. State-of-the-art in artificial neural network applications: A survey. Heliyon 2018, 4, e00938. [Google Scholar] [CrossRef]
  65. Sainath, T.N.; Vinyals, O.; Senior, A.; Sak, H. Convolutional, long short-term memory, fully connected deep neural networks. In Proceedings of the 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Brisbane, Australia, 19–24 April 2015; pp. 4580–4584. [Google Scholar]
Figure 1. The hybrid ML model for energy demand and price forecasting. In this figure, P t   and P t 1 , are the price of the current and previous time steps, respectively. P _ M A 2 , P _ M A 3 , and P _ M A 4 stand for the price moving average of two, three, and four previous time steps, respectively. In addition, P t + 1 stands for price at the next time step.
Figure 1. The hybrid ML model for energy demand and price forecasting. In this figure, P t   and P t 1 , are the price of the current and previous time steps, respectively. P _ M A 2 , P _ M A 3 , and P _ M A 4 stand for the price moving average of two, three, and four previous time steps, respectively. In addition, P t + 1 stands for price at the next time step.
Sustainability 16 02328 g001
Figure 2. The evolutionary process of PSO optimizing XGB for demand forecasting on the Home B dataset.
Figure 2. The evolutionary process of PSO optimizing XGB for demand forecasting on the Home B dataset.
Sustainability 16 02328 g002
Table 1. Characteristics and appliances of the houses studied.
Table 1. Characteristics and appliances of the houses studied.
Home NameBCDFG
No. of Bedrooms551051
Power consumer-based featuresF1, S, OF1, F2, OA, P, H, GF1, R, B, D, O, HF, E, P1, P2, U
Range of temperature (°C)(−12.66, 93.96)(−12.6, 93.96)(−15.2, 90.21)(−12.38, 94.17)(−12.81, 93.78)
Range   of   humidity   ( g / m 3 ) (0.13, 0.98)(0.1, 0.98)(0.13, 0.98)(0.13, 0.98)(0.13, 0.98)
Range of wind speed (km/h)(0.0, 22.81)(0.0, 22.91)(0.0, 22.72)(0.13, 24.14)(0.0, 22.96)
Is there solar system?NOYesYesYesYes
Total predicting variables789119
A: Air conditioner; D: Dryer; E: Electronics closet; F1: Furnace 1; F2: Furnace 2; G: Garage consumption; H: Heating; O: Other rooms; P: Panels; R: Refrigerator; S: Study Room; U: Humidifier.
Table 2. Performance comparison of ML models for demand forecasting across multiple datasets.
Table 2. Performance comparison of ML models for demand forecasting across multiple datasets.
DatasetIndexD-XGBGBRFANNFFNNLSTMSVR
Home BRMSE0.3270.4940.3430.5400.3680.4840.531
MAE0.1570.2370.1370.2680.1840.2450.222
R20.9380.8590.9320.8310.9210.8640.837
RT (seconds)0.47419.498.39113.971.5995.7101.5
Home CRMSE0.2090.2990.2430.3080.2020.2480.266
MAE0.1230.1810.1380.2070.1210.1490.146
R20.9630.9240.9500.9200.9660.9480.940
RT (seconds)0.54218.2113.0234.476.531008.695.2
Home DRMSE0.4520.6320.4910.5800.4810.5520.636
MAE0.2510.3660.2520.3450.2690.3090.304
R20.9580.9180.9510.9310.9520.9370.917
RT (seconds)0.5916.6107.5265.778.71023.197.50
Home FRMSE0.1170.1230.1170.1360.1540.1510.132
MAE0.0500.0590.0490.0660.0680.0660.058
R20.8720.8580.8720.8270.7780.7850.835
RT (seconds)0.56722.49145.425.974.691154.0163.2
Home GRMSE0.5200.6210.5630.8000.8440.8480.870
MAE0.2670.3490.2840.4830.4820.5020.415
R20.9480.9260.9390.8780.8640.8630.856
RT (seconds)0.73118.68126.345.383.61089.290.16
Final results First rank 15040300
Second rank5560200
First+second100%20%50%025%00
Table 3. Performance comparison of ML models for price forecasting.
Table 3. Performance comparison of ML models for price forecasting.
IndexD-XGBGBRFANNFFNNLSTMSVR
RMSE0.003050.005080.003150.003720.002330.01180.00802
MAE 8.52 × 10 4 2.25 × 10 3 2.44 × 10 4 2.26 × 10 3 1.95 × 10 3 7.33 × 10 3 5.73 × 10 3
R20.999730.999280.999720.999610.999730.996110.99819
RT (seconds)0.2122.54.9615.0210.30199.420.257
Table 4. Performance of D-XGB, optimized XGB, and hybrid ML for energy demand and price forecasting.
Table 4. Performance of D-XGB, optimized XGB, and hybrid ML for energy demand and price forecasting.
DatasetIndexD-XGB Optimized XGB Hybrid ML O p t i m i z e d H y b r i d O p t i m i z e d × 100 (%)
Demand ForecastingHome BRMSE0.3270.2860.23119.2
MAE0.1570.1300.09229.2
R20.9380.9520.9691.8
Home CRMSE0.2090.1940.12336.6
MAE0.1230.1060.06736.8
R20.9630.9680.9871.96
Home DRMSE0.4520.4270.34319.7
MAE0.2510.2290.16229.2
R20.9580.9630.9761.35
Home FRMSE0.1170.1160.09914.6
MAE0.0500.0490.03920.4
R20.8720.8730.9073.9
Home GRMSE0.5200.5060.45310.5
MAE0.2670.2510.20717.5
R20.9480.9510.9611.05
Price ForecastingRMSE0.003050.003040.003040 *
MAE8.52 × 10 4 8.52 × 10 4 8.52 × 10 4 0 *
R20.999730.999740.999740 *
* The hybrid model utilizes the output of the price forecaster as an input to enhance demand forecasting. Consequently, it has no impact on the performance of the price forecaster.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Parizad, B.; Ranjbarzadeh, H.; Jamali, A.; Khayyam, H. An Intelligent Hybrid Machine Learning Model for Sustainable Forecasting of Home Energy Demand and Electricity Price. Sustainability 2024, 16, 2328. https://doi.org/10.3390/su16062328

AMA Style

Parizad B, Ranjbarzadeh H, Jamali A, Khayyam H. An Intelligent Hybrid Machine Learning Model for Sustainable Forecasting of Home Energy Demand and Electricity Price. Sustainability. 2024; 16(6):2328. https://doi.org/10.3390/su16062328

Chicago/Turabian Style

Parizad, Banafshe, Hassan Ranjbarzadeh, Ali Jamali, and Hamid Khayyam. 2024. "An Intelligent Hybrid Machine Learning Model for Sustainable Forecasting of Home Energy Demand and Electricity Price" Sustainability 16, no. 6: 2328. https://doi.org/10.3390/su16062328

APA Style

Parizad, B., Ranjbarzadeh, H., Jamali, A., & Khayyam, H. (2024). An Intelligent Hybrid Machine Learning Model for Sustainable Forecasting of Home Energy Demand and Electricity Price. Sustainability, 16(6), 2328. https://doi.org/10.3390/su16062328

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop