# Transcranial Doppler-Based Neurofeedback to Improve Hemispheric Lateralization
## 2 Materials and Methods
### Data Analysis and Statistics
#### 2.5.2 Classification  
As usual in BCI application, the ability of the subject to control the ball movement was quantified in terms of accuracy and information transfer rate (ITR). Accuracy was then calculated as the number of correct responses divided by the total number of tasks (12 per session), averaged over all subjects in a given session. On this basis and considering that a binary (left/right) symbol could be transmitted every 50 s (15 s rest + 35 s task), ITR could also be calculated [42].  
Binary Classification (Single Threshold)  
The subject response to the presented cue was classified as \"left\" or \"right\", depending on whether the change in LI was below or above a defined threshold, respectively. Each classification was then deemed true or false, respectively, depending on whether or not it matched the cue presented in that task. The change in LI was calculated as the difference between the time average calculated over the full 35 s interval of the task and the precue interval (average over the last 5 s before cue presentation). The performance of the classification was then quantified via the construction of a receiver operating characteristic  
Figure 2: Time course of the lateralization index (LI) across the different sessions in response to right (green) and left (violet) cues. The black line indicates the significant difference between the two curves at each time point. Curves represent the average, and the colored band indicates the standard deviation for the subjects (\(n\) = 14). Note that the separation between curves progressively increases in subsequent sessions.  
(ROC) curve and calculation of the area under the curve (AUC), which were then used to assess potential improvements across sessions. The accuracy of the classification with the optimal threshold was also calculated as the number of true responses divided by the total number of tasks. The optimal threshold was determined using [PERSON]'s index (J = sensitivity + specificity \(-\) 1), identifying the threshold that maximized this value, i.e., the index was computed across all possible thresholds along the ROC curve, and the threshold yielding the highest J was selected.  
The significance of the improvement in accuracy over the four sessions was assessed via a repeated-measures ANOVA. Prior to the analysis, the assumption of normality was evaluated. When this assumption was violated, the non-parametric Friedman test was used instead. In cases where statistical significance (_p_ < 0.05) was found, post hoc comparisons were performed using the Bonferroni correction method.  
Three-Class Classification (Two Threshold)  
Considering a prospective application in the field of brain-computer interface (BCI), the possibility of a three-class classification was investigated to test whether it could improve the performance of the decoder. A two-threshold classification approach was implemented, which defines three classes, i.e., left (LI < lower threshold), right (LI > upper threshold), and non-classified (lower threshold \(\leq\) LI \(\leq\) upper threshold).  
To this aim, the lower threshold was varied between the minimum and maximum observed change in LI, and the upper threshold was varied between the current lower threshold and the maximum LI change. Accuracy, ITR, and the number of unclassified responses were calculated for each given pair of thresholds. Accuracy was defined as the ratio of valid responses, (thus, excluding the non-classified types). For ITR assessment, the symbol transfer rate was calculated as the inverse of the duration of each task, including the rest period (1/(15 + 35 s) = 0.02 symbols/s = 1.2 symbols/min). In this way, the loss of time associated with unclassified responses is taken into account as it impacts the overall ITR. This analysis is only performed for the data collected in the 4 th session.