## Materials and Methods
### Hard-Margin SVM  
SVMs are originally presented as binary classifiers, that assign each data instance \(\mathbf{x}\in\mathbb{R}^{d}\) to one of two classes described by a class label \(y\in\{-1,1\}\) based on the decision boundary that maximises the margin \(2/||w||_{2}\) between the two classes as shown in Figure 2. The margin is determined by the distance between the decision boundary and the closest data point from each class [25; 26; 27; 28]. Figure 1: Distribution of the patient population and their reason for admission. The population was divided into age categories of 13–44, 45–64, 65–79 and \(>\)80 years of age. Figure 2: Schematic representation of a two-dimensional dataset consisting of two linearly separable classes. The dotted lines indicate the boundaries where the margin is maximised without tolerating any misclassifications (adapted from Reference [28]). Generally, a feature map \(\mathbf{\phi}:\mathbb{R}^{d}\mapsto\mathbb{R}^{p}\), where \(d\) is the number of input space dimensions and \(p\) is the number of feature space dimensions, is used to transform the geometric boundary between the two classes to a linear boundary \(L:\mathbf{w}^{\top}\mathbf{\phi}(\mathbf{x})+b=0\) in feature space, for some weight vector \(\mathbf{w}\in\mathbb{R}^{p\times 1}\) and \(b\in\mathbb{R}\). The class of each instance can then be found by \(y=\text{sgn}\left(w^{\top}\mathbf{\phi}(x)+b\right)\), where sgn refers to the sign function. The estimation of the boundary \(L\) is performed based on a set of training examples \(\mathbf{x}_{i}\) (\(1\leq i\leq N\)) with corresponding class labels \(y_{i}\in\{-1,1\}\), where \(N\) is the number of data points. An optimal boundary is found by maximising the margin that is defined as the smallest distances between \(L\) and any of the training instances. In particular, one is interested in constants \(\mathbf{w}\) and \(b\) that minimise a _loss-function_[28]:  
\[\min_{\mathbf{w},\,b}\frac{1}{2}\mathbf{w}^{\top}\mathbf{w},\]  
and are subject to:  
\[y_{i}(\mathbf{w}^{\top}\mathbf{\phi}(x_{i})+b)\geq 1,\qquad i=1,2,...,N.\]  
By applying the lagrangian to the problem we get  
\[\mathcal{L}(\mathbf{w},b;\mathbf{\alpha})=\frac{1}{2}\|\mathbf{w}\|_{2}^{2}-(\sum_ {i=1}^{N}\alpha_{i}(y_{i}[\mathbf{w}^{\top}\mathbf{\phi}(x_{i})+b]-1),\]  
where \(\alpha_{i}\geq 0\) are the Lagrangian multipliers for \(i^{th}\) data point. By solving the optimisation problem  
\[\max_{\mathbf{\alpha}}\min_{\mathbf{w},b}\mathcal{L}(\mathbf{w},b;\mathbf{\alpha}),\]  
the following optimisation conditions are obtained:  
\[\frac{\partial\mathcal{L}}{\partial\mathbf{w}} =0\longrightarrow\mathbf{w}=\sum_{i=1}^{N}\alpha_{i}y_{i}\mathbf{ \phi}(x_{i}),\] \[\frac{\partial\mathcal{L}}{\partial b} =0\longrightarrow\sum_{i=1}^{N}\alpha_{i}y_{i}=0,\] \[\frac{\partial\mathcal{L}}{\partial\mathbf{\alpha}} =0\longrightarrow y_{i}(\mathbf{w}^{\top}\mathbf{\phi}(x_{i})-b)=1,\]  
The resulting classifier in both primal space and dual space are  
Figure 1:0  
Figure 1:1  
The dot product \(\mathbf{\phi}(x_{i})^{\top}\mathbf{\phi}(\mathbf{x})\) is computationally expensive, hence, it is replaced with the _kernel_ function \(k(x_{i},\mathbf{x})\), this replacement is known as the _kernel_ trick. With the _kernel_ trick, there is no need to execute the step of feature map as it is implicitly done by the _kernel_ function. Hence, the dual space classifier with the _kernel_ trick is  
Figure 1:2  
For practical reasons, we suggest to obtain the linear hard margin SVM from the standard SVM formula that tolerate misclassifcation errors [29]Figure 1:3  
subject to:  
Figure 1:4  
where the constant \(C\) denotes the _penalty term_ that is used to penalise misclassification through the slack variables \(\xi_{i}\) in the optimisation process. The linear hard margin SVM can be obtained via penalising the error extremely by giving \(C\) a very high value (e.g., \(10^{10}\)). With this trick, we can get a solution with misclassified instances to be investigated through the feature engineering phase.