# An Improved Bi-LSTM-Based Missing Value Imputation Approach for Pregnancy Examination Data
## 2 Materials and Methods
### Strategy to Fill Missing Values--Bi-Lstm  
This dataset has severe missing data in the dimensions of time and features, so it is of great significance to discuss the influence of missing data processing on the model's effect. There are three ways to analyze data with missing values: (1) analyze the data with missing values directly; (2) select methods that are insensitive to missing data for analysis; (3) analyze the missing data after interpolation and filling. Filling missing data has always been a hot topic in various fields. Currently, several effective missing data filling methods have been proposed by experts and scholars. For example, the commonly used mean value interpolation method uses the mean value of sample variables to replace the missing value [26]. Random interpolation, on the basis of the sample distribution, extracts a substitution of missing values with a specific possibility from the population. Regression interpolation uses the linear relationship between auxiliary variables and target variables to predict missing values. [PERSON] proposed the EM (expectation maximization) algorithm [27] in 1977, which is used to estimate unknown parameters under known variables and can effectively carry out the task of the interpolation of missing data. These methods have high accuracy when filling a small amount of missing data in a static situation but are not satisfactory when processing missing data with a nonlinear relationship, time series characteristics and multiple variables. Recently, with the rapid development of the field of neural networks and the improvement of computing capabilities, neural networks have been widely used in the processing and analysis of missing data, recurrent neural networks (RNN) [28] especially. They are capable of finding long-term time dependences and analyzing time series of variable length, thus playing a very important role in time series analysis. Figure 6 shows the distribution of the number of pregnancy examinations (i.e., the length of time series) between week 11 and week 40. It can be seen from the figure that the length of the series of most samples is about 11 times. In Figure 1, it can be seen that the data are not uniformly distributed at different time points, and most of the data are concentrated in the later weeks. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Data** & **Original Data** & **Preprocessed Data** \\ \hline Number of examination records & 120,396 & 53,272 \\ \hline Number of features & 141 & 36 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Changes before and after data processing. This paper selected data of a part of time as markers and selected other data as training data. The filling effect was evaluated by the prediction results and symmetric mean absolute percentage error (SMAPE) of markers. Considering the distribution of data at each time point, markers should not be selected randomly in order to prevent losing the data of important time points and severely affecting the results. This paper proposes a method described as follows: let \(X=x_{1},x_{2},\ldots,x_{i},\ldots,x_{n}\) represent the missing state of a series of data:  
\[x_{i}= \begin{cases}1,\text{data of time point $i$ exists}\\ 0,\text{data of time point $i$ are missing}\end{cases}  \tag{1}\]  
For \(A=a_{1},a_{2},\ldots,a_{i},\ldots,a_{n}\),  
\[a_{i}=\frac{\Sigma_{k=1}^{n}x_{k}\cdot\gamma^{|k-i|}-x_{k}}{\Sigma a_{i}} \tag{2}\]  
\(a_{i}\) represents the \"ignorability\" of the data of the time point in the series. The less missing data near this value, the more \"unimportant\" the time point is, and it can be selected from the training set as a marker, where \(\gamma\) is the decay rate. Table 6 is the result of calculating the missing data state when the sequence length is 10 and the decay rate is 0.5. \[\text{For }B=b_{1},b_{2},\ldots,b_{n},\\ b_{i}=\frac{\Sigma x_{i}}{\Sigma b_{i}} \tag{3}\]  
\(b_{i}\) represents the data storage rate of time point \(i\) in the whole data set.