4.1.2. Random Forest

RF is a flexible machine learning algorithm that produces excellent results even without hyper parameter tuning. It has become one of the most commonly used machine learning algorithms because it can be easily used for classification and regression. Moreover, it can work e fficiently on a large amount of data and handle thousands of input variables without deleting them, which is why it performs well. The basic principle of RF is called the bagging algorithm [53]. Bagging is an ensemble algorithm designed to improve the stability and accuracy of individual forecasting models such as decision trees. It selects a random sample of size n from the training set, fits it in the individual forecasting models, and produces a result that is averaged or voted on all individual forecasting models. The bagging algorithm in RF helps reduce the variance and influence of overfitting of decision trees.

### *4.2. The Second Stage: Combining STLF Models Using DNN*

An ANN, which is also known as a multilayer perceptron (MLP), is a type of machine learning algorithm that is a feed-forward neural network architecture with an input layer, hidden layer, and output layer [54]. It aims to learn the nonlinear and complex structure of data by duplicating human brain functions [55]. Each layer in the neural network consists of several nodes. Each node

receives values from the nodes in the previous layer to determine the output and provide values for the nodes in the next layer. As this process repeats, the nodes in the output layer provide the required values [56]. The number of hidden layers determines whether the network is deep or shallow. For instance, when the number of hidden layers is two or more, then the network is called a deep neural network [57]. Recently, various DNN models have shown excellent prediction performances due to the remarkably improved computing performance [58].

In the second stage, we construct an STLF model by combining the results of the two STLF models built in the first stage using a DNN. For training the DNN model, we used the predicted values of XGBoost and RF as input variables to reflect the characteristics of bagging and boosting algorithms. We also considered time factors, weather data, historical electric energy consumption data, and electric rate as input variables to further improve the forecasting performance. In our DNN model, we use the SELU function as an activation function and the number of hidden layers is set as five [36]. Additionally, the number of neurons in the hidden layer is set by two thirds of the number of input variables [59].

### **5. Economic Analysis Based CCHP Operation Scheduling**

CCHP is known to improve energy utilization, reduce energy costs, and respond to peak loads by using thermal energy generated from the power generation process for heating and cooling. In addition, by using natural gas, CCHP can be a solution to environmental pollution [60]. Natural gas is a relatively clean-burning fossil fuel [61]. Burning natural gas for energy gives fewer emissions of nearly all types of air pollutants and carbon dioxide than burning coal or petroleum products to produce an equal amount of energy [62]. In this section, to see the applicability of our proposed scheme, we describe how daily CCHP operation scheduling can be made based on the forecasted daily electric energy consumption of 1 h resolution. In particular, we consider natural gas as the primary energy source of CCHP, and the economic benefit of CCHP operation is changed according to power generation efficiency. Hence, for its economic analysis, the cost of natural gas consumed in power generation must be determined by the power generation e fficiency. Table 6 summarizes the gas charge sections of the industrial service in South Korea.


**Table 6.** Gas charge sections for industrial buildings.

The electric rate system should be considered for a more accurate economic analysis. There are several considerations in the electric rate system of South Korea.


• The electric rate system o ffers three options depending on the relative amount of the demand and energy charges: Option I, Option II, and Option III. For the demand charge, Option I > Option II > Option III and for the energy charges, Option I < Option II < Option III. These options are for reducing energy consumption, inducing voluntary peak time load management, and ultimately reducing the cost of power equipment by enabling consumers to select an electric rate depending on their load pattern.

As we focus on the industrial building in this study, we have more refined electric rates depending on the supply voltage and the contract demand. First, depending on whether the contract demand exceeds 300 kW or not, there are two electric rates: Type A and Type B. For each rate, there are four groups depending on the size of the supply voltage: low voltage, high voltage A, high voltage B, and high voltage C. Each group then o ffers three options: Option I, Option II, and Option III. Table 7 summarizes the electric rates for Industrial Service (B), High Voltage A, and Option I. Industrial service (B) is an electric rate that can be used when contract demand is more than 300 kW.


**Table 7.** An example of electric rates table for an industrial building.

Operation scheduling is created to maximize annual economic benefits. Equations (3)–(6) represent detailed formulas for calculating annual economic benefits. Economic benefits are composed of two parts: (i) reduced electric charges, which are the direct economic benefits of using CCHP, and (ii) reduced heating/cooling charges by using thermal energy generated by CCHP. In the experiment, we assume CCHP can make 1.43 Mcal of thermal energy while generating 1 kWh [63]. We calculate how much it would cost to obtain this 1.43 Mcal of thermal energy using electric energy and reflect it in the formulas. Algorithm 1 shows the generation of an operational schedule for maximizing annual economic benefits. Basically, the schedule tells how much energy should be generated by CCHP and how much energy should be supplied by the public power system for each scheduling hour.

$$\text{Contract Demand} \ge \max \left( \text{Electric}\_{m,d,h} - \text{CCHP}\_{m,d,h} \right) \tag{3}$$

*Annual Economic Bene fit*

*Reduced* 

= *Reduced Annual Electric Charges* + *Reduced Annual Heating*/*Cooling Charges* (4) *AnnualElectricCharges*

$$\begin{aligned} &= \text{Demand Rate1} \times \max(\text{Electric}\_{m,d,h}) \times 12 \\ &- \text{Demand Rate2} \times \text{Contract Demand} \times 12 \\ &+ \sum\_{m=1}^{12} \sum\_{d=1}^{\text{Eol}} \sum\_{h=1}^{24} \left( (\text{Load}\_{m,d,h} \times \text{Energy Rate1}\_{m,h}) \\ &- \sum\_{m=1}^{12} \sum\_{d=1}^{\text{Eol}} \sum\_{h=1}^{24} \left( (\text{CCHP}\_{m,d,h}) \times \left( \frac{\text{Gas Rate}\_{m,h} \times \frac{42.327}{13.2}}{\text{Eol}} \right) \right) \\ &- \left( \text{Electric}\_{m,d,h} - \text{CCHP}\_{m,d,h} \right) \times \text{Energy Rate2}\_{m,h} \end{aligned} \tag{5}$$

= 12 *<sup>m</sup>*=1 *EoM d*=1 24 *h*=1 (( 1.43 2.3 × *CCHPm*,*d*,*<sup>h</sup>* × *Energy Rate*2*<sup>m</sup>*,*<sup>h</sup>*) (6)
