# Multi-Class Sleep Stage Analysis and Adaptive Pattern Recognition
## 3 Results  
Figure 3a presents the results for a two hour long sleep record selected from the observation of an entire night in the sleep laboratory. The target sleep stages (input classes) associated with 30 s long EEG data windows diagnosed by the experienced neurologist are presented in Figure 3c. The adaptive system was constructed as a two layer neural network with the sigmoidal and softmax transfer functions. Figure 3d presents the evaluated probabilities of the individual classes. The estimated sleep stages pointing to sleep stages with the highest probability are presented in Figure 3e. The classification results obtained by the neural network system were compared with those achieved with the \(k\)-nearest neighbour and decision tree methods (Table 4). The process of class \begin{table}
\begin{tabular}{l c c c c} \hline \hline \multicolumn{1}{c}{**Characteristics**} & \multicolumn{1}{c}{**Definition**} & \multicolumn{1}{c}{**Comment**} \\ \hline \(PPV\) & \(TP(k)+FP(k)\) & \(TP(k)+FP(k)\) & Probability of correct classification of class \(k\) related to the number of instants classified to class \(k\) \\ \hline \(TPR\) & & & \\ Sensitivity of class \(k\) & \(TP(k)\) & \(TP(k)+FN(k)\) & Probability of correct classification of class \(k\) related to the number of instants belonging to class \(k\) \\ \hline \(TNR\) & \(TNK+TPR\) & Probability of incorrect classification of class \(k\) related to the number of instants not classified to class \(k\) \\ \hline \(TPR\) & & & \\ False positive rate & \(TPK+TPR\) & Probability of positive classification for the negative set (1-specificity) & \\ \hline \(ACCU\) & \(\frac{\sum_{k}TP(k)}{\sum_{k}(TP(k)+FP(k))}\) & Probability of global correct classification \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Common performance metrics of the confusion matrix for the multi-class classification. \begin{table}
\begin{tabular}{l c c c} \hline \hline \multicolumn{1}{c}{**Characteristics**} & \multicolumn{1}{c}{**Definition**} & \multicolumn{1}{c}{**Comment**} \\ \hline \(PPV\) & \(TP(k)\) & \(TP(k)+FP(k)\) & Probability of correct classification of class \(k\) related to the number of instants classified to class \(k\) \\ \hline \(TPR\) & & & \\ Sensitivity of class \(k\) & \(TP(k)\) & \(TP(k)+FN(k)\) & Probability of correct classification of class \(k\) related to the number of instants belonging to class \(k\) \\ \hline \(TNR\) & \(TNK+TPR\) & Probability of incorrect classification of class \(k\) related to the number of instants not classified to class \(k\) \\ \hline \(TPR\) & & & \\ False positive rate & \(TPK+TPR\) & Probability of positive classification for the negative set (1-specificity) & \\ \hline \(ACCU\) & \(\frac{\sum_{k}TP(k)}{\sum_{k}(TP(k)+FP(k))}\) & Probability of global correct classification \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The confusion matrix for the evaluation of a model classifying pattern vectors belonging to true (target) classes and estimating their (predicted) classes for the multi-class classification into \(S\) categories. selection and evaluation of class boundaries of the sleep stages is illustrated in Figure 4 for the two features and their classification. The classification accuracies and cross-validation errors evaluated by the leave-one-out method for a sample two-hour long EEG record are presented in Table 4. Input features include relative power in 4 frequency bands (1-4, 4-8, 8-12, 12-20 Hz). For the given set of features, the neural network model provide classification results with higher accuracy and lower cross-validation error than did the k-nearest neighbour and decision tree methods. The methodology of sleep stages processing verified for short records was then applied for an extensive set of 184 individuals specified in Table 1. The results of its analysis with statistical distribution of sleep stages related to age is presented in Figure 5. Linear approximation of these values together with estimation of 95% confidence bounds were evaluated.