## 4 Feature Extraction
### EEG Sleep Related Features  
EEG, a record of the oscillations of brain electric potential [61], is useful for the analysis of functional changes due to the regional brain pathology of ischemic stroke [28]. The EEG patterns of wakefulness and sleep usually differ from each other markedly, as well as the patterns of different levels of sleep [62]. In general, EEG, the frequencies of which range from 0.5 to 100 Hz, is decomposed into five rhythms: delta (1 to 4 Hz), theta (4 to 7 Hz), alpha (7 to 12 Hz), beta (12 to 25 Hz) and gamma (above 25 Hz) [63]. In this paper, we are only interested in the components of EEG signals below 25 Hz; therefore, the EEG signals were band-limited to the desired 1 to 25 Hz range by using wavelet transform-based methods. In the rest of this section, we present features from two aspects: frequency domain features (including relative power, brain symmetry index) and nonlinear features (including sample entropy, detrended fluctuation analysis and Lempel-Ziv complexity). Power spectral density, which is performed using wavelet packet decomposition to calculate relative power (RP), power ratio, etc., is the most clinical feature for analyzing EEG data to characterize the changes of EEG patterns [64]. In this work, we quantify the relative power of each selected frequency band, i.e., delta, theta, alpha and beta, to distinguish the EEG of ischemic stroke patients from that of the healthy subjects. The relative power can be formally defined as follows [65]. \[RP_{(F_{i},C_{x})}=\frac{\sum\textit{selected frequency band energy}}{\sum \textit{Total EEG range energy}}. \tag{3}\]  
where \(F_{i}\) represents the four different frequency bands of the EEG, i.e., i \(\in\{D,T,A,B\}\); \(C_{x}\) is the channel of the EEG, and in this study we used two different channels ( \(C_{3}\) and \(C_{4}\)), i.e., \(x\in\{3,4\}\). Furthermore, in order to obtain more fine-grained features, we divided all these frequency bands according to different sleep cycles and sleep stages and calculate the relative power as follows. \[RP_{(F_{i},g_{j},C_{x})}=\frac{E_{(F_{i},g_{j},C_{x})}}{E_{(F_{i},C_{x})}}. \tag{4}\]  
\[RP_{(F_{i},g_{j},g_{k},C_{x})}=\frac{E_{(F_{i},g_{j},g_{k},C_{x})}}{E_{(F_{i}, g_{k},C_{x})}}. \tag{5}\]  
where s\({}_{j}\) is the \(j\)-th sleep stage and \(j\in\{0,1,2,3,5\}\); cyck is the \(k\)-th sleep cycle and \(k\in\{1,2,3,4,5\}\). \(E_{(F_{i},g_{j},C_{x})}\) is the energy of frequency band \(F_{i}\) on the EEG channel \(C_{x}\) during the j-th sleep stage; \(E_{(F_{i},C_{x})}\) is the total energy of frequency band \(F_{i}\) on the EEG channel \(C_{x}\);\(E_{(F_{i},s_{j},c\
u_{k_{i}},C_{x})}\) is the energy of frequency band \(F_{i}\) on the EEG channel \(C_{x}\) during the \(j\)-th sleep stage of the \(k\)-th sleep cycle; \(E_{(F_{i},c\
u_{k_{i}},C_{x})}\) is the total energy of frequency band \(F_{i}\) on the EEG channel \(C_{x}\) during the \(k\)-th sleep cycle. Subsequently, the power ratio of delta/alpha (DAR), theta/beta (TBR), the (delta + theta)/(alpha + beta) power ratio (DTABR), and the (theta \(-\) delta)/(alpha \(-\) beta) power ratio (TDABR) were also calculated, as the usefulness of these features had been proven by existing studies. For example, [PERSON] et al. [40] proved that the DAR demonstrated the strongest association with cerebral ischemia. [PERSON] et al. [44] pointed out that DTABR was obviously linked to DAR, which may sometimes be informative to ischemia monitoring. In addition, higher TBR was found in the side of the infarct [44], and power ratios such as TDABR may be useful for detecting early and subtle ischemic EEG changes [27]. All these features are also divided according to different sleep cycles and sleep stages in order to detect the changes consequent to the stroke. These features include: \(DAR_{(F_{i},s_{j},c\
u_{k_{i}},C_{x})}\), \(TBR_{(F_{i},s_{j},c\
u_{k_{i}},C_{x})}\), \(DTABR_{(F_{i},s_{j},c\
u_{k_{i}},C_{x})}\) and \(TDABR_{(F_{i},s_{j},c\
u_{k_{i}},C_{x})}\).