# A Two-Phase Approach for Semi-Supervised Feature Selection
## 4 Proposed Two-Phase Approach
### Algorithm of the Two-Phase Approach  
**Phase-I:** Finding the reduced number of features (feature selection) and then finding the centroids of the clusters in the reduced dataset where classes are known. **Phase-II:** Determining the classes of patterns of the other part of the reduced dataset where classes are unknown with the help of their closest clusters obtained in the first part. The overall steps involved in the proposed two phase approach are presented in the Algorithm 2. The steps for calculating the maximum relevant and minimum redundant features are shown in Algorithm 1. The details of Algorithms 1 and 2 are given below:  
```
Input: Dataset with \(d\) features; with labels given on some patterns (supervised) and not given on some patterns (unsupervised)
1. Find out the correlation coefficient for the features for the dataset (supervised) where class labels are given. Sort these features in descending order of values of correlation coefficient. Let this list of features be \(F\_Sup\). Thus, a list of \(d\) correlation coefficients is obtained. 2. Take a certain number of features (given in Table 3) from the start of the feature list found in (1) above. These features are the features with maximum relevance. Let this list of features be denoted by \(F\_Sup\_red\). 3. Find out the correlation coefficient for each feature with its combination with other features (unsupervised). There will be \(d(d\_1)/2\) such combinations. Sort these features in ascending order of values of correlation coefficient. Let this list of features be \(F\_UnSup\). 4. Take a certain number of features (given in Table 3) from the start of the feature list obtained in (3) above and denote it as \(F\_UnSup\_red\). These features are the features with minimum redundancy. It is worth noting that each value of correlation coefficient is generated by combining two features of the dataset, unlike the situation in (1) where each feature is combined with class label only. 5. Find out the poorest features \(F\_poorest\) by computing \(F\_UnSup\_red\_Sup\_red\), i.e., the subset that contains those features of \(F\_UnSup\_red\) that are not in \(F\_Sup\_red\). Thus, \(F\_poorest\) is the subset of features with very low values of correlation coefficient with minimum redundancy but will be dropped as they will be harmful. 6. Find out the best features \(F\_best\) by taking the intersection of \(F\_Un



Cluster the first part of the reduced dataset without taking into account the class labels using any clustering method. Compute their centroids. The number of clusters or centroids is taken as the same as the number of classes available in that dataset. The Fuzzy C-means clustering method is used for clustering. * Find out the class of each cluster by taking the class labels of the majority of patterns in that cluster of the first part (it is also assumed). * Cluster the second part of the dataset in which class labels are hidden. Find out the centroids of the second part using any clustering method, the same as was used in first part. * Compare the two sets of centroids obtained in the two parts. The centroid that belongs to the first part and has a minimum distance with a centroid of the second part will form a pair. Thus, a set of pairs are formed, which is same as the number of clusters (or classes). * In each pair, the class of the centroid of the first part is known. This class will be labeled to the centroid of the other part, the class of which is unknown. * Check the classes of the patterns belonging to the second part obtained as above with their original classes, which were hidden in the second part. Compute the matching percentage for evaluating the classification accuracy. As an example, take wine data, which has 13 features. Now, according to Table 3, 50% of 13 when rounded equals 7. Thus, by step 2 of Algorithm 1, seven sorted features (in descending order of the values of correlation coefficients) are found as _F_Sup_red_ = {4,8,2,10,3,5,1}.