# A Two-Phase Approach for Semi-Supervised Feature Selection
## 4 Proposed Two-Phase Approach
### Algorithm of the Two-Phase Approach
Similarly for the unsupervised case, mentioned in Step 4 of Algorithm 1 above, seven combinations of features (in ascending order of the values of correlation coefficients) are obtained as _F_UnSup_red_ = {(2,11),(7,8),(10,11),(8,12),(6,8),(4,13),(10,12)}. According to Step 5 of Algorithm 1, the poorest feature subset will contain those features that belong to _F_UnSup_red_ but do not belong to _F_Sup_red_, i.e., _F_poorest_ = {6,7,11,12,13}. Now, calculate _F_best_ as an intersection of subsets of _F_Sup_red_ = {4,8,2,10,3,5,1} and _F_UnSup_red_ = {(2,11),(7,8),(10,11),(8,12),(6,8),(4,13),(10,12)}. Therefore, _F_best_ is computed as {2,4,8,10}, which gives a cardinality of 4. Now, form combinations of four features from _F_Sup_red_, i.e., {4,8,2,10,3,5,1}, 7C4, which is 35. Thus, 35 combinations will be formed, each combination having four features from {4,8,2,10,3,5,1}. The feature subset {1,2,3,10} produced the highest CA when labels of 70% patterns were known; therefore, this subset was chosen. Similarly, for 50% and 40% of the known labels, feature subset {1,2,8,10} was chosen as it produced the highest CA in both cases. \begin{table}
\begin{tabular}{c c c} \hline
**Experiment No.** & **Patterns with Labels Known in \%** & **Patterns with Labels Unknown in \%** \\ \hline
1 & 70 & 30 \\ \hline
2 & 50 & 50 \\ \hline
3 & 40 & 60 \\ \hline \end{tabular}
\end{table} 
Table 2: The number of patterns with known and unknown labels in the dataset. \begin{table}
\begin{tabular}{c c c} \hline
**S No.** & **Maximum Relevance \({}^{*}\)** & **Minimum Redundancy \({}^{**}\)** \\ \hline
1 & 50\% (rounded), when total features \(\leq\) 20 & 50\% of total features \(\leq\) 20 \\ \hline
2 & 10 when total features \textgreater{} 20 & when total features \textgreater{} 20 \\ \hline \end{tabular} \({}^{*}\) Count this number on the basis of higher correlation coefficient values between features and classes. \({}^{**}\) Count this number on the basis of low correlation coefficient values between each pair of features.

\end{table} 
Table 3: Size of feature sets retained for computing maximum relevance and minimum redundancy. As another example consider Wisconsin Breast Cancer (WBC) data that have nine features. Now, according to Table 3, 50% of 9 when rounded equals to 5. Thus, by step 2 of Algorithm 1 above, five sorted features (in descending order of the values of correlation coefficients) are found as _F_Sup_red = {2,3,6,7,8}. Similarly, for unsupervised case, mentioned in Step 4 of Algorithm 1 above, five combinations of features (in ascending order of the values of correlation coefficients) are obtained as _F_UnStup_red = {(6,9),(7,9),(1,9),(4,9),(8,9)}. According to Step 5 of Algorithm 1, the poorest feature subset will contain those features that are in _F_UnStup_red but not in _F_Sup_red_, i.e., _F_poorest = {1,4,9}. Now, calculate _F_best_ as an intersection of subsets of _F_Sup_red = {2,3,6,7,8} and _F_UnSup_red = {(6,9),(7,9),(1,9),(4,9),(8,9)}. Therefore, _F_best_ is computed as {6,7,8}, which gives a cardinality of 3. Now, form combinations of three features from _F_Sup_red_, i.e., {2,3,6,7,8}, _5C3_, which is 10. Thus, 10 combinations will be formed, each combination having three features from {2,3,6,7,8}. The feature subset {3,6,8} produced the highest CA when labels of 70% patterns were known; therefore, this subset was chosen. Similarly, for 50% known labels, subset {2,6,8}, and for patterns having 40% known labels, feature subset {3,6,7} were chosen as these subsets produced the highest CA. The pseudo code of the proposed two-phase approach is as below:

```
Input \(D_{EP}\) dataset with \(F\) features, \(P\) number instances and number of classes as \(C\)
1. \(D_{FL}\gets D_{EP}\) where \(L\) is the number of instances labelled (\(L\) < \(P\)), \(U\) is number of instances unlabelled thus \(L\) + \(U\) = \(P\)
2. Compute correlation coefficients for labelled \(\rho_{L}\gets D_{FL}\) and entire data set \(\rho\gets D_{EP}\)
3.