## 2 Proposed Framework
### Feature Selection  
This phase selects the optimal subset of the source and target projects for feature transfer. Quantify the importance of each feature to select features by using the tree model. In the process of CART construction, select the feature with the maximum gain to segment to the maximum depth, and achieve the minimum cost of CART segmentation. When constructing the next tree using the ensemble learning, the objective function adds complexity. The first and the second derivatives are used to reduce the loss of cart, minimize the objective function and ensure the reliability of the final decision. All features of all trees are weighted and averaged to determine their importance. During the construction of cart, the idea of minimizing the objective function is as follows:  
\[L_{k}\ =\ \sum_{i}^{n}l(y_{i},\hat{y}_{i})+\sum_{k}\Omega(p_{k}) \tag{9}\]  
\[\Omega(p)\ =\ \gamma T+\frac{1}{2}\lambda\|\omega\|^{2} \tag{10}\]  
Here, \(l\) is a differentiable convex loss function, which is used to measure the difference between the prediction \(\hat{y}_{i}\) and the target \(y_{i}\). The second term \(\Omega\) penalizes the complexity of the model, which helps to smooth the final learning weights to avoid over-fitting. \(T\) is the number of leaf nodes, \(\|\omega\|\) is \begin{table}
\begin{tabular}{c c c} \hline
**Project** & **Baseline** & **SWIM** \\ \hline PC3 & 0.7792 & 0.8293 \\ PC4 & 0.7398 & 0.8231 \\ MW1 & 0.8229 & 0.8678 \\ EQ & 0.7948 & 0.8730 \\ JDT & 0.9219 & 0.9633 \\ LC & 0.8011 & 0.8658 \\ AR3 & 0.8472 & 0.8666 \\ AR4 & 0.9587 & 0.9892 \\ AR5 & 0.8752 & 0.9375 \\ \hline \end{tabular}
\end{table} 
Table 1: AUC obtained by using SVM without sampling (Baseline), and with SWIM. Figure 2: (a) Shows the binary support vector classifier induced over the imbalanced training set; (b) Shows the illustration of classifier produced by using SWIM. the magnitude of leaf node vector, \(\gamma\) represents the difficulty of sharding a node, and \(\lambda\) represents the L2 regularization coefficient. \[L_{k}\ =\ \sum_{i}^{n}l\Big{(}y_{i},\hat{y}_{i(k-1)}+p_{k}(x_{i})\Big{)}+\Omega(p_{ k}) \tag{11}\]  
\[p_{k}(x_{i})\ =\ \omega_{q(x_{i})} \tag{12}\]  
where \(\hat{y}_{i(k)}\) is the prediction of the \(i\)-th sample at the \(k\)-th iteration. \(q(x_{i})\) is the structure function of each tree that maps an example to the corresponding leaf index. The objective function greedily adds \(p_{k}(x_{i})\). Each \(p_{k}(x_{i})\) corresponds to an independent tree structure \(q(x_{i})\) and leaf weights \(w\). \[L_{k}\ =\ \sum_{i\ =\ 1}^{n}\Big{[}l\Big{(}y_{i},\hat{y}_{i(k-1)}\Big{)}+g_{ i}p_{k}+\frac{1}{2}h_{i}p_{k}^{2}\Big{]}+\Omega(p_{k}) \tag{13}\]  
Second-Order approximation optimizes the target quickly, where \(g_{i}\ =\ \partial_{y_{i(k-1)}}l\Big{(}y_{i},\hat{y}_{i(k-1)}\Big{)}\) and \(h_{i}\ =\ \partial_{\hat{y}_{i(k-1)}}^{2}l\Big{(}y_{i},\hat{y}_{i(k-1)}\Big{)}\) are the first and the second order gradient statistics of the loss function, and removes the constant term of the objective function. \[ \begin{array}{l}L_{k}\ =\ \sum_{i}^{n}l\Big{(}y_{i},\hat{y}_{i(k-1)}+p_{k} \Big{)}+\Omega(p_{k})\\ \ =\ \sum_{i}^{n}l\Big{(}y_{i},\hat{y}_{i(k-1)}+p_{k}\Big{)}+\gamma T+\frac{1}{2 }\lambda\ \sum_{j=1}^{T}w_{j}^{2}\\ \ =\ \sum_{j=1}^{T}\Big{[}\Big{(}\sum_{i\in I_{j}}\hat{s}_{i}\Big{)}\omega_{j}+ \frac{1}{2}\Big{(}\sum_{i\in I_{j}}h_{i}+\lambda\Big{)}\omega_{j}^{2}\Big{]}+ \gamma T\end{array}  \tag{14}\]  
The weight \(w_{j}\) of each leaf in each tree is obtained, which is used to calculate the feature importance:  
\[w_{j}\ =\ -\frac{\sum_{i\in I_{j}}g_{i}}{\sum_{i\in I_{j}}h_{i}+\lambda} \tag{15}\]  
Las Vegas is a typical randomization method, namely, one of probability algorithms. It has the characteristics of probability algorithm, which allows the algorithm to randomly select the next step in the process of execution.