*4.3. Dimensionality Reduction*

This phase aims to reduce the dimensions from extracted features (cA3, cD3, cD2, cD1). First, we used the statistical method to get the statistical variables (mean, std, min, 25%, 50%, 75%, max) from each daily coefficient (cA3\_mean, cA3\_std, cA3\_min, cA3\_25%, cA3\_50%, cA3\_75%, cA3\_max, cD3\_mean, etc.). There were 28 features extracted from the approximation and detailed coefficients. Second, we calculated Pearson's correlation coefficient, which measures the correlation of each two features. The correlation coefficient values are between −1 and 1, the value close to 1 represents a high positive correlation while the value close to −1 represents a high negative correlation [26]. High correlation features can be replaced by other features with similar characteristics. The correlation coefficient value is calculated from Equation (3), as follows:

$$r\_{XY} = \frac{\sum\_{i=1}^{n} \left(X\_i - \overline{X}\right) \left(Y\_i - \overline{Y}\right)}{\sqrt{\sum\_{i=1}^{n} \left(X\_i - \overline{X}\right)^2} \sqrt{\sum\_{i=1}^{n} \left(Y\_i - \overline{Y}\right)^2}} \tag{3}$$

where *n* is the number of samples, *Xi*, *Yi* is the value of data, *X* is the mean value of *X*, and *Y* is the mean value of *Y*.

The correlation heatmap that represents the coefficient matrix is shown in Figure 6. According to the correlation heatmap, coefficients close to 1 or −1 imply redundant features. For the purpose of reducing the dimension, we removed one of the features in which

the absolute values of correlation coefficients are bigger than 0.95. Figure 7 shows the correlation heatmap after eliminating the high correlation features.

**Figure 6.** Correlation heatmap representing the coefficient matrix of 28 features.

**Figure 7.** The selected features correlation heatmap after eliminating 12 highly correlated features.

PCA is one of the most appealing techniques that is widely used for dimensionality reduction of large data sets [27]. Given the original high dimensional data, PCA can map the data into *k* dimensions (*k* < original dimension) with principal components that are not related to each other and still preserve the original information. The data are normalized by *z* in the PCA process to obtain the feature vector composed of principal components by finding the covariance, eigenvector, and eigenvalue. In our study, we applied the PCA method to reduce the dimensionality to 3 components and still preserve 99 percent variability. Thus input dimension is reduced to 28 from 8640 using DWT combined with the statistical method and to 16 after correlation analysis. Finally, we have 3 component features applying PCA transform.
