## 2 Materials and Methods  
The files of 370 delinquent patients diagnosed with SSD according to ICD-9 (295.x) [13] and ICD-10 (F20-29.x) [14], who were admitted to the Center for Inpatient Forensic Therapies of the University Hospital of Psychiatry Zurich, were assessed retrospectively. This comprehensive dataset included items from the following domains: social-demographic data, childhood/youth experiences, psychiatric history, past criminal history, social/sexual functioning, details on the offense leading to forensic hospitalization, prison data, and particularities of the current hospitalization and psychopathological symptoms. The latter was defined by an adapted positive and negative symptom scale (PANSS), whereby symptoms were divided into the usual 30 sub-categories and rated on a three-tier scale instead of a seven-tier one (completely absent, discretely present, or substantially present). The dataset has already been used in other studies as part of a larger, ongoing project with the goal of providing insights into the complex field of SSD and offending. Although the same database provides the basis for several analyses covering a wide range of objectives in this research area, and although there are a few overlapping parameters, it still contains a substantial number of unique variables, thus resulting in different theoretical and practical conclusions and implications. An overview of the basic characteristics of the population is provided in Table 1.  
Parts of the following section were published in advance in a study by [PERSON] et al. [15] and is here partly replicated and extended by the methodology of the current research question. For further information regarding data collection and processing, please refer to previous publications [15; 16; 17]. Due to the explorative nature of this study, supervised machine learning (ML) seemed to be the optimal approach to identify the most relevant predictive factors out of numerous parameters and to determine the model providing the best predictive power. An overview of the statistical steps can be seen in Figure 1 and is further described below. All the steps were performed using R version 3.6.3. (R Project, Vienna, Austria) and the MLR package v2.171 ([PERSON], Munich, Germany). CI calculations of the balanced accuracy were conducted using MATLAB R2019a (MATLAB and Statistics Toolbox Release 2012, The MathWorks, Inc., Natick, Massachusetts, United States) with the add-on \"computing the posterior balanced accuracy\" v1.0. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Characteristics**} & **Total** & **No Aggression** & **Aggression** \\  & _m/N (\%)_ & _n/N (\%)_ & _n/N (\%)_ \\ \hline Male sex & 327/352 (92.9) & 219/239 (91.6) & 108/113 (95.6) \\ \hline Age at admission (mean, SD) & 33.98 (10.206) & 34.62 (10.014) & 32.64 (10.519) \\ \hline Native Country Switzerland & 156/352 (44.3) & 106/239 (44.4) & 50/113 (44.2) \\ \hline Single (at offense) & 285/346 (82.4) & 188/233 (80.7) & 97/113 (85.8) \\ \hline \hline \end{tabular} \({}^{\dagger}\) SD = standard deviation; N = total study population; \(n\) = subgroup with characteristic.  
\end{table} 
Table 1: Sociodemographic characteristics \({}^{\ddagger}\). All raw data were first processed for machine learning (see Figure 1, Step 1): Several categorical variables were converted to binary code, while continuous and ordinal variables were not adjusted. Due to the retrospective nature of the study and a large number of variables included, there were missing values among variables. This especially applied to  
Figure 1: Overview of statistical procedures: (**Step 1**)—Data Preparation: Multiple categorical variables were converted to binary code. Continuous and ordinal variables were not manipulated. Outcome variable violent behavior/no violent behavior and 507 predictor variables were defined. (**Step 2**)—Data splitting: Split into 70% training dataset and 30% validation dataset.