## 3 Methodology
### Feature-Based TL: TCA and JDA
More mathematical details of the two algorithms can be found in the original papers on TCA and JDA [21; 29] but, to better understand how TCA and JDA reduce the cross-domain distribution discrepancy, the fundamental mathematical calculations used in TCA and JDA for the distribution discrepancy are described here. Figure 3: An illustration of the general steps of feature-based transfer learning [20]. Consider a labelled source domain \(\mathcal{D}_{s}=\{(\mathbf{x}_{1},y_{1}),\ldots\ (\mathbf{x}_{n_{s}},y_{n_{s}})\}\), and an unlabelled target domain \(\mathcal{D}_{t}=\{\mathbf{x}_{n_{t}+1},\ldots,\mathbf{x}_{n_{t}+n_{t}}\}\), where there are \(n_{s}\) samples in the source domain, each with a symptom vector \(\mathbf{x}\) of \(\mathrm{m}\) dimensions and a corresponding health state label \(y\), and there are \(n_{t}\) samples in the target domain each with a symptom vector \(\mathbf{x}\) of \(\mathrm{m}\) dimensions. The source and target domains share the same \(\mathrm{m}\)-dimensional feature space but different marginal and conditional probability distributions; that is, \(P_{s}(\mathbf{x}_{s})\
eq P_{t}(\mathbf{x}_{t}),\ Q_{s}(y_{s}|\mathbf{x}_{s})\
eq Q_{t}(y_ {t}|\mathbf{x}_{t})\). The data from the source and target domains were compiled into a data matrix \(\mathbf{X}=[\mathbf{x}_{1},\ldots,\mathbf{x}_{n}]\in\mathbb{R}^{m\times n}\), which maps to a feature space matrix \(\mathbf{Z}=\mathbf{A}^{T}\mathbf{X}\) through the transformation matrix \(A\). The goal of TCA and JDA is to determine the optimal \(A\) that minimises the distribution discrepancy between the source and target domain cases in the feature space. In TCA, the marginal distribution discrepancy is calculated by the following equations [21]:  
\[\left\|\frac{1}{n_{s}}\sum_{i=1}^{n_{s}}\mathbf{A}^{T}\mathbf{x}_{i}-\frac{1}{n_{t}} \sum_{j=n_{s}+1}^{n_{s}+n_{t}}\mathbf{A}^{T}\mathbf{x}_{j}\right\|^{2}=tr\Big{(}\mathbf{A} ^{T}\mathbf{X}\mathbf{M}_{0}\mathbf{X}^{T}\mathbf{A}\Big{)} \tag{1}\]  
\[\left(\mathbf{M}_{0}\right)_{ij}= \begin{cases}\frac{1}{n_{t}n_{s}},&\mathbf{x}_{i},\bm {x}_{j}\in\mathcal{D}_{s}\\ \frac{1}{n_{t}n_{s}},&\mathbf{x}_{i},\mathbf{x}_{j}\in\mathcal{D}_{t}\\ \frac{1}{n_{t}n_{t}},&\mathbf{otherwise}\end{cases}  \tag{2}\]  
Similar to the calculation of the maximum mean discrepancy (MMD), the LHS of Equation (1) shows the calculation of the marginal distribution discrepancy, which can be interpreted as the vector norm of the difference between the mean source domain transformed feature vectors and the mean target domain transformed feature vectors. The LHS of Equation (1) is transformed into the RHS by introducing the MMD matrix \(\mathbf{M}_{0}\), as shown in Equation (2). In JDA, the conditional distributions considered, \(Q_{s}(y_{s}|\mathbf{x}_{s})\) and \(Q_{t}(y_{t}|\mathbf{x}_{t})\) are approximated by class-conditional distributions \(Q_{s}(\mathbf{x}_{s}|y_{s})\) and \(Q_{t}(\mathbf{x}_{t}|y_{t})\) instead. Considering the label space of \(C\) classes, \(c\in\{1,\ldots,C\}\), the conditional distribution discrepancy, \(Q_{s}(\mathbf{x}_{s}|y  
are supposed to become increasingly accurate as the conditional distribution calculation becomes more accurate through the iterations until convergence. \[\min_{\mathbf{A}^{T}\mathbf{X}\mathbf{H}\mathbf{X}^{T}\mathbf{A}=\sum_{c=0}^{C}tr\Big{(}\mathbf{A}^{T} \mathbf{X}\mathbf{M}_{c}\mathbf{X}^{T}\mathbf{A}\Big{)}+\lambda\|\mathbf{A}\| \tag{5}\]  
Combining with principal component analysis (PCA), the overall optimisation equation for JDA is shown as Equation (5), where \(\mathbf{H}\) is the centring matrix in PCA, and \(\lambda\) regulates the regularisation term to keep the optimisation well-defined [21]. TCA is a special case for \(C=0\). The JDA algorithm used in this study was obtained from [30]. As observed from running and examining the JDA algorithm, the first loop of the iterative process corresponds to a TCA operation, and from the second loop onwards, each loop corresponds to a JDA operation. Convergence was reached for all the scenarios tested before the 20 th loop.