the distribution of the data. Given an incomplete instance, this method selects its $k$ closest neighbours according to a distance metric, and estimates missing data with the corresponding mean or mode. The mean rule is used to predict missing numerical features and the mode rule is used to predict missing categorical features. KNN imputation does not create explicit predictive models, because the training dataset is used as a lazy model. Also, this method can easily treat cases with multiple missing values.

### Distance Metric for Mixed Data {#heom}

Let there be two input vectors, $X_a$ and $X_b$ - whose features can be both continuous as well as categorical. The Heterogeneous Euclidean Overlap Metric (HEOM) [@batista2003analysis], denoted as $d(X_a,X_b)$, is defined as $$\begin{aligned}
    d(X_a,X_b) &=& \sqrt{\sum_{j=1}^p d_j(X_{aj},X_{bj})^2}\;, \label{7} \\
    d_j(X_{aj},X_{bj}) &=& \begin{cases}
                            1, & \text{$D_{aj}*D_{bj} = 0$ from \eqref{eq:d}}\\
                            d_0(X_{aj},X_{bj}), & \text{$X_j$ is categorical}\\
                            d_N(X_{aj},X_{bj}), & \text{$X_j$ is quantitative}
                         \end{cases} \label{8} \\
    d_0(X_{aj},X_{bj}) &=& \begin{cases}
                            0, & X_{aj} = X_{bj} \\
                            1, & X_{aj} \neq X_{bj}
                         \end{cases} \label{9} \\
    d_N(X_{aj},X_{bj}) &=& \frac{|X_{aj}-X_{bj}|}{max(X_{.j})-min(X_{.j})}\;, \label{10}\end{aligned}$$ where $max(X_{.j})$ means the maximum value of $n$ observations of feature $X_{.j}$ and $min(X_{.j})$ means the minimum value of $X_{.j}$ when it is quantitative. The distance ranges from 