## 2 Materials and Methods
### Methods
#### 2.3.3 Enhanced Multi-Class MMFT  
The proposed enhanced multi-class MMFT approach consists of two phases, namely source selection and transfer mapping. Figure 4 depicts the general framework of the proposed enhanced multi-class MMFT that firstly performs source selection aimed at identifying appropriate sources, then utilizes an optimal combination of sources to perform transfer mapping, mainly to minimize EEG variations across source domains and target domains. The proposed enhanced multi-class MMFT includes five phases:  
* Domain selection through selection of optimal combination of closely related domains. * Distribution means alignment through rank of domain. * Tangent space feature extraction. * Grassmann manifold feature learning. * Classification utilizing MMFT classifier. Domain Selection  
In this case, source selection phase is firstly carried out to identify and select only closely related combinations of domains from multiple sources, then utilize the best-selected combination during transfer mapping to enhance the prediction rate of individual target domains. To achieve this goal, a MATLAB function known as nchoosek [29], denoted by \(B=nchoosek(v,k)\), which is a representation of binomial coefficient, was implemented through our proposed multi-class MMFT, with the number of possible combinations shown in (25)  
\[C(n,k)=\frac{n(n-1)\ldots(n-k+1)}{k!}=\frac{n}{k}\frac{n-1}{k-1}\frac{n-2}{k-2} \ldots\frac{n-k+1}{1} \tag{25}\]  
Subsequently, when the function is executed, it generates all possible combinations of closely related domains among multiple sources. In this instance, (4) is used to com  
Figure 4: Proposed enhanced multi-Class MMFT integrating domain selection and transfer learning. pute binomial coefficients denoted by \(C(n,k)\), with \(k\) representing the number of possible combinations from \(n\). In this case, both \(k\) and \(n\) have to be a nonnegative integer [29]. The main objective of the source selection phase is to discard non-related domains with low transferability but consider only closely related sources, mainly to reduce the effect of NT emerging from sessional and subject-to-subject variations [30]. After source selection, the optimal combination of domains is then utilized when transfer mapping is applied, whereby the selected sources are firstly aligned through DMA using ROD. Subsequently, covariance matrices are then generated once distribution means have been aligned, from which tangent space features for both source and target domain are extracted. Moreover, feature learning is carried out through GFK, making use of features acquired from the SPD manifold, whereby the MMFT classifier is applied after feature learning. In this case, to acquire the target domain's pseudo labels, prediction rates from multiple classifiers are then integrated through a voting mechanism. The overall procedure of the proposed multi-class MMFT is summarized in Algorithm 3. ```
0: source domains samples \(\left\{\left\{\left\{\mathbf{X}_{s,i}^{(j)},\mathbf{y}_{s,i}^{(j)}\right\}_{i=1 }^{n_{s}}\right\}_{j=1}^{z}\right\}_{j=1}^{z}\); target domain samples \(\left\{\mathbf{X}_{t,i}\right\}_{i=1}^{n_{t}}\); regularization parameters \(\lambda,\eta\); number of iterations \(N\). 0: Predict labels \(\hat{y}_{t}\) for target domain
1: for \(n\)= 1,..., \(N\)do
2: Compute binomial coefficients \(C(n,k)\); get combination of sources closely related to the target domain. 3: for \(j=1,\)...,\(z\)do
4: Get only the best combination from closely related sources. 5: end for
6: end for
7: Calculate the covariance matrices for both \(z\) source domains and target domain, apply DMA, get aligned covariance matrices \(\left\{\hat{P}_{s}^{(j)}\right\}_{j=1}^{z}\) and \(\widetilde{P}_{t}\). 8: Get tangent space features \(\widehat{X}\) form SPD manifold. 9: Learn Grassmann manifold features \(Z=[Z_{t},Z_{s}^{1},\ldots,Z_{S}^{z}]\) for \(z\) source domains and target domain. 10: Pseudo labels for target domain \(\hat{y}_{t}=[]\). 11: for \(n=1,\ldots,N\)do
12: Multi-source classifier \(f=[]\).