## 2 Methodologies
### Feature Extraction
#### 2.2.4 Energy Features  
Energy features, namely, variance and mean absolute values of wavelet coefficient sets, were also extracted for classification, as a complement of the complexity features. Feature Selection Based on Auto-Weighted Feature Selection via Global Redundancy Minimization (AGRM) Algorithm  
The extracted features in above procedures contain huge amounts of redundant information. For pattern recognition problems with small dataset size, epileptic seizure detection for example, such redundancy may greatly reduce learning efficiency and model performance. In this section, we introduce the principle of a latest redundancy removal algorithm, namely, AGRM, which has been proven quite effective in the image processing field. Traditional redundancy removal algorithms only focus on minimizing feature redundancy but ignore feature separability. For AGRM, feature redundancy and separability are both taken into consideration at the same time. We denote the feature matrix as \(F\in\mathbb{R}^{n\times d}\), where rows of \(F\) correspond to observations and columns to features. Each column \(f_{i}\) (\(i\in\{1,2,...,d\}\)) has been normalized by Z-score. The objective function of AGRM takes the following form,\[ \begin{split}&\underset{z,\lambda}{min}\ \lambda^{2}z^{T}Az-\lambda z^{T}s\\ & s.t.\ z^{T}\mathbf{1}=1,\,z\geq 0,\end{split}  \tag{8}\]  
where \(\mathbf{1}=(1,1,...,1)^{T}\) and \(z\in\mathbb{R}^{d\times 1}\) refer to the final feature score obtained by AGRM so that the top ranking features are selected to represent the original signals. Matrix \(A\in\mathbb{R}^{d\times d}\) in objective function (8) denotes pair-wise feature redundancy, where \(A_{i,j}=\left(\frac{f_{i}^{T}f_{j}}{\|f_{i}\|\|f_{j}\|}\right)^{2}\). Besides, \(s\in\mathbb{R}^{d\times 1}\) refers to another input feature score to be jointly taken into account. In this work, \(s\) denotes the Fisher score of original features. We denote \(\mu_{i}\) as the mean value of the \(i\)th feature of all EEG segments. Similarly, \(\mu_{i}^{k}\) is the mean value of the \(i\)th feature of segments in class \(k\). Given a feature \(f_{i}\) in \(c\) known classes, with segment ID \(j\) in a specific class, Fisher score \(s\) can be computed as Equation (9). \[s(i)=\frac{S_{B}}{S_{\text{W}}}=\frac{\sum_{k=1}^{c}\frac{n_{k}}{n}(\mu_{i}^{k}- \mu_{i})^{2}}{\frac{1}{n}\sum_{k=1}^{c}\sum_{j=1}^{c}(f_{ij}-\mu_{i}^{k})^{2}}. \tag{9}\]  
In Equation (9), \(S_{B}\) and \(S_{\text{W}}\) denote feature distance between and within class respectively. Therefore, a higher Fisher score contributes to higher feature separability. The first term \(z^{T}Az\) in (8) is the global redundancy of extracted features. The second term \(z^{T}s\) in (8) denotes feature separability. And \(\lambda\) acts as a trade-off parameter between the two terms, which comes to convergence automatically in optimization procedure. Obviously, by minimizing the objective function (8), feature redundancy is minimized while feature separability is maximized. The optimization problem of AGRM has been proven convex [19], so a global optimum can be achieved. The optimal \(z\) and \(\lambda\) can be obtained by general augmented Lagrangian multiplier (ALM) method given by [19]. Here, we give a brief description of optimization procedure:  
1. Given input \(A\) and \(s\), initialize \(z=\frac{1}{d}\mathbf{1}\), \(\rho>1\), \(\mu\) and \(\beta\). 2. Unless \(\lambda\) converges, repeat step (3). 3. Compute \(\lambda=\frac{z^{T}s}{2^{T}s}\) and update \(z\) by repeating step (4) until \(z\) converges. 4. Update \(v=z+\frac{s+\beta}{\mu}-\lambda Az\). Compute \(z\) by step (5). Update \(\beta=\beta+\mu(z-v)\). Update \(\mu=\rho\mu\). 5. Compute \(m=v-\frac{1}{\mu}(\beta+\lambda A^{T}v)\). Compute \(g=m-\frac{\mathbf{1}\mathbf{1}^{T}}{d}m+\frac{1}{d}\mathbf{1}\). Use [PERSON]'s method to obtain root \(\tilde{\eta}^{*}\) of equation \(\tilde{\eta}^{*}=\frac{1}{d}\sum_{t=1}^{d}\left(\tilde{\eta}^{*}-g(t)\right)_{+}\), where \((x)_{+}=max(x,0)\).