## 3 Results
### Feature Selection and Model Development
#### 3.3.1 Feature Selection Results  
Our feature selection began with 210 handwriting dynamics features. Correlation screening against the MoCA scores identified 39 features (18.6%) with \(p<0.05\), and between-group tests flagged 31 features (14.8%) differing by cognitive status. After removing 86 highly correlated features (\(|r|>0.8\)), 29 features remained for further modeling. The bootstrap stability analysis using 100 resampled datasets revealed varying feature stability: 10 features (34.5%) showed high stability (\(\geq\)70% selection frequency), 14 features (48.3%) medium stability (50-70%), and 5 features (17.2%) low stability (<50%). The most stable features included the traditional cognitive measures (the MMSE, years in education) and the SDMT performance metrics (Figure 5). The disease-specific analysis identified seven features that were significant in both MS and NMOSD patients, six features with MS-specific significance, and seven features with NMOSD-specific significance (Figure 6), indicating both shared and disease-specific cognitive-motor integration patterns. The ensemble of five methods--information gain, recursive feature elimination (RFE), Lasso, random forest importance, and SVM-RFE--returned six features that were unanimously selected: years in education, E-SDMT score, P-SDMT score, MMSE score, median response interval, and clock-drawing air length. Figure 4: Mean pen pressure across eight drawing tasks: comparison between cognitively normal (CN) and cognitively impaired (CI) groups. Figure 5: The bootstrap stability analysis of selected features. The graph shows the stability scores (the percentage of bootstrap iterations in which features maintained statistical significance) for top features. The traditional cognitive measures (MMSE, years in education) and SDMT metrics demonstrated the highest stability, while the handwriting dynamics features showed moderate to high stability. Figure 6: Disease-specific correlation patterns between selected features and MoCA scores in MS and NMOSD patients. Color intensity represents correlation strength, with blue indicating negative correlations and red indicating positive correlations. Several features show distinct correlation patterns between disease groups, suggesting disease-specific cognitive–motor integration mechanisms. To determine the optimal feature subset size, we conducted a progressive feature addition analysis, sequentially incorporating features based on their consensus importance ranking and evaluating the performance using random forest classifiers with 5-fold cross-validation. We examined multiple performance metrics, including the AUC, F1-score, accuracy, and balanced accuracy, to ensure a comprehensive assessment of the classification performance. As shown in Figure 7, the classification performance across all metrics improved substantially at up to eight features, after which point the gains diminished or the performance declined. The area under the ROC curve (AUC) peaked at 0.885 with eight features, while the F1-score reached its maximum value of approximately 0.89 in the same region. Although accuracy showed its highest value (0.871) with the first feature alone, it stabilized at around 0.855 with six to nine features, providing a more balanced performance when combined with other metrics. Based on this multi-metric analysis, we identified an optimal subset of eight features: years in education, E-SDMT score, P-SDMT score, MMSE score, median response interval in E-SDMT, air length during clock-drawing, the coefficient of variation in the velocity during tree-drawing, and and the air-to-paper-length ratio in the trail-making task. Multiple metrics converged at this feature count, supporting the robustness of this selection. The final feature set included measures from four different drawing tasks, highlighting the unique contribution of different visuo-motor tasks to cognitive assessment (Table 3).