# A Two-Phase Approach for Semi-Supervised Feature Selection
## 4 Proposed Two-Phase Approach
### Algorithm of the Two-Phase Approach
Find feature set for labelled dataset: \(F_{g,L}\gets g(\rho_{L})\) for a user defined \(g\) by taking first \(g\) highest values of \(\rho_{L}\) (Maximum Relevance)
4. Find feature set for whole dataset: \(F_{b,P}\gets b(\rho)\) for a user defined \(b\) by taking first \(b\) lowest values of \(\rho\) (minimum redundancy). 5. Find \(F_{r}\gets F_{g,L}\cap F_{b,P}\), \(r\) being the cardinality of \(F_{r}\) set
6. Create \(r\) different combinations of \(F_{g,L}\), features to get \(N\) = \(F_{g,L}(C)_{r}\) number of combinations of these feature subsets \(F_{g}\); \(g\) = 1, 2,..., N
7. Form \(D_{ei}\) reduced datasets with \(r\) features each and \(I\) = 1, 2,..., N
8. Find Classification Accuracies \(CA_{N}\) of \(D_{tN}\) Datasets, let \(CA_{fmax}\) be the highest \(CA\) for _fmax_ feature set; for simplicity of notation \(H\leftarrow\textit{fmax}\) be the feature set which produced highest \(CA\)
9. Apply k-means to cluster unlabelled dataset \(D_{H,U}\) and labelled dataset \(D_{H,L}\) into k clusters for each dataset respectively
10. Map \(C_{i}\in D_{H,U}\) to nearest \(C_{j}\in D_{H,L}\) for \(i,j\) = 1, 2,..., k
11. Assign labels to instances \(P_{i}\in D_{H,U}\gets C_{j}\)
12. Compute \(CA\) of \(D_{H,U}\) by comparing with known labels of \(D_{EP}\)  
Output: classification accuracy \(CA\)
```

**Pseudo-Code: The proposed two-phase approach**

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. Find feature set for labelled dataset: \(F_{g,L}\gets g(\rho_{L})\) for a user defined \(g\) by taking first \(g\) highest values of \(\rho_{L}\) (Maximum Relevance)
4. Find feature set for whole dataset: \(F_{b,P}\gets b(\rho)\) for a user defined \(b\) by taking first \(b\) lowest values of \(\rho\) (minimum redundancy). 5. Find \(F_{r}\gets F_{g,L}\cap F_{b,P}\), \(r\) being the cardinality of \(F_{r}\) set
6. Create \(r\) different combinations of \(F_{g,L}\), features to get \(N\) = \(F_{g,L}(C)_{r}\) number of combinations of these feature subsets \(F_{g}\); \(g\) = 1, 2,..., N
7. Form \(D_{ei}\) reduced datasets with \(r\) features each and \(I\) = 1, 2,..., N
8. Find Classification Accuracies \(CA_{N}\) of \(D_{tN}\) Datasets, let \(CA_{fmax}\) be the highest \(CA\) for _fmax_ feature set; for simplicity of notation \(H\leftarrow\textit{fmax}\) be the feature set which produced highest \(CA\)
9. Apply k-means to cluster unlabelled dataset \(D_{H,U}\) and labelled dataset \(D_{H,L}\) into k clusters for each dataset respectively
10. Map \(C_{i}\in D_{H,U}\) to nearest \(C_{j}\in D_{H,L}\) for \(i,j\) = 1, 2,..., k
11. Assign labels to instances \(P_{i}\in D_{H,U}\gets C_{j}\)
12. Compute \(CA\) of \(D_{H,U}\) by comparing with known labels of \(D_{EP}\) ```
**Output: classification accuracy \(CA\)
```  
**Pseudo-Code: The proposed two-phase approach**  
[PERSON] et al. [35] proposed an RRPC-based Semi-Supervised Feature Selection Approach. The criteria used maximum relevance while selecting features for supervised learning and minimum redundancy for unsupervised learning of features. The criterion is incremental in nature as the features are added one by one. The approach used in this paper also applies relevancy and redundancy criteria for determining an optimum set of features on the basis of values of correlation coefficients. The selection of an optimum subset of features is given in Algorithm 1. The emphasis in the paper is to maintain a good composition of features having high relevancy but minimum redundancy. The features with minimum values of correlation coefficients have been dropped if they are not part of those features that have high relevancy. An advantage of the present method is that it is simple and easy to implement. It is a new but efficient approach as well.