## 2 Methodology
### SVM-ML Model Configuration  
Figure 2 shows the configuration of the SVM-ML model, including optimization of the SVM RBF kernel function and k-fold cross-validation (CV) strategy. The normalized EEG features (i.e., \(\mathrm{RSP_{mean}}\) and \(\mathrm{RSP_{max}}\)) during stimulation with cotton fabric were adopted as the baseline inputs for model establishment. This is because cotton is the most widely used fabric that is in intimate contact with skin in daily living and provides minimum stimulation intensity with a comfortable feeling compared to other fabrics [51]. In addition, compared to nylon and wool, the textile physical properties of cotton fabric as quantitatively measured by the fabric touch tester (FTT) [52] were neutral with equivalent distances in the aspects of smoothness, thickness, etc. [28]. Therefore, the EEG RSP features evoked by the cotton fabric were used as the baseline inputs to configure the SVM-ML model. The RBF kernel function of the SVM-ML model was determined by optimizing the classification boundaries that achieved the best accuracy on the RSP features related to cotton stimulation. For an RBF kernel, two hyperparameters, namely the kernel scaling parameter \(\gamma\) and regularization parameter C [53], are optimized in the SVM-ML model development to classify the different upper-limb groups. The search for optimal (\(\gamma\), C) was conducted by a \"grid search\" approach [54]. The candidate values of (\(\gamma\), C) were first defined as exponentially increasing sequences (\(\gamma\) = \(2^{-15}\), \(2^{-13}\),..., \(2^{9}\); \(C\) = \(2^{-5}\), \(2^{-3}\),..., \(2^{15}\)), which were the ranges adopted by most EEG-based SVM-ML studies to identify the optimal (\(\gamma\), C) values [42; 55; 56]. Following this, different pairs of \(\gamma\) and C (\(13\times 11=143\) pairs) values were generated, and each pair was used to construct the RBF kernel of the SVM. The classification accuracies with the different hyperparameter pairs were evaluated by three-fold CV according to the greatest common divisor of the number of stroke patients (i.e., \(n=12\)) and unimpaired controls (i.e., \(n=15\)); this is a common pilot estimation approach used in previous studies [57]. The value pair that achieved the best classification accuracy was then adopted as the optimal hyperparameters for model configuration. The above SVM algorithm was implemented using the Scikit-learn toolbox, an open-source ML toolbox in Python [58]. The grid search results of \(\gamma\) and C are displayed in Figure 3, where Figure 3a-e present the accuracies of different (\(\gamma\), C) pairs for distinguishing the UD, SA, and SU groups with the RSPmean and RSPmax of the 62-channel EEG in the delta, theta, alpha, beta, and gamma bands, respectively, as input features. The coordinates and values of the highest accuracy for each frequency band are indicated by the red dots in Figure 3a-e. Among all the accuracies, the model with the highest accuracy of 67.4% (\(\gamma=2^{3}\), C = 29) was achieved in the gamma band. As the sensorimotor cortex is the main response area for sensory stimulations [59], the classification performance achieved by including only the EEG channels covering the sensorimotor cortex was evaluated in the SVM-ML model configuration. The RSPmean and RSPmax of the corresponding 21-channel EEG (i.e., FC1-FC6, FCZ, C1-C6, CZ, CP1-CP6, CPZ), which cover the sensorimotor area [60], were used as the inputs to the model. Figure 4 shows the accuracies with the RSP features for the 21-channel EEG, and the highest accuracy of 76.8% (\(\gamma=2^{1}\), C = 23) was obtained for the gamma band as well. The accuracies of the SVM-ML model for classifying the UD, SA, and SU groups with the RBF kernel hyperparameter pairs in the different bands are summarized in Table 2. Compared to other frequency bands, the gamma band has the best average accuracy performance for both channel set selections. The average and peak accuracies of the gamma band of the 21-channel EEG were better than those of the 62-channel EEG.