# Rule-Based DSL for Continuous Features and ML Models Selection in Multiple Sclerosis Research
## 3 Dsl Design
### Meta Model Design
For process speed time, the pipeline starts with MinMaxScaler for feature scaling, followed by SelectFwe for feature selection based on significance. A principal component analysis (PCA) with a randomizedSVD solver is applied to reduce dimensionality while retaining essential information. MaxAbsScaler scales features to the range of \([-1,1]\) using the absolute maximum value. These preprocessing steps are logged for future use. The regression algorithm selected is KNeighborsRegressor, a non-parametric method that uses the k nearest neighbors to predict the target variable. The defined metric, the r2_score, is 0.8. For walk speed data, the pipeline incorporates decision trees, stacking, normalization, and kernel approximation techniques. The r2_score metric for this pipeline is 0.86. Our system automatically logs all the steps of the best pipeline identified by TPOT, including the pipeline's results and all metric values defined within the DSL. In examining feature importance, we observed minimal differences across varying generations and population sizes. However, we discovered distinct T2-related feature importance for process speed and walk speed. As depicted in Figures 2a,b and 4a,b, these images illustrate the permutation importance of various features within a ML model, as defined in Line 13. Permutation importance is a method that is employed to assess the relative significance of each feature in the model's predictions. Features with higher permutation importance values are more influential in the model's decision-making process. For process speed time, the features with the highest permutation importance are _t2 overbv_, _nt2 lescn_, and _nt2 lesgt_. These features significantly impact the model's predictions. * _t2 overbv_ measures the ratio of T2 lesion volume to brain volume, offering an index of overall lesion burden. * _nt2 lescn_ counts the total number of hyperintense lesions on the T2-weighted MRI. * _nt2 lesgt_ counts the number of T2 lesions exceeding a certain size or volume. For walk speed, the features with the highest permutation importance are _t2 overbv_, _t2 lesvol_, and _t2 volprv_. * _t2 lesvol_ measures the total volume of hyperintense lesions on the T2-weighted MRI, reflecting the overall burden of MS lesions. * _t2 volprv_ measures the volume of T2 lesions near the ventricles. These findings highlight the importance of T2-related features in predicting both process speed and walk speed, underscoring the need for careful consideration of these features in model development and interpretation. Figure 1: Model performance with different generations and population sizes with process speed time. (**a**) Model performance with 30 generations and a population size of 300 for T2-related features and process speed time; (**b**) Model performance with 10 generations and a population size of 100 for T2-related features and process speed time. Figure 4: Feature importance with different generations and population sizes with walk speed. (**a**) Feature importance with 30 generations and a population of 300 for T2-related features and walk speed. (**b**) Feature importance with 10 generations and a population size of 100 for T2-related features and walk speed. Figure 3: Model performance with different generations and population sizes with walk speed. (**a**) Model performance with 30 generations and a population size of 300 for T2-related features and walk speed. (**b**) Model performance with 10 generations and a population size of 100 for T2-related features and walk speed. Figure 2: Feature importance with different generations and population sizes with process speed time. (**a**) Feature importance with 30 generations and a population size of 300 T2-related features and process speed time. (**b**) Feature importance with 10 generations and a population size of 100 for T2-related features and process speed time. #### 4.1.2 Further Filtering of ML Models and Features

In the following section, we demonstrate how a medical expert would enhance machine learning qualities using the new DSL.