# A Classification Method for Incomplete Mixed Data Using Imputation and Feature Selection
## 2 Method
### Particle Encoding Strategy  
Many practical systems and applications generate data that approximately follow a Gaussian distribution [31]. Therefore, PSOFI models the distribution of quantitative features that contain missing values as a Gaussian distribution, with the mean and standard deviation as variables to form the distribution. For cases of categorical features with missing data, the selecting probabilities of every unique value in existing data are taken as parameters. As a result, PSOFI generates values that comply with their probability distribution instead of specific numbers for imputing missing values, which enhances its generalizability. Furthermore, it uses feature selection to choose the optimal feature subset that can enhance the learning performance of the classification algorithm. To illustrate our approach, we provide a diagram of the encoding pattern for particles in PSOFI in Figure 1.  
As shown in Figure 1, each particle consists of three parts: the first two parts are for imputation and the third part is for feature selection. Specifically, \(\mu_{i}\) and \(\delta_{i}\) in the first part denote the mean and standard deviation parameters of Gaussian distribution in quantitative feature \(i\) with missing values, respectively; as for the second part, \(v_{k}^{1}\) to \(v_{k}^{q}\) represent the selecting probabilities of the incomplete categorical feature \(k\) based on its existing \(q\) unique values; in the third part, PSOFI employs \(f_{1}\) to \(f_{d}\) as the coding values of \(d\) features in the dataset to select feature subsets. Based on the encoding pattern, the pseudo-code for evaluating the particles is presented in Algorithm 1. ```
0: particle \(i\), training dataset \(D_{t}\), testing dataset \(D_{e}\);
0: fitness value \(F_{i}\);
1:for feature \(e\) from 1 to \(d\) in \(D_{t}\)do
2: obtain the corresponding imputation model \(M\) by decoding the imputation part of particle \(i\);
3: generate imputation values by \(M\) to impute missing positions in feature \(e\);
4:endfor
5: get the complete training dataset: \({D_{t}}^{\prime}\gets D_{t}\);
6: select the feature subset \(FS\) by decoding the feature selection part of particle \(i\);
7: construct new training dataset and testing dataset based on \(FS\): \({D_{t}}^{\prime\prime}\gets D_{t}\); \({D_{e}}^{\prime}\gets D_{e}\);
8: apply \({D_{t}}^{\prime\prime}\) to train classifier \(C\);
9:if\({D_{e}}^{\prime}\) is complete then
10:\(F_{i}=Evaluation(C,D_{e}^{\prime})\);
11:else
12: use the imputation models in step two to impute the missing positions and get a complete testing dataset: \({D_{e}}^{\prime\prime}\gets D_{e}{}^{\prime}\);
13:\(F_{i}=Evaluation(C,{D_{e}}^{\prime\prime})\);
14:endif
```  
**Algorithm 1** Pseudo-code of particle evaluation. Lines 1 to 5 impute the training dataset \(D_{t}\). In Line 2, the imputation model for the corresponding feature is generated. Then, in line 3, random imputation values are generated based on the imputation model. More specifically, if quantitative feature \(i\) has \(L_{i}\) missing values, the algorithm generates \(L_{i}\) random values following the Gaussian distribution with mean and standard deviation values as \(\mu_{i}\) and \(\delta_{i}\) and uses the values to fill the missing positions of feature \(i\). Additionally, we use the maximum and minimum values of feature \(i\) as the upper and lower bounds of \(\mu_{i}\) and \(\delta_{i}\) during the optimization iterations. Similarly, if the categorical feature \(k\) contains \(L_{k}\) missing values, we use \(v_{k}^{1}\) to \(v_{k}^{q}\) to represent the selecting probabilities of its \(q\) unique values and adopt the roulette strategy to select \(L_{k}\) values, and then fill the selected values to the missing positions of feature \(k\). After the imputation process, the imputation models of the incomplete features and the complete training dataset \({D_{t}}^{\prime}\) are obtained. In Line 6, the particle selects the features according to their coding values and (1). Figure 1: Encoding pattern of particles in PSOFI.