# Rule-Based DSL for Continuous Features and ML Models Selection in Multiple Sclerosis Research
## 3 Dsl Design
### Meta Model Design
This allows researchers to focus on higher-level tasks such as problem formulations and results interpretation. The second model, shown in Listing 3, demonstrates a manual approach to model and feature selection. In this model, three ML algorithms, random forests, decision trees, and SVMs are defined with their respective hyperparameters. The select _pst_ statement specifies a set of initial features based on certain conditions. Additionally, a new set of features, denoted as _pst_filter_, is defined by utilizing a distinct dataset and specific conditions (e.g., t2 lesvol > 3.0) for enhanced screening values. The ruleSet _selectionRules_ defines a set of rules for model selection based on the evaluation metrics. If the r2_score of the _SVM_ model is less than 0.85 and the mean squared error is greater than 0.2, the random forest model is selected. If the r2_score of the random forest model is greater than 0.8, which is a good model, then we further train it with the _pst_filter_ features to see if it could be better. If it does not meet our expectations, we instead use a decision tree. It is worth noting that the _ruleSet_ could also be applied to the other models; however, for the sake of brevity, only one illustrative example is presented here. The output displays the _models_, which presents a diagram comparing the results of two model runs, and the _features_, which provide a comparison of feature importance. This model showcases the manual approach to feature and model selection, where domain knowledge and expert intuition play a crucial role. This approach is suitable for further comparison screening and the comparison of customized models and features by obtaining initial results from AutoML and incorporating additional rules and conditions to fine-tune the models and features. By defining specific conditions and rules, researchers and practitioners can meticulously refine the feature selection process and systematically explore various model combinations to achieve optimal performance. The third model, shown in Listing 4, demonstrates a customizable approach to model selection for a classification task. In this model, a decision tree algorithm is defined with specific hyperparameters, such as max_depth, min_samples_split, min_samples_leaf, and max_features. The selected _pst_ statement specifies the most related features after verification of the last two models. Initiating the decision tree with the _pst_ statement initiates the model training process using the specified features. This model is suitable for re-running the chosen models from coarse screening and attempting to refine them with finer granularity in terms of specific model architectures and features. ```
1 loadmrt_pst_17_20 from\"#SData.db\"
2 loadmrt_pst_from\"Data.csv\"
3 modelmrt_modelmrt_pst_17_20_122 evol\"2.0,
4 mrt_pst_17_20_122 evol\"2.0,
5 mrt_pst_score>-0.2,
6 wheremrt_pst_17_20_12>mrt_pst.ID
7 metricmse_r2_score,mse_mse_mse
8 startautMLgeneration>30 population_size>30 withpst
91//0r
10 startautMLgeneration>100 population_size>10 withpst
11 showmodels,features
11}
```
Listing 2: Model example for multiple datasets in AutoML. Our DSL significantly enhances explainability and facilitates collaboration in MS research through its intuitive, rule-based syntax. For example, a rule like _mrt_pst_17_20_12 esvol_>2.0 is easily interpretable by clinicians, as it uses familiar clinical features and clear thresholds. In terms of collaboration, the DSL serves as a bridge between technical and clinical experts. It allows neurologists to express their domain knowledge in a format that data scientists can directly incorporate into ML pipelines. This shared language reduces miscommunication and accelerates the development of clinically relevant ML models for MS research. The provided models showcase different approaches to model selection and feature engineering, each with its own strengths and applications.