POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Zero Crossing Point Detection in a Distorted Sinusoidal Signal Using Decision Tree Classifier Venkataramana VEERAMSETTY 1 , Pravallika JADHAV 2 , Eslavath RAMESH 2 , Srividya SRINIVASULA 2 , Surender Reddy SALKUTI 3 1 Center for AI and Deep Learning, SR University, 506371 Warangal, India 2 Department of Electrical and Electronics Engineering, School of Engineering, SR University, 506371 Warangal, India 3 Department of Railroad and Electrical Engineering, Woosong University, 171 Dongdaejeon, Dong-gu, 34606 Daejeon, Republic of Korea dr.vvr.researc[email protected], pravallikajadha[email protected],
[email protected], srividyasriniv[email protected]om, [email protected] DOI: 10.15598/aeee.v20i4.4562 Article history: Received May 22, 2022; Revised Oct 26, 2022; Accepted Nov 01, 2022; Published Dec 31, 2022. This is an open access article under the BY-CC license. Abstract. Zero-crossing point detection in a sinusoidal signal is essential in the case of various power systems and power electronics applications like power system protection and power converters controller design. In this paper, 96 data sets are created from a distorted sinusoidal signal based on MATLAB simulation. Distorted sinusoidal signals are generated in MATLAB with various noise and harmonic levels. In this paper, a decision tree classier is used to predict the zero crossing point in a distorted signal based on input features like slope, intercept, correlation and Root Mean Square Error (RMSE). Decision tree classier model is trained and tested in the Google Colab environment. As per simulation results, it is observed that decision tree classier is able to predict the zero-crossing points in a distorted signal with maximum accuracy of 98.3 % for noise signals and 100 % for harmonic distorted signals. Keywords Decision tree, distorted sinusoidal signal, harmonics, noise, zero-crossing point. 1. Introduction In many electrical domains like industrial electronics, grid synchronization, power quality and power system protection etc., accurate Zero-Crossing Point (ZCP) detection is critical. To provide a proper ring angle to trigger switching devices in power converters, a ZCP detection is required as the ring angle is measured as a delay angle from ZCP. Similarly, the circuit breaker at ZCP should be open upon the occurrence of a fault for fast arc extinction. Practical line voltages are distorted in general, and they usually include a lot of harmonics and noise, which can cause synchronisation issues. ZCP detection is an easy task in case of a pure sinusoidal signal, it can be identied using simple comparator circuits. However, the ZCP detection in a distorted sinusoidal signal using comparator circuits is not appropriate as it contains multiple false ZCPs. So there is a need to build an accurate mechanism to detect ZCPs in a distorted sinusoidal signal. Many researchers are working on ZCP detection problem and had provided various solutions. A Deep Neural Network (DNN) model is developed in [1] to predict the ZCPs in the distorted signal. Distorted signal simulated in MATLAB with noise levels 10 % to 50 %, and with Total Harmonic Distortion (THD) levels 10 % to 50 %. Data samples are extracted from these signals with a window size of 15. A phasedelay free method is proposed in [2] to detect the ZCPs of back electromotive force in spindle motors. The impact of asymmetric machine parameters and resistance tolerance of back emf measurement circuit on ZCP detection based sensor-less control of high speed brush less DC motor is studied in [3]. In this study, © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 444
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER the authors did not analyze the impact of asymmetric mutual inductance on ZCP detection. A digital zero-crossing detector circuit is used for phase synchronization and frequency tracking to control the grid-tie power converter for an efcient energy conversion system in [4]. Zero-crossing point detection based methodology is proposed in [5] to estimate the synchronization between the signals. This technique observes the synchronization between signals by detecting the phase change within the half cycle. This methodology works well in the frequency range of 50 Hz to 52 Hz only. Power quality is analyzed based on measurements like RMS value, frequency and harmonics. For accurate measurements, proper zero-crossing detection is required. In [6], a comparative analysis between digital lters for ZCP detection in power quality measurement in presence of 3 rd and 5 th harmonics and noise is presented. ZCP detection using a digital pulse-frequency modulator based on Field Programmable Gate Array (FPGA) is implemented in [7] to identify the zero current and zero voltage transition. This methodology is implemented to change the resonant pulse width in a quasi-resonant pulsed converter under different load conditions. Analog ZCP detection based on digital zero-crossing detection algorithm with signal reconstruction and least square tting technologies is used in [8] for high precise time difference measurement in ultrasonic ow measurement unit. ZCP detection in line voltage based on a multistage lter, least square line tting model and extrapolation of the ZCP is implemented in [9]. This methodology is implemented only on a 50 Hz sinusoidal signal but caes that this can be applicable to a signal upto 60 Hz. ZCP detection in inductor current for high current switched mode DC-DC converters is presented in [10]. In this paper, voltage polarity detector based on the transistor memory cell and auto zero-comparator is used for ZCP detection. Identication of Safety operation area represented by back emf ZCP in a high speed Brushless DC (BLDC) motor in terms of free wheeling angle is implemented in [11]. The effect of Pulse Width Modulation (PWM) techniques mechanism on free wheeling angle is investigated. For given motor parameters, torque and speed area of BLDC motor are identied. A robust ZCP detection mechanism is developed in [12] using support vector machine. In this study, authors considered noise level up to 20 % and THD level 50 %. ZCP detection using voltage sensors, voltage shifter and micro controller is discussed in [13]. Machine learning is a powerful approach to nd the solution for various problems in electrical engineering like load forecasting [14], [15] and [16] and health care [17] etc., Most of the researchers are also using machine learning based approach to detect the ZCP in distorted signals. In this paper, also machine model called a decision tree classier model is used for ZCP detection. ZCP detection in a distorted sinusoidal signal with a smaller range of noise and THD using decision tree model is discussed in [18]. ZCP detection in a distorted sinusoidal signal with a larger range of noise and THD using a logistic regression model is discussed in [19]. A digital frequency measuring approach is presented in [20] to solve the obstacle that the standard dual mixer time difference measurement method's single ZCP identication is sensitive to noise. Sinusoidal beat technology, multi-channel synchronous acquisition technology, and digital frequency measurement technology are all used in [21] for sensorless control of a BLDC motor based on ZCP detection in the Back Electromotive Force (BEMF). Estimation line back electromotive force via a sensor-less control technique is proposed in [22]. The phase relationship between the optimal commutation points of the brush-less direct current motor and the ZCPs of the line backelectromotive force is used to establish a commutation rule for different rotor locations in this study. Most of the researchers are also using machine learning based approach to detect the ZCP in distorted signals. Main contributions of this paper are as follows: ZCP detection in a wide range of distorted signals by considering noise levels from 10 % to 60 %, THD level from 10 % to 60 %. Decision tree classier which is a machine learning model is used for the rst time for ZCP detection. New data consists of 96 datasets that are developed to work on ZCP detection problem and are available in https://data.mendeley.com/ datasets/d2hs6zt8gw/1 . Performance of the decision tree classier model to detect ZCP in distorted signal with various window sizes is observed. The remaining part of this paper is organized as: Sec. 2. describes dataset and machine learning model, Sec. 3. presents results discussion and Sec. 4. demonstrates the conclusions of the paper. 2. Methodology This section consists of the architecture and training process of decision tree classier used for the ZCP detection. The information about the complete data that is used to train and test the decision tree model is considered from [19]. The features like slope, correlation, intercept and Root Mean Square Error (RMSE) are extracted from various distorted signal as mentioned in [12]. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 445
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER 2.1. Decision Tree Classier Decision Tree Classier has tree based architecture which is used for both binary and categorical classi- cation problems [23]. It follows a supervised learning [24] approach and is used to solve the classication problems like discussed in [25], [26], [27], [28] and also to solve regression problems like [29]. Any one of the two cost functions called entropy and Gini index can be used to construct the tree based on data samples. The mathematical representation of the entropy cost function is shown in Eq. (1) and Eq. (2), and for Gini index is shown in Eq. (3) and Eq. (4). Entropy is a measure of a random variable's uncertainty; it characterises the impurity of any arbitrary collection of samples. The greater the entropy, the greater the information content.The Gini Index is a statistical measure of how frequently a randomly selected piece is erroneously recognised. This suggests that a characteristic with a lower Gini index should be chosen. The performance of the decision tree classier is measured in terms of accuracy [30], [31] and [32] as shown in Eq. (5). The complete work for ZCP detection in the form of block diagram is shown in Fig. 1. The main strengths of decision tree methods are as follows: Decision trees can provide rules that are easy to grasp. Decision trees perform classication with little processing. Decision trees can handle both continuous and discrete data. Decision trees clearly show which elds are most relevant for prediction or categorization. Entropy (label) = =−X i ϵ labels −p(i.value) log2p(i.value). (1) Entropy (label, feature) = =X j ϵ featurecategories −probability (j)Entropy (j). (2) Gini (feature.value) = = 1 −X feature.value ϵ class []p(feature.value)]2. (3) Gini (class, feature) = X feature.value ϵ class [p(feature.value)]Gini (feature.value). (4) Accuracy = =T ZCP +T NZCP T ZCP +T NZCP +F ZCP +F NZCP . (5) Feature Extraction Distorted Sinusoidal Signal With various noise and/or harmonic levels m C R RMSE ZCP/ NZCP Decision Tree Classifier Fig. 1: Block diagram representation of proposed work. 3. Result Analysis Decision tree classier is trained with all 96 datasets which are created with various levels of noise, THD and window size in Google Colab. The performance of the model is observed in terms of accuracy. 3.1. Decision Tree Classier Model Performance on Distorted Signal with Noise The Decision Tree (DT) model is trained and tested on datasets which are created with a distorted sinusoidal signal with various noise levels from 10 % to 60 %. To get a better DT model, this model is trained by tuning the hyperparameters like depth of the tree and cost functions i.e. entropy and Gini index. Testing and training accuracy for the DT model on these 28 datasets for various combinations of several trees and the cost functions are presented in Tab. 1. The combination of depth of the tree and cost function that gave better testing accuracy is considered as optimal DT model for each dataset and is highlighted in Tab. 1. The performance of the DT model on ZCP detection in distorted signals with various noise levels is observed in terms of testing and training accuracy with respect to various window sizes i.e. 5, 10, 15 and 20 are presented in Fig. 2. If testing accuracy of the DT model for different window sizes is equal then the model that gives better training accuracy considered as an optimal model. To avoid a DT model specic to a particular noise level, A new DT model is trained and tested on a distorted signal with all noise levels 10 % to 60 % using datasets "ZCP-Noise-25", "ZCPNoise-26", "ZCP-Noise-27" and "ZCP-Noise-28" with different window sizes i.e. 5, 10, 15 and 20. The impact of window size on the performance of the DT model in terms of testing accuracy is presented in Fig. 3. From Fig. 3, it is observed that the DT model at performs well during training and testing with a window size of 20. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 446
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 1: Testing and training accuracy of DT model to detect ZCP in distorted signal with different noise levels. Dataset Entropy Gini Dataset Entropy Gini Depth Accuracy Accuracy Depth Depth Accuracy Accuracy Depth Testing Training Testing Training Testing Training Testing Training ZCP-NOISE-01 12 98.3 100 97.3 100 7 ZCP-NOISE-15 10 97.3 100 95.6 100 9 9 97.3 99.7 97.6 99.7 6 9 97.3 99.8 94.3 98.2 6 6 97.3 98.9 97 99.1 4 6 97.3 97.9 96 96.8 4 3 97.6 97.8 96.3 98.1 2 3 93.6 94.9 95.3 93.5 2 ZCP-NOISE-02 9 94 100 94.6 100 11 ZCP-NOISE-16 9 96 100 96.3 100 9 6 93.6 97.9 94.6 98.4 6 8 96 99.7 96 98.8 6 4 93.3 97.1 94.6 97.1 4 6 96 98.9 95.6 97.5 4 2 93.6 95.2 94.3 95.8 2 3 95 96.4 95.6 95.6 2 ZCP-NOISE-03 9 98 100 95.6 96.8 9 ZCP-NOISE-17 12 96.3 100 96.6 100 9 6 97.6 99.5 98.3 99.5 6 9 96.3 99.5 96 99.5 6 4 97.6 98.5 98 98.5 4 6 96 98.9 96.6 98.8 4 2 95.6 96.8 95.3 96.8 2 3 97.6 98.1 95.6 97.5 2 ZCP-NOISE-04 12 96.3 100 96.6 100 11 ZCP-NOISE-18 12 94.6 100 95 100 8 9 96.3 99.5 95 97.9 6 9 94.6 99.4 94 99.4 6 6 96.3 97.9 95 95.9 4 6 93.6 96.9 95.6 97.7 4 3 94.6 94.9 95 93.5 2 3 94.6 95.9 94.6 94.6 2 ZCP-NOISE-05 9 96 100 96 100 8 ZCP-NOISE-19 9 94.3 100 96 100 9 6 95.6 99.1 96 99.2 6 8 94.6 99.8 95 99.7 6 4 96 98.7 95.6 98.7 4 6 95 99.7 94.3 98.7 4 2 95.6 97.5 95.6 97.5 2 3 94.3 97.2 95.3 96.2 2 ZCP-NOISE-06 10 93 94.5 93.3 100 9 ZCP-NOISE-20 8 94.6 100 95.6 100 9 9 96 99.8 94 99.2 6 6 95.3 98.7 96.3 99.4 6 6 93.6 98.2 95.6 96.9 4 4 93.3 96.2 95.3 97.4 4 3 93.6 93.1 93 94.5 2 3 92.6 95.6 95 95.5 2 ZCP-NOISE-07 11 96.6 100 97 97.9 8 ZCP-NOISE-21 6 96 100 96 100 6 9 97.3 99.7 96.6 99.5 6 5 96.6 99.4 96.6 99.5 4 6 96.6 98.9 97 98.5 4 4 96.6 98.8 96.6 98.8 3 3 97 97.9 96.3 97.5 2 3 96.6 98.1 96.6 98.1 2 ZCP-NOISE-08 12 95.3 100 97.3 100 10 ZCP-NOISE-22 13 93.3 100 91.6 100 10 9 96 99.4 97 98.9 6 9 91.6 98.1 92.6 98.1 6 6 94.6 98.2 96.3 97.8 4 6 92.3 96.9 92.6 96.5 4 3 95.3 95.9 95.6 95.6 2 3 91.3 93.6 91.6 95.2 2 ZCP-NOISE-09 6 95.3 95.9 97.6 100 6 ZCP-NOISE-23 13 93.3 100 91.6 95.2 10 4 98 98.5 97.6 99.8 5 8 91.6 97.7 91.6 99.5 6 3 98.3 98.4 97.6 99.4 4 6 92.3 96.9 92.6 96.5 4 2 97.6 98.1 97.6 98.1 2 3 91.3 93.6 91.6 95.2 2 ZCP-NOISE-10 16 92.3 100 94.3 100 11 ZCP-NOISE-24 8 95.3 100 95 100 10 9 92.6 98.1 94 98.5 6 7 95.3 99.5 95 99.2 6 6 94 96.8 93 96.9 4 6 95 98.4 95 97.8 4 3 91.3 93.9 91.3 95.2 2 3 95 95.1 93.6 96.7 2 ZCP-NOISE-11 897.6 100 97 100 8 ZCP-NOISE-25 27 94.9 100 95.7 100 18 7 96.6 99.8 96.6 99.8 6 14 95 98.3 95.5 98.3 10 6 96.6 99.8 97 98.8 4 6 96.1 96.8 96.1 97.1 6 3 98 97.9 98 97.9 2 3 96.3 96.1 96.4 96 2 ZCP-NOISE-12 9 95.6 100 95.3 100 9 ZCP-NOISE-26 23 89.1 100 89.5 100 21 8 96 99.7 94.6 98.8 6 15 89.6 98.8 90.5 98 13 6 95.6 98.9 95.6 97.5 4 6 90.8 93 90.8 96.4 10 3 94.6 96.4 95.3 95.6 2 3 88.3 91 90 94.8 8 ZCP-NOISE-13 10 96.3 100 96.3 100 11 ZCP-NOISE-27 24 92 100 92.2 100 23 9 96.3 99.8 96 99.1 6 20 92.3 99.6 91.8 99.4 16 6 96 99.1 96 98.7 4 14 92.7 98.3 91.7 95.9 9 3 96 98.5 95.6 97.5 2 8 92 94.6 90 91 2 ZCP-NOISE-14 15 94 100 95 100 9 ZCP-NOISE-28 19 94 100 94.7 100 19 9 95.3 98.4 96 98.9 6 10 93.5 96.4 94.5 97.5 10 6 93.3 97.5 95.6 96.7 4 6 91.8 93.2 93.8 96.3 8 3 93.6 93.5 96.6 94.8 2 3 89.1 88.4 87.4 87.1 2 The performance of the DT model on ZCP detection in distorted signals with various noise levels is observed in terms of testing and training accuracy with respect to various window sizes i.e. 5, 10, 15 and 20 are presented in Fig. 2. If testing accuracy of the DT model for different window sizes is equal then the model that gives better training accuracy considered as an optimal model. To avoid a DT model specic to a particular noise level, A new DT model is trained and tested on a distorted signal with all noise levels 10 % to 60 % using datasets "ZCP-Noise-25", "ZCPNoise-26", "ZCP-Noise-27" and "ZCP-Noise-28" with different window sizes i.e. 5, 10, 15 and 20. The impact of window size on the performance of the DT model in terms of testing accuracy is presented in Fig. 3. From Fig. 3, it is observed that the DT model at performs well during training and testing with a window size of 20. Finally, the parameters of optimal DT models like cost function and depth of the tree, the performance of the optimal models in terms of training and testing accuracy with respect to each noise level are presented in Tab. 2. From Tab. 2, DT model has the maximum testing accuracy of 98.3 % with a noise level of 10 % and 30 % but if all noise signals are added then it has the minimum accuracy of 96.4 %. The information about correctly and incorrectly predicted ZCPs are presented in Tab. 3. From Tab. 3, it is observed that the DT model can detect ZCP with good accuracy for noise levels 10 % to 60 % but when all signals are combined then it has more false ZCP detection problems. The confusion matrix which is built with © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 447
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER 98.3 94.6 98.3 96.6 100 100 99.5 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (a) Noise Level 10 %. 96 96 97.3 97.3 100 99.8 99.7 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (b) Noise Level 20 %. 98.3 94.3 98 96 98.4 100 97.9 99.7 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (c) Noise Level 30 %. 96.3 96 97.3 96.3 100 98.9 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (d) Noise Level 40 %. 97.6 95.6 96 96.3 98.1 97.7 100 99.4 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (e) Noise Level 50 %. 96.6 93.3 93.3 95.3 99.4 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (f) Noise Level 60 %. Fig. 2: Impact of window size on testing accuracy of DT model on distorted signal with various noise levels. Tab. 2: Optimal DT model parameters for various noise levels. Noise Level Dataset Accuracy Depth Cost function Testing Training Entropy Gini 10 % ZCP-NOISE-01 98.3 100 12 Yes No 20 % ZCP-NOISE-08 97.3 100 10 No Yes 30 % ZCP-NOISE-09 98.3 98.4 3 Yes No 40 % ZCP-NOISE-15 97.3 100 10 Yes No 50 % ZCP-NOISE-17 97.6 98.1 3 Yes No 60 % ZCP-NOISE-21 96.6 99.4 4 Yes No 1060 % ZCP-NOISE-25 96.4 96 2 No Yes Tab. 3: Training and testing accuracy details of optimal DT models for various noise signals. Dataset Testing Data Training Data NZCP ZCP NZCP ZCP TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE ZCP-NOISE-01 289 4 6 1 682 0 15 0 ZCP-NOISE-08 245 5 46 4 566 0 131 0 ZCP-NOISE-09 284 2 11 3 662 2 24 9 ZCP-NOISE-15 269 4 23 4 633 0 64 0 ZCP-NOISE-17 281 6 12 1 663 1 21 12 ZCP-NOISE-21 279 8 11 2 663 1 30 3 ZCP-NOISE-25 1726 1 6 62 3995 5 29 159 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 448
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER testing data extracted from all distorted noisy signals is presented in Tab. 4. 96.4 90.8 92.7 94.7 96 96.4 98.3 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy Fig. 3: Impact of window size on testing accuracy of DT model on distorted signal with all noise levels. Tab. 4: Confusion Matrix with testing data for various noise signals. Confusion Predicted Matrix ZCP NZCP Actual ZCP 115 30 NZCP 77 3373 3.2. The Decision Tree Classier Model Performance on Distorted Signal with THD The DT model is trained and tested on datasets which are created with a distorted sinusoidal signal with various THD levels from 10 % to 60 %. To get the better the DT model, it is trained by tuning the hyperparameters like the depth of the tree and the cost functions i.e. entropy and Gini index. Testing and training accuracy for DT model on these 28 datasets for various combinations of several trees and the cost functions is presented in Tab. 5. The combination of the depth of the tree and cost function that gave better testing accuracy is considered as optimal DT model for each dataset and is highlighted in Tab. 5. The performance of the DT model on ZCP detection in distorted signals with various THD levels is observed in terms of testing and training accuracy using various window sizes i.e. 5, 10, 15 and 20 are presented in Fig. 4. If testing accuracy of the DT model for different window sizes is equal then model which gives better training accuracy is considered as the optimal model. To avoid a DT model specic to a particular THD level, a new DT model was trained and tested on a distorted signal with all THD levels 10 % to 60 % using datasets "ZCP-THD-25", "ZCPTHD-26", "ZCP-THD-27" and "ZCP-THD-28" with different window sizes i.e. 5, 10, 15 and 20. The impact of window size on performance of the DT model in terms of testing accuracy is presented in Fig. 5. From Fig. 5, it is observed that the DT model performs well during training and testing with a window size of 10. Finally, the parameters of an optimal DT models like the cost function and the depth of the tree, the performance of the optimal models in terms of training and testing accuracy with respect to each THD level are presented in Tab. 6. From Tab. 6, the DT model has maximum testing accuracy of 100 % with noise level 10 % and 60 % but with all the noise signals, it has minimum accuracy of 96.4 %. The information about correctly and incorrectly predicted ZCPs are presented in Tab. 7. From Tab. 7, it is observed that DT model has more false ZCP detection problem with combined signals. The impact of THD level on testing accuracy of the DT model is shown in Fig. 6, from the Fig. 6 it is observed that the performance of the DT model is slightly decreasing for distorted signals with all combined THD levels. Confusion matrix which is build with testing data that extracted from all distorted signals due to harmonics is presented in Tab. 8. 3.3. Decision Tree Classier Performance on Distorted Signal with Harmonics and Noise The DT model is trained and tested on datasets which are created with a distorted sinusoidal signal with various THD and noise levels. To get the better the DT model, it is trained by tuning the hyperparameters like the depth of the tree and the cost functions i.e. entropy and Gini index. Testing and training accuracy for DT model on these 40 datasets for various combinations of several trees and the cost functions are presented in Tab. 9. The combination of the depth of the tree and cost function that gave better testing accuracy is considered as optimal DT model for each dataset and is highlighted in Tab. 9. The performance of the DT model on ZCP detection in distorted signals with various THD and noise level combination is observed in terms of testing and training accuracy using various window sizes i.e. 5, 10, 15 and 20 are presented in Fig. 7. If testing accuracy of the DT model for different window sizes is equal then model that gives better training accuracy is considered as the optimal model. To avoid a DT model specic to a particular THD and noise level combination, a new DT model was trained and tested on a distorted signal with all THD and noise level combinations using datasets "ZCP-NTHD-37", "ZCP-NTHD-38", "ZCP-NTHD-39" and "ZCP-NTHD-40" with different window sizes i.e. 5, 10, 15 and 20. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 449
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 5: Testing and training accuracy of DT model to detect ZCP in distorted signal with different THD levels. Dataset Entropy Gini Dataset Entropy Gini Depth Accuracy Accuracy Depth Depth Accuracy Accuracy Depth Testing Training Testing Training Testing Training Testing Training ZCP-THD-01 2 100 100 100 100 2 ZCP-THD-15 5 100 100 100 100 5 1 97.67 97.84 97.67 97.84 1 3 98 97.99 98 97.99 3 ZCP-THD-02 7 98.33 100 100 100 7 ZCP-THD-16 6 100 100 100 100 6 5 98 99.71 98 99.57 5 3 96 95.98 96 95.98 3 3 97.66 98.56 97.67 98.56 3 2 91 90.67 91 90.67 2 1 95.67 97.27 95.67 97.27 1 1 87.33 84.36 91 90.67 1 ZCP-THD-03 2 100 100 100 100 2 ZCP-THD-17 3 100 100 100 100 3 1 97.66 97.85 97.66 97.85 1 2 100 99.85 100 99.85 2 ZCP-THD-04 3 100 100 100 100 2 ZCP-THD-18 8 100 100 100 100 8 2 97.66 97.85 97.67 97.85 1 6 96.67 97.13 96.67 97.13 6 1 95.33 95.26 4 93.33 94.41 93.33 94.41 4 ZCP-THD-05 3 99.67 100 99.67 100 3 ZCP-THD-19 2 100 100 100 100 2 2 100 99.85 100 99.85 2 1 91.67 89.67 91.67 89.67 1 ZCP-THD-06 2 100 100 100 100 2 ZCP-THD-20 8 98 100 98 100 8 1 95.33 95.26 97.66 97.84 1 6 98 99.14 98.33 99.14 6 ZCP-THD-07 2 100 100 100 100 2 ZCP-THD-21 7 100 100 100 100 7 1 95 95.41 95 95.41 1 5 98 97.7 98.33 97.84 5 ZCP-THD-08 7 97 100 97 100 7 ZCP-THD-22 8 100 100 100 100 8 5 97.33 99.71 97.33 99.71 5 6 97.33 98.42 97.33 98.42 6 3 96.33 98.13 96.33 98.13 3 4 90.67 92.4 90.67 92.4 4 1 93 94.84 93 94.84 1 2 87 85.93 91.67 92.25 2 ZCP-THD-09 2 100 100 100 100 2 ZCP-THD-23 3 100 100 100 100 3 1 95 95.41 95 95.41 1 2 100 99.85 100 99.85 2 ZCP-THD-10 2 100 100 100 100 2 ZCP-THD-24 10 100 100 100 100 9 1 95 95.41 95 95.41 1 8 96.33 96.41 96 96.27 7 ZCP-THD-11 3 100 100 100 100 3 ZCP-THD-25 9 99.55 100 99.44 100 9 2 100 99.85 100 99.85 2 7 99.27 99.95 99.61 99.78 7 1 95 95.41 95 95.41 1 5 98.9 99.23 98.1 98.1 5 ZCP-THD-12 3 100 100 100 100 5 ZCP-THD-26 11 99.49 100 99.33 100 12 2 95 95.41 97.67 98.13 3 9 99.66 99.95 99.27 99.88 9 1 91.67 89.67 97.67 98.13 2 6 99.11 99.4 97.43 98.49 6 ZCP-THD-13 5 99.67 100 99.67 100 6 ZCP-THD-27 17 99.44 100 99.16 100 16 3 99.33 99.13 99.33 99.13 3 12 98.38 99.31 98.66 99.54 12 2 99.33 99.13 99.33 99.13 2 8 96.49 96.63 96.49 96.96 8 1 93.33 92.53 93.33 92.53 1 4 91.69 92.12 91.69 92.12 4 ZCP-THD-14 6 98.33 100 98.33 100 6 ZCP-THD-28 22 99.27 100 99.49 100 13 3 97.33 98.27 97.66 98.85 3 16 98.38 99.16 97.04 97.87 8 2 97.66 98.13 97.33 98.27 2 9 94.31 94.26 93.7 93.69 5 1 91.67 91.82 91.33 91.96 1 2 81.89 81.2 83.45 82.92 2 Tab. 6: Optimal DT model parameters for various THD levels. Noise Level Dataset Accuracy Depth Cost function Testing Training Entropy Gini 10 % ZCP-THD-01 100 100 2 Yes No 20 % ZCP-THD-06 100 100 2 Yes No 30 % ZCP-THD-09 100 100 2 Yes No 40 % ZCP-THD-15 100 100 5 Yes No 50 % ZCP-THD-17 100 100 3 Yes No 60 % ZCP-THD-21 100 100 7 Yes No 1060 % ZCP-THD-26 99.66 99.95 9 Yes No Tab. 7: Training and testing accuracy details of optimal DT models for various THD signals. Dataset Testing Data Training Data NZCP ZCP NZCP ZCP TRUE FALSE TRUE FALSE TRUE FALSE TRUE FALSE 10 % 286 0 14 0 664 0 33 0 20 % 286 0 14 0 664 0 33 0 30 % 275 0 25 0 625 0 72 0 40 % 262 0 38 0 588 0 109 0 50 % 262 0 38 0 588 0 109 0 60 % 248 0 52 0 552 0 145 0 1060 % 1635 0 154 6 3765 0 420 2 Finally, the parameters of an optimal DT models like the cost function and the depth of the tree, the performance of the optimal models in terms of training and testing accuracy with respect to each THD and noise level combination are presented in Tab. 10. From Tab. 10, the DT model has minimum testing accuracy of 99.4 % with all noise and THD and noise level combinations due to highly diversied data. The information regarding correctly and incorrectly predicted ZCPs are presented in Tab. 11. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 450
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER 100 100 100 100100 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (a) THD Level 10 %. 100 100 100 97.33 99.85 100 100 99.71 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (b) THD Level 20 %. 100 100 100 100100 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (c) THD Level 30 %. 99.67 98.33 100 100100 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (d) THD Level 40 %. 100 100 100 98 100 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (e) THD Level 50 %. 100 100 100 100100 100 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy (f) THD Level 60 %. Fig. 4: Impact of window size on testing accuracy of DT model on distorted signal with various THD levels. 99.61 99.66 99.44 99.49 99.78 99.95 100 100 5 10 15 20 90 91 92 93 94 95 96 97 98 99 100 Testing Accuracy Training Accuracy Fig. 5: Impact of window size on testing accuracy of DT model on distorted signal with all THD levels. Tab. 8: Confusion Matrix with testing data for all THD signals. Confusion Predicted Matrix ZCP NZCP Actual ZCP 181 0 NZCP 0 3254 From Tab. 11, it is observed that the DT model has more false ZCP detection problem with consideration of all THD and noise level combinations. The confusion matrix which is built with testing data that extracted from all distorted signals due to both noise and harmonics is presented in Tab. 12. 3.4. Comparative Analysis The comparison of the performance of each model i.e., logistic regression and decision tree classier in terms of testing accuracy for detection of ZCP on various signals is presented in this section. 1) Comparative Analysis on Noise Signals Comparison between machine learning models i.e. logistic regression and decision tree classier based on the performance of ZCP detection on various © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 451
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 9: Testing and training accuracy of DT model to detect ZCP in distorted signal with different THD and noise level combinations. Dataset Entropy Gini Dataset Entropy Gini Depth Accuracy Accuracy Depth Depth Accuracy Accuracy Depth Testing Training Testing Training Testing Training Testing Training ZCP-NTHD-01 2 99.66 100 99.66 100 3 ZCP-NTHD-22 3 100 100 100 100 3 1 96.66 96.7 99 98.99 2 2 100 99.85 100 99.85 2 ZCP-NTHD-02 4 99.66 100 99 100 3 1 95 95.4 95 95.4 1 3 99 99.85 97.66 98.99 2 ZCP-NTHD-23 3 100 100 100 100 3 2 99 99.85 97.66 98.99 1 2 100 99.85 100 99.85 2 ZCP-NTHD-03 6 98.33 100 98 100 5 1 93.33 92.53 93.33 92.53 1 4 98.66 99.71 97.33 99.13 3 ZCP-NTHD-24 20 97.33 100 98 100 19 3 97.33 99.13 97 98.56 2 15 94 95.98 92 93.68 13 2 96.66 98.42 97 98.56 1 10 89.33 8923 88.33 86.94 7 ZCP-NTHD-04 6 98.66 100 97.66 100 9 5 86 85.22 83 81.2 1 4 98 98.7 97.33 99.28 6 ZCP-NTHD-25 19 98 100 97.66 100 15 3 98 96.98 98.33 98.27 3 13 98 98.42 97 98.42 10 2 96.66 94.83 95.66 95.55 2 7 96.33 96.84 96.33 96.98 5 ZCP-NTHD-05 2 99.66 100 99.66 100 3 1 95.33 95.26 95.33 95.4 2 1 94 95.83 99.66 99.85 2 ZCP-NTHD-26 3 100 100 100 100 3 ZCP-NTHD-06 4 99.33 100 99.33 100 3 2 100 99.85 100 99.85 2 3 99.33 99.825 99.33 99.42 2 1 95 95.4 95 95.4 1 2 99.66 99.56 98.66 98.13 1 ZCP-NTHD-27 2 100 100 100 100 2 ZCP-NTHD-07 3 99.66 100 99.66 100 3 1 93.33 92.53 93.33 92.53 1 2 99.66 99.85 99.66 99.85 2 ZCP-NTHD-28 2 99.33 100 99.33 100 2 1 93.66 99.53 93.66 92.53 1 1 91 89.67 91 89.67 1 ZCP-NTHD-08 6 97.66 100 97 100 6 ZCP-NTHD-29 5 99.66 100 100 100 4 4 97.66 99.85 97.66 99.85 4 3 99.33 99.42 100 99.71 3 3 98 95.56 98 99.56 3 2 99.33 99.28 100 99.28 2 2 98 99.42 98 99.56 2 1 94.33 97.13 98 98.56 1 ZCP-NTHD-09 4 99.66 100 99.66 100 4 ZCP-NTHD-30 3 100 100 100 100 3 3 99.33 99.56 99 99.56 3 2 100 99.85 100 99.85 2 2 99.33 99.42 99.33 99.42 2 1 95 95.4 95 95.4 1 1 98.33 97.77 98.33 97.77 1 ZCP-NTHD-31 7 97 100 97 100 7 ZCP-NTHD-10 3 100 100 100 100 3 5 97.66 99.85 96 99.85 5 2 100 99.85 100 99.85 2 3 97 98.99 97.66 99.13 3 1 95 95.4 95 95.4 1 1 97.33 97.13 98.66 97.41 1 ZCP-NTHD-11 3 99.66 100 99.66 100 3 ZCP-NTHD-32 6 97.33 100 97 100 7 2 99.66 99.85 99.66 99.85 2 4 97.33 99.13 97.66 99.71 5 1 93.66 92.53 93.66 92.53 1 3 97.33 98.7 97 98.42 3 ZCP-NTHD-12 2 100 100 100 100 2 2 97.33 97.27 97.33 99.13 1 1 91.66 89.69 91.66 89.69 1 ZCP-NTHD-33 6 100 100 99.66 100 6 ZCP-NTHD-13 4 100 100 100 100 4 4 99.33 99.28 99.66 99.71 4 3 99.33 99.56 99.56 99.33 3 3 98.66 99.13 99.66 99.71 3 2 99.33 99.42 99.33 99.42 2 2 98.66 99.13 98 97.27 2 1 98.33 97.7 98.33 97.7 1 ZCP-NTHD-34 4 99 100 99 100 4 ZCP-NTHD-14 3 100 100 100 100 3 3 99.33 99.85 99.33 99.85 3 2 100 99.85 100 99.85 2 2 99.33 99.13 99.33 99.13 2 1 95 95.4 95 95.4 1 1 99.33 98.7 99.33 98.7 1 ZCP-NTHD-15 3 99.66 100 99.66 100 3 ZCP-NTHD-35 7 98.66 100 98.66 100 6 2 99.66 99.85 99.66 99.85 2 5 98.66 99.28 98.33 99.13 4 1 93.66 92.53 93.66 92.53 1 3 98.33 97.84 98.66 98.7 3 ZCP-NTHD-16 3 100 100 100 100 3 1 97.33 97.27 98 97.41 2 2 100 99.85 100 99.85 2 ZCP-NTHD-36 9 96 100 94.33 100 10 1 91.66 89.67 91.66 89.67 1 6 94.33 98.99 93.66 99.56 7 ZCP-NTHD-17 4 100 100 100 100 4 3 94.33 96.98 94.66 97.27 4 3 99.33 99.56 99.33 99.56 3 2 89 88.23 83.33 85.07 1 2 99.33 99.42 99.33 99.42 2 ZCP-NTHD-37 24 99.4 100 99.21 100 24 1 98.33 97.7 98.33 97.7 1 18 99.21 99.84 99.03 99.84 18 ZCP-NTHD-18 4 99.66 100 99.66 100 4 12 99.21 99.64 99.07 99.63 12 3 99.33 99.85 99.33 99.85 3 6 97.99 97.99 98.06 98.04 6 2 100 99.71 100 99.71 2 ZCP-NTHD-38 10 99.44 100 99.4 100 11 1 95 95.26 95 95.26 1 7 99.33 99.77 99.07 99.61 7 ZCP-NTHD-19 8 98 100 98 100 8 4 98.4 98.29 98.1 97.93 4 6 98 99.85 98 99.85 6 1 93.68 93.28 93.68 93.56 1 4 98 99.71 98 99.71 4 ZCP-NTHD-39 13 98.84 100 98.88 100 12 2 98 99.28 98 99.28 2 9 98.84 99.72 98.95 99.93 9 ZCP-NTHD-20 6 97.66 100 97.66 100 6 6 98.51 98.93 98.73 99.23 6 4 97.66 99.85 97.66 99.85 4 3 95.02 94.85 95.02 94.85 3 3 98 99.42 98 99.42 3 ZCP-NTHD-40 22 98.17 100 98.32 100 21 2 98 99.42 98 99.42 2 17 97.91 99.53 97.91 99.52 17 ZCP-NTHD-21 4 100 100 100 100 4 12 97.43 98.67 97.58 98.59 12 3 100 99.85 100 99.85 3 7 96.43 96.78 96.84 96.95 7 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 452
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER 1.1. Identication of Best Threshold for m 1) Calculate IG for Threshold ≥ −448 Using Tab. 14 Tab. 14: Sub Table: m Vs. class with threshold ≥ −448 . m Class m Class ≥ −448 0 <−448 1 <−448 0 <−448 1 <−448 0 <−448 1 <−448 1 <−448 0 <−448 1 <−448 0 Calculate probability for class label. Parameter 1 0 Count 5 5 Probability P(1)= 5 10 P(0)= 5 10 Calculate entropy for class label. E(class) = E(1,0) = =−P(1) log2P(1) −P(0) log2P(0) . (6) E(class) = E(1,0) = −5 10 log2 5 10 −5 10 log2 5 10 = 1. (7) Calculate probability with respect to feature m threshold ≥ −448 . Threshold 1 0 Probability ≥ −448 5 5 10 10 =1 <−448 0 0 0 Calculate entropy with respect to feature m threshold ≥ −448 . E(m≥ −448) = E(5,5) = =−5 10 log2 5 10 −5 10 log2 5 10 = 1. (8) E(m < −448) = E(0,0) = 0. (9) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −448) E(m≥ −448) + +P(m < −448) E(m < −448) = = (1) (1) + (0) (0) = 1. (10) Calculate information gain of feature m≥ −448 . IG (m≥ −448) = E(class)−E(class, m) = = 1 −1=0. (11) 2) Calculate IG for Threshold ≥ −313 Using Tab. 15 Tab. 15: Sub Table: m Vs. class with threshold ≥ −313 . m Class m Class <−313 0 ≥ −313 1 ≥ −313 0 ≥ −313 1 <−313 0 <−313 1 ≥ −313 1 ≥ −313 0 ≥ −313 1 <−313 0 Calculate probability with respect to feature m threshold ≥ −313 . Threshold 1 0 Probability ≥ −313 4 2 6 10 =0.6 <−313 1 3 4 10 =0.4 Calculate entropy with respect to feature m threshold ≥ −313 . E(m≥ −313) = E(4,2) = =−4 6log2 4 6−2 6log2 2 6= 0.723. (12) E(m < −313) = E(1,3) = =−1 4log2 1 4−3 4log2 3 4= 0.811. (13) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −313) E(m≥ −313) + +P(m < −313) E(m < −313) = (0.6) (0.723) + + (0.4) (0.811) = 0.7582. (14) Calculate information gain of feature m≥ −313 . IG (m≥ −313) = E(class)−E(class, m) = = 1 −0.7582 = 0.2418. (15) 3) Calculate IG for Threshold ≥ −331 Using Tab. 16 Tab. 16: Sub Table: m Vs. class with threshold ≥ −331 . m Class m Class <−331 0 ≥ −331 1 ≥ −331 0 ≥ −331 1 ≥ −331 0 ≥ −331 1 ≥ −331 1 ≥ −331 0 ≥ −331 1 ≥ −331 0 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 459
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 17: Probability for each spilt: m≥ −313 and m < −313 . Threshold 1 0 Probability ≥ −331 5 4 9 10 =0.9 <−331 0 1 1 10 =0.1 Calculate probability with respect to feature m threshold ≥ −331 and presented in Tab. 17. Calculate entropy with respect to feature m threshold ≥ −331 . E(m≥ −331) = E(5,4) = =−5 9log2 5 9−4 9log2 4 9= 0.991. (16) E(m < −331) = E(0,1) = =−0 1log2 0 1−1 1log2 1 1= 0. (17) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −331) E(m≥ −331) + +P(m < −331) E(m < −331) = = (0.9) (0.991) + (0.1) (0) = 0.8919. (18) Calculate information gain of feature m≥ −331 . IG (m≥ −331) = E(class)−E(class, m) = = 1 −0.8919 = 0.1081. (19) 4) Calculate IG for Threshold m≥ −269 Using Tab. 18 Tab. 18: Sub Table: m Vs. class with threshold ≥ −269 . m Class m Class <−269 0 <−269 1 <−269 0 <−269 1 <−269 0 <−269 1 <−269 1 <−269 0 ≥ −269 1 <−269 0 Calculate probability with respect to feature m threshold ≥ −269 and presented in Tab. 19 . Tab. 19: Probability for each spilt: m≥ −269 and m < −269 . Threshold 1 0 Probability ≥ −331 1 0 1 10 =0.1 <−331 4 5 9 10 =0.9 Calculate entropy with respect to feature m threshold ≥ −269 . E(m≥ −269) = E(1,0) = =−1 1log2 1 1−0 1log2 0 1= 0. (20) E(m < −269) = E(4,5) = =−4 9log2 4 9−5 9log2 5 9= 0.991. (21) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −269) E(m≥ −269) + +P(m < −269) E(m < −269) = = (0.1) (0) + (0.9) (0.991) = 0.8919. (22) Calculate information gain of feature m≥ −269 . IG (m≥ −269) = =E(class)−E(class, m)=1−0.8919 = 0.1081. (23) 5) Calculate IG for Threshold m≥ −299 Using Tab. 20 Tab. 20: Sub Table: m Vs. class with threshold ≥ −299 . m Class m Class <−299 0 <−299 1 <−299 0 ≥ −299 1 <−299 0 <−299 1 ≥ −299 1 <−299 0 ≥ −299 1 <−299 0 Calculate probability with respect to feature m threshold ≥ −299 and presented in Tab. 21. Tab. 21: Probability for each spilt: m≥ −299 and m < −299 . Threshold 1 0 Probability ≥ −299 3 0 3 10 =0.3 <−299 2 5 7 10 =0.7 Calculate entropy with respect to feature m threshold ≥ −299 . E(m≥ −299) = E(3,0) = =−3 3log2 3 3−0 3log2 0 3= 0. (24) E(m < −299) = E(2,5) = =−2 7log2 2 7−5 7log2 5 7= 0.8631. (25) © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 460
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −299) E(m≥ −299) + +P(m < −299) E(m < −299) = = (0.3) (0) + (0.7) (0.8631) = 0.6042. (26) Calculate information gain of feature m≥ −299 . IG (m≥ −299) = E(class)−E(class, m) = = 1 −0.6042 = 0.3958. (27) 6) Calculate IG for Threshold m≥ −301 Using Tab. 22 Tab. 22: Sub Table: m Vs. class with threshold ≥ −301 . m Class m Class <−301 0 ≥ −301 1 <−301 0 ≥ −301 1 <−301 0 <−301 1 ≥ −301 1 <−301 0 ≥ −301 1 <−301 0 Calculate probability with respect to feature m threshold ≥ −301 and presented in Tab. 23. Tab. 23: Probability for each spilt: m≥ −301 and m < −301 . Threshold 1 0 Probability ≥ −301 4 1 5 10 =0.5 <−301 1 4 5 10 =0.5 Calculate entropy with respect to feature m threshold ≥ −301 . E(m≥ −301) = E(4,1) = =−4 5log2 4 5−1 5log2 1 5= 0.7212. (28) E(m < −301) = E(1,4) = =−1 5log2 1 5−4 5log2 4 5= 0.7212. (29) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −301) E(m≥ −301) + +P(m < −301) E(m < −301) = = (0.5) (0.7212) + (0.5) (0.7212) = 0.7212. (30) Calculate information gain of feature m≥ −301 . IG (m≥ −301) = E(class)−E(class, m) = = 1 −0.7212 = 0.2788. (31) 7) Calculate IG for Threshold m≥ −293 Using Tab. 24 Tab. 24: Sub Table: m Vs. class with threshold ≥ −293 . m Class m Class <−293 0 <−293 1 <−293 0 ≥ −293 1 <−293 0 <−293 1 <−293 1 <−293 0 ≥ −293 1 <−293 0 Calculate probability with respect to feature m threshold ≥ −293 and presented in Tab. 25. Tab. 25: Probability for each spilt: m≥ −293 and m < −293 . Threshold 1 0 Probability ≥ −293 2 0 2 10 =0.2 <−293 3 5 8 10 =0.8 Calculate entropy with respect to feature m threshold ≥ −293 . E(m≥ −293) = E(2,0) = =−2 2log2 2 2−0 2log2 0 2= 0. (32) E(m < −293) = E(3,5) = =−3 8log2 3 8−5 8log2 5 8= 0.9544. (33) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −293) E(m≥ −293) + +P(m < −293) E(m < −293) = = (0.2) (0) + (0.8) (0.9544) = 0.7635. (34) Calculate information gain of feature m≥ −293 . IG (m≥ −293) = E(class)−E(class, m) = = 1 −0.7635 = 0.2364. (35) 8) Calculate IG for Threshold m≥ −319 Using Tab. 26 Calculate probability with respect to feature m threshold ≥ −319 and presented in Tab. 27. Calculate entropy with respect to feature m threshold ≥ −319 . © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 461
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 26: Sub Table: m Vs. class with threshold ≥ −319 . m Class m Class <−319 0 ≥ −319 1 ≥ −319 0 ≥ −319 1 <−319 0 ≥ −319 1 ≥ −319 1 ≥ −319 0 ≥ −319 1 <−319 0 Tab. 27: Probability for each spilt: m≥ −319 and m < −319 . Threshold 1 0 Probability ≥ −319 5 2 7 10 =0.7 <−319 0 3 3 10 =0.3 E(m≥ −319) = E(5,2) = =−5 7log2 5 7−2 7log2 2 7= 0.8631. (36) E(m < −319) = E(0,3) = =−0 3log2 0 3−3 3log2 3 3= 0. (37) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −319) E(m≥ −319) + +P(m < −319) E(m < −319) = = (0.7) (0.8631) + (0.3) (0) = 0.6042. (38) Calculate information gain of feature m≥ −319 . IG (m≥ −319) = E(class)−E(class, m) = = 1 −0.6042 = 0.3958. (39) 9) Calculate IG for Threshold m≥ −303 Using Tab. 28 Tab. 28: Sub Table: m Vs. class with threshold ≥ −303 . m Class m Class <−303 0 ≥ −303 1 <−303 0 ≥ −303 1 <−303 0 <−303 1 ≥ −303 1 ≥ −303 0 ≥ −303 1 <−303 0 Calculate probability with respect to feature m threshold ≥ −303 and presented in Tab. 29. Calculate entropy with respect to feature m threshold ≥ −303 . E(m≥ −303) = E(4,1) = =−4 5log2 4 5−1 5log2 1 5= 0.7212. (40) Tab. 29: Probability for each spilt: m≥ −303 and m < −303 . Threshold 1 0 Probability ≥ −303 4 1 5 10 =0.5 <−303 1 4 5 10 =0.5 E(m < −303) = E(1,4) = =−1 5log2 1 5−4 5log2 4 5= 0.7212. (41) Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −303) E(m≥ −303) + +P(m < −303) E(m < −303) = = (0.5) (0.7212) + (0.5) (0.7212) = 0.7212. (42) Calculate information gain of feature m≥ −303 . IG (m≥ −303) = E(class)−E(class, m) = = 1 −0.7212 = 0.2788. (43) 10) Calculate IG for Threshold m≥ −324 Using Tab. 30 Tab. 30: Sub Table: m Vs. class with threshold ≥ −324 . m Class m Class <−324 0 ≥ −324 1 ≥ −324 0 ≥ −324 1 <−324 0 ≥ −324 1 ≥ −324 1 ≥ −324 0 ≥ −324 1 ≥ −324 0 Calculate probability with respect to feature m threshold ≥ −324 and presented in Tab. 31. Tab. 31: Probability for each spilt: m≥ −324 and m < −324 . Threshold 1 0 Probability ≥ −324 5 3 8 10 =0.8 <−324 0 2 2 10 =0.2 Calculate entropy with respect to feature m threshold ≥ −324 . E(m≥ −324) = E(5,3) = =−5 8log2 5 8−3 8log2 3 8= 0.9544. (44) E(m < −324) = E(0,2) = =−0 2log2 0 2−2 2log2 2 2= 0. (45) © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 462
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Calculate entropy of feature with respect to class. E(class, m) = P(m≥ −324) E(m≥ −324) + +P(m < −324) E(m < −324) = = (0.8) (0.9544) + (0.2) (0) = 0.7635. (46) Calculate information gain of feature m≥ −324 . IG (m≥ −324) = E(class)−E(class, m) = = 1 −0.7635 = 0.2365. (47) Information Gain of each split of feature m is presented in Tab. 32. From the Tab. 32, it is observed that split ≥ −299 and ≥ −319 have highest information gain value i.e 0.3958. Hence, ≥ −299 is considered as a best split. Tab. 32: Information Gain of each split of feature m . Split IG Split IG ≥ −448 0 ≥ −301 0.2788 ≥ −313 0.2418 ≥ −293 0.2364 ≥ −331 0.1081 ≥ −319 0.3958 ≥ −269 0.1081 ≥ −303 0.2788 ≥ −299 0.3958 ≥ −324 0.2365 1.2. Identication of Best Threshold for c i.e. Intercept Feature 1) Calculate IG for Threshold ≥2.9 Using Tab. 33 Tab. 33: Sub Table: c Vs. class with threshold ≥ 2.9. c Class c Class ≥ 2.9 0 ≥ 2.9 1 ≥ 2.9 0 ≥ 2.9 1 ≥ 2.9 0 ≥ 2.9 1 ≥ 2.9 1 ≥ 2.9 0 < 2.9 1 ≥ 2.9 0 Calculate probability with respect to feature c threshold ≥ 2.9 as shown in Tab. 34. Tab. 34: Probability for each spilt: c≥ 2.9 and c < 2.9. Threshold 1 0 Probability ≥ 2.9 4 5 9 10 =0.9 < 2.9 1 0 1 10 =0.1 Calculate entropy with respect to feature c threshold ≥ 2.9. E(c≥2.9) = E(4,5) = =−4 9log2 4 9−5 9log2 5 9= 0.991. (48) E(c < 2.9) = E(1,0) = =−1 1log2 1 1−0 1log2 0 1= 0. (49) Calculate entropy of feature with respect to class. E(class, c) = P(c≥2.9) E(c≥2.9) + +P(c < 2.9) E(c < 2.9) = = (0.9) (0.991) + (0.1) (0) = 0.8919. (50) Calculate information gain of feature c≥ 2.9. IG (c≥2.9) = E(class)−E(class, c) = = 1 −0.8919 = 0.1081. (51) 2) Calculate IG for Threshold ≥3.2 Using Tab. 35 Tab. 35: Sub Table: c Vs. class with threshold ≥ 3.2. c Class c Class ≥ 3.2 0 < 3.2 1 < 3.2 0 < 3.2 1 ≥ 3.2 0 ≥ 3.2 1 < 3.2 1 < 3.2 0 < 3.2 1 ≥ 3.2 0 Calculate probability with respect to feature c threshold ≥ 3.2 as shown in Tab. 36. Tab. 36: Probability for each spilt: c≥ 3.2 and c < 3.2. Threshold 1 0 Probability ≥ 3.2 1 3 4 10 =0.4 < 3.2 4 2 6 10 =0.6 Calculate entropy with respect to feature c threshold ≥ 3.2. E(c≥3.2) = E(1,3) = =−1 4log2 1 4−3 4log2 3 4= 0.811. (52) E(c < 3.2) = E(4,2) = =−4 6log2 4 6−2 6log2 2 6= 0.9183. (53) Calculate entropy of feature with respect to class. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 463
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER E(class, c) = P(c≥3.2) E(c≥3.2) + +P(c < 3.2) E(c < 3.2) = = (0.4) (0.811) + (0.6) (0.9183) = 0.8753. (54) Calculate information gain of feature c≥ 3.2. IG (c≥3.2) = E(class)−E(class, c) = = 1 −0.8753 = 0.1247. (55) 3) Calculate IG for Threshold ≥3.1 Using Tab. 37 Tab. 37: Sub Table: c Vs. class with threshold ≥ 3.1. c Class c Class ≥ 3.1 0 < 3.1 1 ≥ 3.1 0 < 3.1 1 ≥ 3.1 0 ≥ 3.1 1 < 3.1 1 < 3.1 0 < 3.1 1 ≥ 3.1 0 Calculate probability with respect to feature c threshold ≥ 3.1 as shown in Tab. 38. Tab. 38: Probability for each spilt: c≥ 3.1 and c < 3.1. Threshold 1 0 Probability ≥ 3.1 1 4 5 10 =0.5 < 3.1 4 1 5 10 =0.5 Calculate entropy with respect to feature c threshold ≥ 3.1. E(c≥3.1) = E(1,4) = =−4 5log2 4 5−1 5log2 1 5= 0.7212. (56) E(c < 3.1) = E(4,1) = =−1 5log2 1 5−4 5log2 4 5= 0.7212. (57) Calculate entropy of feature with respect to class. E(class, c) = P(c≥3.1) E(c≥3.1) + +P(c < 3.1) E(c < 3.1) = = (0.5) (0.7212) + (0.5) (0.7212) = 0.7212. (58) Calculate information gain of feature c≥ 3.1. IG (c≥3.1) = E(class)−E(class, c) = = 1 −0.7212 = 0.2788. (59) Tab. 39: Sub Table: c Vs. class with threshold ≥ 3.3. c Class c Class ≥ 3.3 0 < 3.3 1 < 3.3 0 < 3.3 1 ≥ 3.3 0 < 3.3 1 < 3.3 1 < 3.3 0 < 3.3 1 < 3.3 0 4) Calculate IG for Threshold ≥3.3 Using Tab. 39 Calculate probability with respect to feature c threshold ≥ 3.3 as shown in Tab. 40. Tab. 40: Probability for each spilt: c≥ 3.3 and c < 3.3. Threshold 1 0 Probability ≥ 3.3 5 2 7 10 =0.7 < 3.3 0 3 3 10 =0.3 Calculate entropy with respect to feature c threshold ≥ 3.3. E(c≥3.3) = E(5,2) = =−5 7log2 5 7−2 7log2 2 7= 0.8631. (60) E(c < 3.3) = E(0,3) = =−0 3log2 0 3−3 3log2 3 3= 0. (61) Calculate entropy of feature with respect to class. E(class, c) = P(c≥3.3) E(c≥3.3) + +P(c < 3.3) E(c < 3.3) = = (0.7) (0.8631) + (0.3) (0) = 0.6041. (62) Calculate information gain of feature c≥ 3.3. IG (c≥3.3) = E(class)−E(class, c) = = 1 −0.6041 = 0.3959. (63) 5) Calculate IG for hreshold ≥3.0 Using Tab. 41 Tab. 41: Sub Table: c Vs. class with threshold ≥ 3.0. c Class c Class ≥ 3.0 0 ≥ 3.0 1 ≥ 3.0 0 < 3.0 1 ≥ 3.0 0 ≥ 3.0 1 ≥ 3.0 1 ≥ 3.0 0 < 3.0 1 ≥ 3.0 0 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 464
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 42: Probability for each spilt: c≥ 3.0 and c < 3.0. Threshold 1 0 Probability ≥ 3.0 3 5 8 10 =0.8 < 3.0 2 0 2 10 =0.2 Calculate probability with respect to feature c threshold ≥ 3.0 as shown in Tab. 42. Calculate entropy with respect to feature c threshold ≥ 3.0. E(c≥3.0) = E(3,5) = =−3 8log2 3 8−5 8log2 5 8= 0.9546. (64) E(c < 3.0) = E(2,0) = =−2 2log2 2 2−0 2log2 0 2= 0. (65) Calculate entropy of feature with respect to class. E(class, c) = P(c≥3.0) E(c≥3.0) + +P(c < 3.0) E(c < 3.0) = = (0.8) (0.9546) + (0.2) (0) = 0.7636. (66) Calculate information gain of feature c≥ 3.0. IG (c≥3.0) = E(class)−E(class, c) = = 1 −0.7636 = 0.2364. (67) 6) Calculate IG for Threshold ≥2.7 Using Tab. 43 Tab. 43: Sub Table: c Vs. class with threshold ≥ 2.7. c Class c Class ≥ 2.7 0 ≥ 2.7 1 ≥ 2.7 0 ≥ 2.7 1 ≥ 2.7 0 ≥ 2.7 1 ≥ 2.7 1 ≥ 2.7 0 ≥ 2.7 1 ≥ 2.7 0 Calculate probability with respect to feature c threshold ≥ 2.7 as shown in Tab. 44. Tab. 44: Probability for each spilt: c≥ 2.7 and c < 2.7. Threshold 1 0 Probability ≥ 2.7 5 5 10 10 =1 < 2.7 0 0 0 10 =0 Calculate entropy with respect to feature c threshold ≥ 2.7. E(c≥2.7) = E(5,5) = =−5 10 log2 5 10 −5 10 log2 5 10 = 1. (68) E(c < 3.0) = E(0,0) = 0. (69) Calculate entropy of feature with respect to class. E(class, c) = P(c≥2.7) E(c≥2.7) + +P(c < 2.7) E(c < 2.7) = = (1) (1) + (0) (0) = 1. (70) Calculate information gain of feature c≥ 2.7. IG (c≥2.7) = E(class)−E(class, c)=1−1 = 0. (71) 7) Calculate IG for Threshold ≥4.4 Using Tab. 45 Tab. 45: Sub Table: c Vs. class with threshold ≥ 4.4. c Class c Class ≥ 4.4 0 < 4.4 1 < 4.4 0 < 4.4 1 < 4.4 0 < 4.4 1 < 4.4 1 < 4.4 0 < 4.4 1 < 4.4 0 Calculate probability with respect to feature c threshold ≥ 4.4 as shown in Tab. 46. Tab. 46: Probability for each spilt: c≥ 4.4 and c < 4.4. Threshold 1 0 Probability ≥ 4.4 0 1 1 10 =0.1 < 4.4 5 4 9 10 =0.9 Calculate entropy with respect to feature c threshold ≥ 4.4. E(c≥4.4) = E(0,1) = =−0 1log2 0 1−1 1log2 1 1= 0. (72) E(c < 4.4) = E(5,4) = =−5 9log2 5 9−4 9log2 4 9= 0.9911. (73) Calculate entropy of feature with respect to class. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 465
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER E(class, c) = P(c≥4.4) E(c≥4.4) + +P(c < 4.4) E(c < 4.4) = = (0.1) (0) + (0.9) (0.9911) = 0.8919. (74) Calculate information gain of feature c≥ 4.4. IG (c≥4.4) = E(class)−E(class, c) = = 1 −0.8919 = 0.1081. (75) Information Gain of each split of feature c is presented in Tab. 47. From the Tab. 47, it is observed that split ≥ 3.3 gives highest information gain value i.e 0.3959. Hence, ≥ 3.3 is considered as a best split. Tab. 47: Information Gain of each split of feature c . Split IG Split IG ≥ 4.4 0.1081 ≥ 2.9 0.1081 ≥ 3.0 0.2364 ≥ 3.3 0.3959 ≥ 2.7 0 ≥ 3.1 0.2788 ≥ 3.2 0.1247 1.3. Identication of Best Threshold for R i.e. Correlation Feature 1) Calculate IG for Threshold ≥0.96 Using Tab. 48 Tab. 48: Sub Table: R Vs. class with threshold ≥ 0.96. R Class R Class ≥ 0.96 0 ≥ 0.96 1 ≥ 0.96 0 ≥ 0.96 1 ≥ 0.96 0 ≥ 0.96 1 ≥ 0.96 1 ≥ 0.96 0 ≥ 0.96 1 ≥ 0.96 0 Calculate probability with respect to feature R threshold ≥ 0.96 as shown in Tab. 49. Tab. 49: Probability for each spilt: R≥ 0.96 and R < 0.96. Threshold 1 0 Probability ≥ 0.96 5 5 10 10 =1 < 0.96 0 0 0 10 =0 Calculate entropy with respect to feature R threshold ≥ 0.96. E(R≥0.96) = E(5,5) = =−5 10 log2 5 10 −5 10 log2 5 10 = 1. (76) E(R < 0.96) = E(0,0) = 0. (77) Calculate entropy of feature with respect to class. E(class, R) = P(R≥0.96) E(R≥0.96) + +P(R < 0.96) E(R < 0.96) = = (1) (1) + (0) (0) = 1. (78) Calculate information gain of feature R≥ 0.96. IG (R≥0.96) = E(class)−E(class, R) = 1 −1=0. (79) 2) Calculate IG for Threshold ≥0.98 Using Tab. 50 Tab. 50: Sub Table: R Vs. class with threshold ≥ 0.98. R Class R Class < 0.98 0 ≥ 0.98 1 ≥ 0.98 0 ≥ 0.98 1 ≥ 0.98 0 ≥ 0.98 1 ≥ 0.98 1 ≥ 0.98 0 ≥ 0.98 1 ≥ 0.98 0 Calculate probability with respect to feature R threshold ≥ 0.98 as shown in Tab. 51. Tab. 51: Probability for each spilt: R≥ 0.98 and R < 0.98. Threshold 1 0 Probability ≥ 0.98 5 4 9 10 =0.9 < 0.98 0 1 1 10 =0.1 Calculate entropy with respect to feature R threshold ≥ 0.98. E(R≥0.98) = E(5,4) = =−5 9log2 5 9−4 9log2 4 9= 0.9911. (80) E(R < 0.98) = E(0,1) = =−0 1log2 0 1−1 1log2 1 1= 0. (81) Calculate entropy of feature with respect to class. E(class, R) = P(R≥0.98) E(R≥0.98) + +P(R < 0.98) E(R < 0.98) = = (0.9) (0.9911) + (0.1) (0) = 0.892. (82) Calculate information gain of feature R≥ 0.98. IG (R≥0.98) = E(class)−E(class, R) = = 1 −0.892 = 0.108. (83) © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 466
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER 3) Calculate IG for Threshold ≥0.99 Using Tab. 52 Tab. 52: Sub Table: R Vs. class with threshold ≥ 0.99. R Class R Class < 0.99 0 ≥ 0.99 1 < 0.99 0 ≥ 0.99 1 ≥ 0.99 0 ≥ 0.99 1 ≥ 0.99 1 ≥ 0.99 0 ≥ 0.99 1 ≥ 0.99 0 Calculate probability with respect to feature R threshold ≥ 0.99 as shown in Tab. 53. Tab. 53: Probability for each spilt: R≥ 0.99 and R < 0.99. Threshold 1 0 Probability ≥ 0.99 5 3 8 10 =0.8 < 0.99 0 2 2 10 =0.2 Calculate entropy with respect to feature R threshold ≥ 0.99. E(R≥0.99) = E(5,3) = =−5 8log2 5 8−3 8log2 3 8= 0.9544. (84) E(R < 0.99) = E(0,2) = =−0 2log2 0 2−2 2log2 2 2= 0. (85) Calculate entropy of feature with respect to class. E(class, R) = P(R≥0.99) E(R≥0.99) + +P(R < 0.99) E(R < 0.99) = = (0.8) (0.9544) + (0.2) (0) = 0.7635. (86) Calculate information gain of feature R≥ 0.98. IG (R≥0.99) = E(class)−E(class, R) = = 1 −0.7635 = 0.2365. (87) 4) Calculate IG for Threshold ≥0.99 Using Tab. 54 Tab. 54: Sub Table: R Vs. class with threshold ≥ 0.1. R Class R Class < 0.1 0 ≥ 0.1 1 < 0.1 0 ≥ 0.1 1 < 0.1 0 ≥ 0.1 1 < 0.1 1 < 0.1 0 ≥ 0.1 1 < 0.1 0 Tab. 55: Probability for each spilt: R≥ 0.1 and R < 0.1. Threshold 1 0 Probability ≥ 0.1 4 0 4 10 =0.4 < 0.1 1 5 6 10 =0.6 Calculate probability with respect to feature R threshold ≥ 0.1 as shown in Tab. 55. Calculate entropy with respect to feature R threshold ≥ 0.1. E(R≥0.1) = E(4,0) = =−4 4log2 4 4−0 4log2 0 4= 1. (88) E(R < 0.1) = E(1,5) = =−1 6log2 1 6−5 6log2 5 6= 0.65. (89) Calculate entropy of feature with respect to class. E(class, R) = P(R≥0.1) E(R≥0.1) + +P(R < 0.1) E(R < 0.1) = = (0.4) (1) + (0.6) (0.65) = 0.79. (90) Calculate information gain of feature R≥ 0.1. IG (R≥0.1) = E(class)−E(class, R) = = 1 −0.79 = 0.21. (91) Information Gain of each split of feature R is presented in Tab. 56. From the Tab. 56, it is observed that split ≥ 0.99 gives highest information gain value i.e 0.2365. Hence, ≥ 0.99 is considered as a best split. Tab. 56: Information Gain of each split of feature R . Split IG Split IG ≥ 0.96 0 ≥ 0.99 0.2365 ≥ 0.98 0.108 ≥ 0.1 0.21 1.4. Identication of Best Threshold for RMSE i.e. Root Mean Square Error Feature 1) Calculate IG for Threshold ≥0.027 Using Tab. 57 Calculate probability with respect to feature RMSE threshold ≥ 0.027 as shown in Tab. 58. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 467
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 57: Sub Table: RMSE Vs. class with threshold ≥ 0.027. RMSE Class RMSE Class ≥ 0.027 0 < 0.027 1 < 0.027 0 < 0.027 1 < 0.027 0 < 0.027 1 < 0.027 1 < 0.027 0 < 0.027 1 < 0.027 0 Tab. 58: Probability for each spilt: RMSE ≥ 0.027 and RMSE < 0.027. Threshold 1 0 Probability ≥ 0.027 0 1 1 10 =0.1 < 0.027 5 4 9 10 =0.9 Calculate entropy with respect to feature RMSE threshold ≥ 0.027. E(RMSE ≥0.027) = =E(0,1) = −0 1log2 0 1−1 1log2 1 1= 0. (92) E(RMSE < 0.027) = E(5,4) = =−5 9log2 5 9−4 9log2 4 9= 0.9911. (93) Calculate entropy of feature with respect to class. E(class, RMSE) = =P(RMSE ≥0.027) E(RMSE ≥0.027) + +P(RMSE < 0.027) E(RMSE < 0.027) = = (0.1) (0) + (0.9) (0.9911) = 0.8919. (94) Calculate information gain of feature RMSE ≥ 0.027. IG (RMSE ≥0.027) = E(class)− +E(class, RMSE)=1−0.8919 = 0.1081. (95) 2) Calculate IG for Threshold ≥0.01 Using Tab. 59 Tab. 59: Sub Table: RMSE Vs. class with threshold ≥0.01 . RMSE Class RMSE Class ≥0.01 0 <0.01 1 ≥0.01 0 <0.01 1 <0.01 0 <0.01 1 <0.01 1 <0.01 0 <0.01 1 <0.01 0 Calculate probability with respect to feature RMSE threshold ≥0.01 as shown in Tab. 60. Tab. 60: Probability for each spilt: RMSE ≥0.01 and RMSE < 0.01 . Threshold 1 0 Probability ≥0.01 2 3 5 10 =0.5 <0.01 3 2 5 10 =0.5 Calculate entropy with respect to feature RMSE threshold ≥0.01 . E(RMSE ≥0.01) = E(2,3) = =−2 5log2 2 5−3 5log2 3 5= 0.971. (96) E(RMSE < 0.01) = E(3,2) = =−3 5log2 3 5−2 5log2 2 5= 0.971. (97) Calculate entropy of feature with respect to class. E(class, RMSE) = =P(RMSE ≥0.01) E(RMSE ≥0.01) + +P(RMSE < 0.01) E(RMSE < 0.01) = = (0.5) (0.971) + (0.5) (0.971) = 0.971. (98) Calculate information gain of feature RMSE ≥ 0.01 . IG (RMSE ≥0.01) = E(class)− +E(class, RMSE)=1−0.971 = 0.029. (99) 3) Calculate IG for Threshold ≥0.003 Using Tab. 61 Tab. 61: Sub Table: RMSE Vs. class with threshold ≥ 0.003. RMSE Class RMSE Class ≥ 0.003 0 ≥ 0.003 1 ≥ 0.003 0 ≥ 0.003 1 ≥ 0.003 0 ≥ 0.003 1 ≥ 0.003 1 ≥ 0.003 0 ≥ 0.003 1 ≥ 0.003 0 Calculate probability with respect to feature RMSE threshold ≥ 0.003 as shown in Tab. 62. Tab. 62: Probability for each spilt: RMSE ≥ 0.003 and RMSE < 0.003. Threshold 1 0 Probability ≥ 0.003 5 5 10 10 =1 < 0.003 0 0 0 10 =0 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 468
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER Tab. 88: GI for the feature R . Thres. 1 0 No. of P(1) P(0) P( m ) GI samples ≥ 0.99 5 3 8 5 8 3 8 8 10 0.468 < 0.99 0 2 2 0 2 2 2 2 10 0 GI (R≥0.99) = GI (5,3) = = 1 −"5 82 +3 82#= 0.468. (151) GI (R < 0.99) = GI (0,2) = = 1 −"0 22 +2 22#= 0. (152) GI (class, R) = P(R≥0.99) GI (R≥0.99) + +P(R < 0.99) GI (R < 0.99) = =8 10 ·0.468 + 2 10 ·0=0.374. (153) 4) Calculate GI for Feature RMSE Calculate GI with respect to feature RMSE as shown in Tab. 89. Tab. 89: GI for the feature RMSE . Thres. 1 0 No. of P(1) P(0) P( m ) GI samples ≥ 0.005 2 5 7 2 7 5 7 7 10 0.408 < 0.005 3 0 3 3 3 0 3 3 10 0 Calculate GI with respect to feature RMSE . GI (RMSE ≥0.005) = GI (2,5) = = 1 −"2 72 +5 72#= 0.408. (154) GI (RMSE < 0.005) = GI (3,0) = = 1 −"3 32 +0 32#= 0. (155) GI (class, RMSE) = =P(RMSE ≥0.005) GI (RMSE ≥0.005) + +P(RMSE < 0.005) GI (RMSE < 0.005) = =7 10 ·0.408 + 3 10 ·0=0.2856. (156) GI of each feature is presented in Tab. 90. From the Tab. 90, it is observed that both m and RMSE have lowest GI value i.e 0.2856. Hence, RMSE is considered as root node. Tab. 90: GI value of each feature. Feature GI Feature GI m 0.2856 c 0.374 R 0.374 RMSE 0.2856 After the identication of the best feature, the data shown in Tab. 70 is split into two sub tables based on categorical values in feature RMSE and these sub tables shown in Tab. 91 and Tab. 92. From Tab. 91, the branch < 0.005 for the root node RMSE has a leaf node with value '1'. Tab. 91: Categorical dataset with RMSE < 0.005. m C R Class <−299 < 3.3 ≥ 0.99 1 ≥ −299 < 3.3 ≥ 0.99 1 <−299 < 3.3 ≥ 0.99 1 Tab. 92: Categorical dataset with RMSE ≥ 0.005. m C R Label <−299 ≥ 3.3 < 0.99 0 <−299 < 3.3 < 0.99 0 <−299 ≥ 3.3 ≥ 0.99 0 ≥ −299 < 3.3 ≥ 0.99 1 ≥ −299 < 3.3 ≥ 0.99 1 <−299 < 3.3 ≥ 0.99 0 <−299 < 3.3 ≥ 0.99 0 3.2. Identication of Decision Node under Branch RMSE ≥0.005 1) Calculate GI for Feature m Calculate GI with respect to feature m as shown in Tab. 93 using data shown in Tab. 92. Tab. 93: GI for the feature m with respected to RMSE ≥ 0.005. Thres. 1 0 No. of P(1) P(0) P( m ) GI samples ≥ −299 2 0 2 2 2 0 2 2 7 0 <−299 0 5 5 0 5 5 5 5 7 0 Calculate GI with respect to feature m . GI (m≥ −299) = GI (2,0) = = 1 −"2 22 +0 22#= 0. (157) © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 475
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER GI (m < −299) = GI (0,5) = = 1 −"0 52 +5 52#= 0. (158) GI (class, m) = P(m≥ −299) GI (m≥ −299) + +P(m < −299) GI (m < −299) = =2 7·0 + 5 7·0=0. (159) 2) Calculate GI for Feature c Calculate GI with respect to feature c as shown in Tab. 94 using data shown in Tab. 92. Tab. 94: GI for the feature c with respected to RMSE ≥ 0.005. Thres. 1 0 No. of P(1) P(0) P( m ) GI samples ≥ 3.3 0 2 2 0 2 2 2 2 7 0 < 3.3 2 3 5 2 5 3 5 5 7 0.48 Calculate GI with respect to feature c . GI (c≥3.3) = GI (0,2) = = 1 −"0 22 +2 22#= 0. (160) GI (c < 3.3) = GI (2,3) = = 1 −"2 52 +3 52#= 0.48. (161) GI (class, c) = P(c≥3.3) GI (c≥3.3) + +P(c < 3.3) GI (c < 3.3) = =2 7·0 + 5 7·0.48 = 0.342. (162) 3) Calculate GI for Feature R Calculate GI with respect to feature c as shown in Tab. 95 using data shown in Tab. 92. Tab. 95: GI for the feature R with respected to RMSE ≥ 0.005. Thres. 1 0 No. of P(1) P(0) P( m ) GI samples ≥ 0.99 2 3 5 2 5 3 5 5 7 0.48 < 0.99 0 2 2 0 2 2 2 2 7 0 Calculate GI with respect to feature R . GI (R≥0.99) = GI (2,3) = = 1 −"2 52 +3 52#= 0.48. (163) GI (R < 0.99) = GI (0,2) = = 1 −"0 22 +2 22#= 0. (164) GI (class, R) = P(R≥0.99) GI (R≥0.99) + +P(R < 0.99) GI (R < 0.99) = =5 7·0.48 + 2 7·0=0.342. (165) GI of each feature is presented in Tab. 96. From the Tab. 96, it is observed that m has lowest GI value i.e 0. Hence, m is considered as decision node. Tab. 96: GI value of each feature with respected to RMSE ≥ 0.005. Feature GI Feature GI Feature GI m 0 c 0.342 R 0.342 After the identication of the decision node, the data shown in Tab. 92 is split into two sub tables based on categorical values in feature m and these sub tables shown in Tab. 97 and Tab. 98. From Tab. 97, the branch ≥ −299 for the decision node m has a leaf node with value '1'. Similarly, from Tab. 98, the branch <−299 for the decision node m has a leaf node with value '0'. The nal decision tree based on GI value is shown in Fig. 12. Tab. 97: Categorical dataset with m≥ −299 . C R Label < 3.3 ≥ 0.99 1 < 3.3 ≥ 0.99 1 Tab. 98: Categorical dataset with m < −299 . C R Label ≥ 3.3 < 0.99 0 < 3.3 < 0.99 0 ≥ 3.3 ≥ 0.99 0 < 3.3 ≥ 0.99 0 < 3.3 ≥ 0.99 0 4) Accuracy of Decision Tree Model In this section, the performance of the decision tree model shown in Fig. 12 is observed using data shown in Tab. 13 based on accuracy. The predicted class label for the data shown in Tab. 13 is presented in Tab. 99. © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 476
POWER ENGINEERING AND ELECTRICAL ENGINEERING VOLUME: 20 | NUMBER: 4 | 2022 | DECEMBER ZCP (1) ZCP (1) NZCP (0) m RMSE Leaf Node Leaf Node Root Node Decison Node Leaf Node RMSE<0.005 RMSE>=0.005 m>=-299 m<-299 Fig. 12: Decision tree model with Gini Index. Accuracy = =T NZCP +T ZCP T NZCP +T ZCP +F NZCP +F ZCP = =5+5 5+5+0+0 = 100 %. (166) Tab. 99: Predicted label for the dataset that prepared from noisy distorted signal using decision tree with GI. m c R RM SE Class Pred −448 4.4 0.96 0.027 0 0 −313 3.1 0.98 0.010 0 0 −331 3.3 0.99 0.009 0 0 −299 3.0 0.99 0.009 1 1 −269 2.7 1.00 0.009 1 1 −301 3.0 1.00 0.003 1 1 −293 2.9 1.00 0.004 1 1 −319 3.2 1.00 0.003 1 1 −303 3.0 0.99 0.005 0 0 −324 3.2 0.99 0.007 0 0 Formation of confusion matrix. Confusion matrix is shown in Tab. 100. Accuracy of the developed decision tree model based on GI is calculated using below equation and it is equal to 100 %. Tab. 100: Confusion Matrix for decision tree model based on GI. Confusion Matrix Acutal Label 0 1 Predicted label 0 TNZCP:5 FNZCP:0 1 FZCP:0 TZCP:5 © 2022 ADVANCES IN ELECTRICAL AND ELECTRONIC ENGINEERING 477