## 2 Materials and Methods
### Hypergraph Regularized Group Lasso  
The target of the hypergraph regularized group lasso is to obtain a subset of points on the femur mesh, the coordinates of which can be linearly combined to predict the femur implant size. This can be accomplished by the following optimization problem:  
\[\min_{\beta}\quad\frac{1}{2}\|\mathbf{y}-\mathbf{X}\beta\|_{2}^{2}+\lambda_{ \text{G}}\sum_{\mathbf{g}\in P}\|\beta_{\mathbf{g}}\|_{2}+\frac{\lambda_{L}}{2 }\beta^{T}\mathbf{L}_{H}\beta+\frac{\lambda_{R}}{2}\beta^{T}\mathbf{I}\beta \tag{4}\]  
The objective function has four terms. The first term is a least squares term trying to represent the implant size \(\mathbf{y}\) as a linear combination of the vertex locations of the mesh, parameterized by \(\beta\). The parameter vector \(\beta\) indicates the importance of each vertex's coordinates in predicting the femoral implant size. The second term is a group lasso regularization term which results in sparsity in the points selected. \(P\) is the set of 3-tuples in which each tuple \(\mathbf{g}\) references the column indices corresponding to the group of \(\{x,y,z\}\) coordinates of a point on the mesh. \(\beta_{\mathbf{g}}\in\mathbb{R}^{3}\) is a set of 3 of the model parameters corresponding with the \(\{x,y,z\}\) coordinates from point \(p_{\mathbf{g}}\). This regularization forces either all coordinates of a point to be included in the model or all coordinates of the point are found to be uninformative to the model, in which case they receive a zero-valued \(\beta_{\mathbf{g}}\) coefficient. As a result, the group sparsity term creates model interpretability by expressing the femoral size as a linear combination of a small subset of points on the mesh. The third term forces the model coefficients of vertices linked by an edge, to be similar in value. We opted to use this penalty term because our hypothesis is that vertices linked by an edge are nearby in space, hence they should have a similar influence on the model. The last term is a ridge penalty to obtain uniqueness of the solution. The group lasso itself does not necessarily result in a unique solution because it is not strictly convex [28]. The addition of the ridge regularization leads to a strictly convex function guaranteeing a unique solution. Figure 2: Graph and hypergraph structure for a mesh in 3D space. (**a**) Graph structure. (**b**) Hypergraph structure. The group lasso problem is a convex non-differentiable problem as it is discontinuous at \(\beta_{\mathbf{g}}=\mathbf{0}\). For these types of problems computationally efficient solvers exist based on the proximal gradient method which alternatively optimize each group [29]. Therefore, the objective function should be group separable. However, the hypergraph regularization term is not. Nevertheless, the objective function can be rewritten as a normal group lasso problem which can be solved using the proximal gradient method. By combining the ridge penalty with the hyper-graph Laplacian regularization, the objective function can be simplified. More specifically, the weighted sum of the identity matrix and the hypergraph Laplacian is a positive definite matrix. Hence, it can be decomposed using a Cholesky decomposition [30]: \(\frac{\lambda_{R}}{\lambda_{L}}\mathbf{I}+\mathbf{L}_{H}=\mathbf{U}^{T} \mathbf{U}\). Using the upper triangular matrix \(\mathbf{U}\) we augment the feature matrix \(\mathbf{X}\) and target vector \(\mathbf{y}\) as follows [31]:  
\[\widetilde{\mathbf{X}}= \begin{bmatrix}\mathbf{X}\\ \sqrt{\lambda_{L}}\mathbf{U}\end{bmatrix} \in\mathbb{R}^{(N+3p)\times 3p} \tag{5}\]  
\[\widetilde{\mathbf{y}}= \begin{bmatrix}\mathbf{y}\\ \mathbf{0_{3p}}\end{bmatrix} \in\mathbb{R}^{N+3p} \tag{6}\]  
\(\mathbf{0_{3p}}\) is a column vector with \(3p\) zero values.