# Rule-Based DSL for Continuous Features and ML Models Selection in Multiple Sclerosis Research
## 3 Dsl Design
### Meta Model Design
```
1 RuleModel::=Element*
2 Model::=\"model\"ID\"task\"Task\"('ModelElement*');
3 Task::=\"predict\"l\"classification\"|'regression'
4 ModelElement::=MLModel|Metric|FeatureSelection|RuleSet|Start|Show Start::=\"start\"FOR\"with'ID
5 Element::=Load|Model|
6 Load::=\"load\"ID\"from\"STRING
7 MLModel::=\"allocId\"ID\"type\"MLModelType('Parameter*')>? 8 MLModelType::=\"RandomForest\"l\"DecisionTree'|'SNV'|'AutoML'Parameter::=\"parameter\"name\"|\"='STRING'value'|\"='ValueList'Valuelist'='['Value(','Value)*']'|Value
9 Metric::=\"metric\"Metric\"MentalEmatic\"(','MetricName)*
10 MetricName::=\"rmse'|'name'|'|'mse'|'|'r2_score'|...|'all'
11 PUR::=ID\"(','ID\")
12P



Metrics are calculated to evaluate model performance, mapping to functions in sklearn.metrics. Our system logs all parameters and training results in MLflow [26], which can be retrieved when checking defined rules and generating visualization diagrams. 5. RuleSets and Rules are evaluated, potentially altering the model or feature selection based on the defined rules. This is implemented as conditional statements in Python, evaluating metrics and executing corresponding actions. 6. The Start command initiates the training process of MLModels, including training and fitting, and it logs the corresponding results in MLflow. 7. Finally, the Show command displays the results of the process. We use Matplotlib to visualize the logged results. The proposed DSL provides a structured framework for defining and executing ML workflows in MS research. It offers clear semantics for model definition, feature selection, and rule-based execution. The DSL supports both automated and manual methods, catering to users with varying expertise levels. This design enables progressive refinement of models and features, allowing domain experts to effectively utilize ML techniques without extensive programming knowledge. The rule-based system facilitates adaptive model development, promoting an iterative approach to ML in MS research. Figure 11 serves as a structural framework for our DSL design. ### Task-Specific Model Instantiation

In this section, we will give example models based on our current data requirement analysis in the three ways we mentioned. Our DigiPhenoMS [27] project is a collaborative endeavor between the MS Center at the University Hospital Carl Gustav Carus Dresden and the Digital Health research group. This project aims to investigate the heterogeneous progression of MS by leveraging the extensive data collected throughout a patient's clinical journey. MS is a complex neurological disorder that is characterized by a highly variable disease course, which differs significantly from one individual to another. Prior to the formal diagnosis of MS, patients undergo a comprehensive anamnestic assessment and a series of necessary examinations, generating a substantial amount of data. Upon confirmation of the diagnosis, further data are accumulated during subsequent treatment sessions and routine check-up appointments. Over the span of a patient's life, a unique data trail is formed, encompassing the various stages of the clinical pathway within the healthcare system. The data collected includes MRI, motility and cognitive assessments, and neuropsychological evaluations of 1701 patients at different phases of the disease. These diverse datasets offer valuable insights that can aid domain experts in determining the relevance of specific factors and developing predictive models. Regression algorithms are employed in this research because they are well-suited for predicting continuous variables such as disease progression scores or severity measures, and they can help uncover the relationships between various features and MS outcomes, enabling a better understanding of the factors influencing the disease. We also support classification tasks; however, in this context, we focus on regression due to the specific requirements of our data. Additionally, the extensibility of DSLs allows for the easy addition of other tasks.