# An Anomaly Detection Ensemble for Protection Systems in Distribution Networks
## 2 Data Dimension Reduction Model Based on KPCI  
To facilitate subsequent analysis and application, the original input data must go through the corresponding preprocessing to provide effective, smaller-scale, and relatively pure training and testing data. The core idea is this: to map the original data into a higher-dimensional space for linear operation, so as to reduce the computational load and improve the operational efficiency [33]. Among them, data dimension reduction is a key step in data preprocessing. Considering the nonlinear characteristics of data, we adopt a method based on KPCI to seek the optimal projection of data and to solve relatively important features, aiming to reduce the computational burden, speed up response time, and achieve visualization of the results [34]. Principal components investigation (PCI) is one of the most fundamental and important methods for data dimension reduction. PCI can examine the correlation among multiple original variables and then use a few principal components to further reflect the internal structure relationship of all the original variables [35]. PCI mainly achieves a data dimension reduction through orthogonal basis transformation. We assume that the input data set is:  
\[\left\{a_{n}\in R^{K}\mid n=1,\ldots,m\right\} \tag{1}\]  
and diagonalize the covariance matrix after the evaluation:  
\[C=\left\langle(a_{j}-\left\langle a_{n}\right\rangle),(a_{j}-\left\langle a_{n }\right\rangle)^{\mathrm{T}}\right\rangle=\frac{1}{M}\sum_{m=1}^{M}a_{m}a_{m}^ {\mathrm{T}} \tag{2}\]  
This calculates the covariance of the centered data \((a_{j}-\left\langle a_{n}\right\rangle)\). From Equation (2), it can be concluded that the corresponding parameters in the eigenvector basis are the principal components of this data set. To reduce the number of principal components under consideration and decrease calculation complexity, PCI can be used to solve linear data dimension reduction problems:  
\[A\cdot u=\lambda\cdot u\ \ ||u||_{2}=1 \tag{3}\]  
In the equation, \(u\) represents the unit vector, and \(A=\frac{1}{k-1}\left(a_{j}-\bar{u}\right)\left(b_{j}-\bar{b}\right)\) represents the sample data matrix. \(b\) is a different input data set with the same definition as \(a\). PCI mainly finds a solution for the eigenvalues \(\lambda\) and eigenvectors \(u\) of the corresponding  
Figure 1: Illustration of the KPCI-IF ensemble. sample data matrix \(A\). The direction of the eigenvectors from the solved matrix \(A\) is the direction of data point projection during the PCI solving process. However, when faced with some datasets that cannot be linearly separated, it is necessary to implement a non-linear data dimensionality reduction. KPCI mainly uses a mapping function to map data from the input space to a feature space [36]. This mapping ensures that the data become easier to separate, thereby enhancing the dimensionality reduction effect of PCI. The top \(k\) eigenvectors (with the largest eigenvalues) corresponding to the \(k\) largest variances are retained to reconstruct an approximation of the data in the lower dimension space. An operational example is shown in the following Figure 2.  
For this purpose, nonlinear mapping is first used to map all samples in the input space to a high-dimensional or even infinite-dimensional feature space (FS) S, making them linearly separable. Then, PCI dimensionality reduction is performed in this high-dimensional space. The basic idea of the kernel technique is to map data that are inseparable in a low-dimensional space to a high-dimensional space. Data that are linearly inseparable in a low-dimensional space will have a higher probability of being linearly separable after being mapped to a high-dimensional space. For example, the difficulty of separating data linearly in a one-dimensional space is greater than in a two-dimensional space, and it is harder to separate data linearly in a two-dimensional space than in a three-dimensional space.