# Abstract

Imputing data is a critical issue for machine learning practitioners, including in the life sciences domain, where missing clinical data is a typical situation and the reliability of the imputation is of great importance. Currently, there is no canonical approach for imputation of clinical data and widely used algorithms introduce variance in the downstream classification. Here we propose novel imputation methods based on determinantal point processes that enhance popular techniques such as the Multivariate Imputation by Chained Equations (MICE) and MissForest. Their advantages are two-fold: improving the quality of the imputed data demonstrated by increased accuracy of the downstream classification; and providing deterministic and reliable imputations that remove the variance from the classification results. We experimentally demonstrate the advantages of our methods by performing extensive imputations on synthetic and real clinical data. We also develop quantum circuits for implementing determinantal point processes, since such quantum algorithms provide a computational advantage with respect to classical ones. We demonstrate competitive results with up to ten qubits for small-scale imputation tasks on a state-of-the-art IBM quantum processor. Our classical and quantum methods improve the effectiveness and robustness of clinical data prediction modeling by providing better and more reliable data imputations. These improvements can add significant value in settings where where high precision is critical, such as in pharmaceutical drug trials where our approach can provide higher confidence in the predictions made.

**eLife assessment**

This **valuable** study presents a modification of earlier imputation methods for clinical data, effectively addressing missing values with a slight improvement over previous techniques. The methodology and results for the classical case are **solid**, although the evidence for the claim of a practical advantage in 'next generation' quantum computers is not validated. This work will be of value to scientists dealing with datasets involving imputation for classification tasks, particularly in clinical studies.

Missing data is a recurring problem in machine learning and in particular for clinical datasets, where it is common that numerous feature values are not present for reasons including incomplete data collection, discrepancies in data formats and data corruption [8, 16, 20, 21]. Machine learning is routinely used in life science and clinical research for prediction tasks, such as diagnostics [22] and prognostics [2], as well as estimation tasks, such as biomarker proxies [28] and digital biomarkers [23]. Beyond the research setting, machine learning is becoming more commonplace as regulated Software as a Medical Device, where machine learning models are influencing - or making - clinical decisions that affect patient care.

Machine learning algorithms typically require complete data sets and missing values can significantly affect the quality of the machine learning models trained on such data. This is in large part due to the fact that there can be different underlying reasons for the missingness: for example, feature values can be missing completely at random (MCAR), missing at random (MAR) and missing not at random (MNAR), each one with their own characteristics.

Despite its importance for clinical trials, there is no canonical approach for dealing with missingness and finding appropriate, effective and reproducible methods remains a challenge. A common way to deal with missing clinical data is to exclude subjects that do not have the complete set of feature values present. A drawback of this approach is that excluding subjects can in fact introduce significant biases in the final model. For example, it can result in the model being trained to be more effective for the type of subjects that are likely to have complete data than for those that do not. Moreover, the effectiveness and reliability of clinical trials is reduced when subjects with missing feature values are excluded from the clinical trial.

Data imputation is an alternative to the complete dataset approach, where subjects with missing feature values are not excluded. Instead, missing values are imputed to create a complete dataset. There are different ways to achieve this, including “filling” missing values with zeros, or with the mean value of the feature across all subjects that have such a value present. These methods provide consistent imputation results, but there are important caveats for using such simple methods, since they ignore possible correlations between features and can make the dataset appear more homogeneous than it really is. More advanced data imputation methods have been proposed in the literature: iterative methods include the multivariate imputation by chained equations (MICE) [27] and MissForest [25] algorithms, and deep learning methods include GAIN (generative adversarial imputation nets) [29] and MIWAE (missing data importance-weighted autoencoder) [17]. Recent results [24] have shown that for clinical data two iterative imputation methods, MiceRanger, that uses predictive mean matching, and MissForest, that uses Random Forests to predict the missing values of each feature using the other features, provide the best results and have been used here as a baseline.

Several metrics are routinely used to quantify the quality of data imputation: point-wise discrepancy measures include root mean square error (RMSE), mean absolute error (MAE) and coefficient of determination (R^{2}). Feature-wise discrepancy measures include Kullback-Leibler divergence, two-sample Kolmogorov-Smirnov statistic or (2-)Wasserstein distance. Ultimately, the quality and reliability of imputations can be measured by the performance of a downstream predictor, which is usually the AUC (area under the receiver operating curve) for a classification task. In practical terms, the performance of the downstream classifier is usually of highest importance for clinical data sets: for example, in one of our datasets, the classifier denominates a binary outcome of a critical care unit stay (e.g. survival) for each patient. Accordingly, we have used AUC for the classification task here to assess the performance of our novel methods.

An inherent feature of standard Random Forest and determinantal sampling algorithms is randomness that produces data imputations that vary from one run of the algorithm to the next. This is often undesirable, since the downstream classification performance can also be affected. This motivated us to develop a deterministic version of determinantal sampling within the Random Forests of the imputation methods to provide robust and reliable imputation methods. Determinantal sampling, based on determinant point processes (DPP) [5, 14], favors samples that are diverse and thus reduces the variance of the training of each decision tree, which in turn provides more accurate models. In essence, determinantal sampling picks subsets of data according to a distribution that gives more weight to subsets of data that contain diverse datapoints. More precisely, each subset of datapoints is picked according to the volume encapsulated by these datapoints. The determinantal distribution increases the attention given to uncommon or out-of-the-ordinary data points rather than biasing the learning process towards the more commonly found data, which can improve the overall prediction accuracy in particular for unbalanced datasets as is often the case for clinical data [6]. Determinantal sampling for regression and classification tasks with full data has been proposed previously for linear regressors [18] and for Random Forest training for a financial data classification use case where it outperformed the standard Random Forest model [26].

Through deterministic determinantal sampling we address two challenges in data imputation: first, we provide improved data imputation methods that can increase the performance of the downstream classifier; and second, we remove the variance of the common stochastic and multiple imputation methods, thus ensuring reproducibility, easier integration in machine learning workflows, and compliance with healthcare regulations. While these improvements are of particular relevance for clinical data, our algorithms can also be advantageous for other imputation tasks where improving downstream classification and removing variance is of importance.

In addition, we explore the potential of quantum computing to speed up these novel imputation methods: we demonstrate a quantum circuit implementation of the determinantal sampling algorithm that offers a computational advantage compared to its classical counterpart. The best classical algorithms for determinantal sampling take in practice cubic time in the number of features to provide a sample [6]. In contrast, the quantum algorithm we present here, based on theoretical analysis in [12], has running time only linear in the number of features, where running time is measured as the depth of the necessary quantum circuits. This suggests that with the advent of next generation quantum computers with more and better qubits, one could also expect a computational speedup in performing determinantal sampling using a quantum computer. Here, we demonstrate competitive results with up to ten qubits for small-scale imputation tasks on a state-of-the-art IBM quantum processor.

# Results

We provide in Methods a detailed description of our four imputation methods, DPP-MICE, DPP-MissForest, detDPP-MICE and detDPP-MissForest. All of them are based on iterative imputation methods that use the observed values of every column to predict the missing values. The model used to fill missing values in each column is the Random Forest classifier. Our imputation methods replace the standard Random Forest used by the original miceRanger and MissForest imputers by the DPP-Random Forest model, for our first two imputers, and the detDPP-Random Forest for the latter two. The DPP-Random Forest model subsamples the data for each decision tree using determinantal sampling instead of uniform sampling, while the detDPP-Random Forest model deterministically picks for each decision tree the subset of data that has the maximum probability according to the determinantal distribution. We also describe a computationally advantageous way to perform the determinantal sampling using efficient quantum circuits.

In order to benchmark the different imputation methods, we used two types of datasets with a categorical outcome variable. First, a synthetic dataset, created using the scikit-learn method make classification. It consists of 2000 rows with 25 informative features. This is useful to study the imputation quality where features have equal importance. Second, the MIMIC-III dataset [11]: The Medical Information Mart for Intensive Care (MIMIC) dataset which is a freely available clinical database. It is comprised of data for patients who stayed in critical care units at the Beth Israel Deaconess Medical Center between 2001 and 2012. It contains the data of 7214 patients with 14 features.

We also applied two types of missingness on these datasets: MCAR (missing completely at random), where the missingness distribution is independent of any observed or unobserved variable; and MNAR (missing not at random), where the missingness distribution depends on the outcome variable.

We present the numerical results in terms of the AUC of the downstream classification task in Table I and provide graphs of the results in tables II and III. Each experiment was run ten times with different random seeds to get the variance of the results.

Overall, DPP-MICE and DPP-MissForest provide improved results compared to their classical baseline MICE and MissForest. This is the case for both the synthetic and the MIMIC datasets and for both MCAR and MNAR missingness. Even more interestingly, the detDPP-MICE and detDPP-MissForest collapse the variance of the imputed data to 0 and moreover lead in most cases to even higher AUC than the expectation of the previous methods.

## DPP-MICE, and detDPP-MICE outperform MICE

We present the performance results of MICE-based methods in terms of the AUC of the downstream classification task using an XGBoost classifier, which has been shown to be the strongest classifier for such datasets [24]. In each case, the original dataset with induced missing values is imputed using MICE, DPP-MICE or detDPP-MICE, then it is divided into 3 folds of Development/Holdout sets. The downstream classifier is then trained on each development set and its performance is measured by the AUC for the corresponding holdout set. The results appear in Table I and in the figures in Table II.

The imputation procedure is performed for a total of 10 iterations over the whole columns and for each column, a (DPP) Random Forest regressor is trained using 10 trees. For each Random Forest training, the dataset is divided into batches of 150 points each and DPPs are used to sample from every batch.

The results show that across the twelve in total dataset experiments DPP-MICE outperforms MICE on expectation in ten of them, while detDPP-MICE provides a single deterministic imputation which outperforms the expected result from MICE in all twelve datasets and from DPP-MICE eleven out of twelve times.

## DPP-MissForest and detDPP-MissForest outperform MissForest

Here we present the performance results of MissForest-based methods in terms of the AUC of the downstream classification task using again an XGBoost classifier. In each case, the original dataset with induced missing values is imputed using MissForest, DPP-MissForest or detDPP-MissForest, then it is divided into 3 folds of Development/Holdout sets. The downstream classifier is again then trained on each development set and its performance is measured by the AUC for the corresponding holdout set. The results appear in Table I and in the figures in Table III. The specifics of the Random Forest training are the same as in the case of MICE.

The results show that across all experiments, DPP-MissForest outperforms MissForest in all twelve of them, while detDPP-MissForest provides a single deterministic imputation which outperforms the expected result from MissForest in all twelve datasets and from DPP-MissForest in eleven out of twelve times.

## Quantum hardware implementation of DPP-MissForest results in competitive downstream classification

As we describe in Methods, quantum computers can in principle be used to offer a computational advantage in determinantal sampling. In order to better understand the state-of-the-art of current quantum hardware, we used a currently available quantum computer to perform determinantal sampling within a DPP-MissForest imputation method for scaled-down versions of the synthetic and MIMIC datasets.

Reduced synthetic dataset: 100 points and 3 features, created using the sklearn method make classification.

Reduced MIMIC dataset: 200 points and 3 features. The three features were chosen from the original dataset features based on low degree of missingness and their predictiveness of the downstream classifier and they were: “Oxygen saturation std”, “Oxygen saturation mean” and “Diastolic blood pressure mean”.

For the purposes of our experiments, we used the “ibm hanoi” 27-qubit quantum processor shown in Figure 3. We implemented quantum circuits with up to 10 qubits. The decision trees of the DPP-Random Forests used by the imputation models are trained using batches of decreasing sizes (see Table IV). For example, for the algorithm with batch size equal to 10, the algorithm first samples two out of the ten data points to use for the first decision tree, then from the remaining eight datapoints it picks another two for the second tree, then two from the remaining six, and last two from the remaining four. In other words, we train four different trees, and each time we use a quantum circuit with number of qubits equal to 10, 8, 6, and 4, to perform the respective determinantal sampling.

In the figures of Table V and in Table VI we provide for the different dataset experiments the AUC for MissForest, the simulated results of the quantum version of DPP-MissForest, and the actual hardware experimental results of running the quantum version of DPP-MissForest. Even for these very small datasets, when simulating the quantum version of DPP-MissForest, we demonstrate an increase in the AUC compared to the MissForest algorithm. This further highlights the potential advantages of determinantal sampling within imputation methods. Of note, running our algorithms on current hardware introduces variance in the downstream classifier. Importantly, this variance is due to noise in the hardware rather than inherent to the algorithm.

Our quantum hardware results are competitive with standard methods and in many cases close to the values expected from the simulation. In some cases, we observed a clear deterioration of the AUC due to the noise and errors in the quantum hardware. The results are closer to the simulations when using MCAR missingness with larger batch sizes that use more trees both for synthetic and the MIMIC datasets. As explained above, even though the algorithm with batch size 10 means using a quantum circuit with 10 qubits, the fact that we use four trees overall with a decreasing number of datapoints each time, and thus a decreasing number of qubits (namely, 10, 8, 6, and 4), results in an overall more reliable imputation.

# Discussion

Missing data is a critical issue for machine learning practitioners as complete data sets are usually required for training machine learning algorithms. To achieve complete data sets, missing values are usually imputed. In the case of clinical data, missing values and imputation can be a potential source of bias and can considerably influence the robustness and interpretability of results. Nevertheless, there is no canonical way to deal with missing data which makes improvements in data imputation methods an attractive and impactful approach to increase the effectiveness and reliability of clinical trials.

Determinantal point processing methods increase the diversity of the data picked to train the models, showcasing also that data gathering and pre-processing are important to remove biases related to over-representation of particular data types. This is more important when dealing with unbalanced datasets, as is the case often with clinical data. Determinantal sampling is an important tool not only for Random Forest models, but also for linear regression, where data diversity results in more robust and fair models [18]. Moreover, such sampling methods based on determinantal point processes are computationally intensive and quantum computers are expected to be useful in this case: quantum computers offer an asymptotic speedup for performing this sampling and it is expected that next generation quantum computers will provide a speedup in practice.

We show that, as expected, the quantum version of detDPP-MissForest does not introduce any variance in the downstream classifier when simulated in the absence of hardware noise. However, when implemented on quantum hardware, we observed variance that is caused by the noise in the hardware itself. More precisely, the output of the quantum circuit is not a sample from the precise determinantal distribution but from a noisy version of it, and this noise depends on the particular quantum circuit implemented and the quality of the hardware. Thus when attempting to compute the highest probability element using samples from the quantum circuit on current hardware, the result is not deterministic. Importantly, unlike for standard MissForest, this variance is not inherent in the algorithm and is expected to reduce considerably with the advent of better quality quantum computers. The quantum circuits needed to efficiently perform determinantal sampling require a number of qubits equal to the batch size used for each decision tree within the Random Forest training and the depth of the quantum circuit is roughly proportional to the number of features. As an example, if we would like to perform the quantum version of the determinantal imputation methods we used for MIMIC-III, then we would need a quantum computer with 150 qubits (the batch size) that can be reliably used to perform a quantum circuit of depth around 400 (the depth is given by 4*d*log *n*, where *n* = 150 is the batch size and *d* = 14 is the number of features [12]). While quantum hardware with a few hundred qubits that can perform computations of a few hundred steps are not available right now, it seems quite possible that they will be available in the not so far future. In the meantime further optimization could also help reduce the quantum resources needed for such imputation methods.

In summary, here we propose novel data imputation methods that: first, improve the widely-used iterative imputation methods –MiceRanger and MissForest– as measured by the AUC of a downstream classifier; second, remove the variance of the imputation methods, thus ensuring reproducibility and simpler integration into machine learning workflows; third, become even more efficient when run on quantum computers. Based on our results, we anticipate an impact of our algorithms on the reliability of models in high precision value settings, including in pharmaceutical drug trials where they can provide higher confidence in the predictions made by eradicating the stochastic variance due to multiple imputations. In addition, tasks that are currently overwhelmed by the challenges of missingness become more tractable through the approaches introduced here, which is a common problem with real-world-evidence investigations, where detDPP-MICE and detDPP-MissForest can yield improved performance in the face of missingness.

# Methods

## Determinantal Point Processes (DPPs)

Given a set of items *y* = {*y*_{1}, …, *y*_{N}}, a point process 𝓟 is a probability distribution over all subsets of the set *Y*. It is called a Determinantal Point Process (DPP) if, for a subset Y drawn from *Y* according to 𝓟, we have:

where *K* is a real symmetric *N* × *N* matrix, and *K*_{T,T} is its submatrix whose rows and columns are indexed by *T*. The matrix *K* is called the marginal kernel of Y.

For an *n* × *d* data matrix *A* and *L* = *AA*^{T}, we define the L-ensemble DPP_{L}(**L**) as the distribution where the probability of sampling *T* is:

where *Vol({a _{i}* :

*i*∈

*T*}) is the volume spanned by the rows of

*A*indexed by

*T*.

According to this distribution, the probability of sampling points which are similar and form a smaller volume is thus reduced in favor of samples which are more diverse.

An L-ensemble is a Determinantal Point Process if **K = L(I + L)**^{_1}.

*Stochastic k-DPPs*. The distribution *k* — DPP_{L}(L) is defined as an L-ensemble which is constrained to subsets of size *|T|* = *k*.

Different algorithms have been proposed in the literature to sample from *k* — DPPs, namely [13] where sampling *d* rows from an *N* × *d* matrix takes *0*(*Nd*^{2}) time. There have been improvements over this initial proposal as in [19] where there is a preprocessing cost of *0*(*Nd*^{2}) and each DPP sample requires *0*(*d*^{3}) arithmetic operations.

*Deterministic k-DPPs*. Stochastic DPP sampling may be efficient in practice, however deterministic algorithms are important for different use cases since they are more interpretable, are less prone to errors and have no failure probability, which is especially relevant for clinical data [7].

We use a deterministic version of DPP sampling as proposed in [10] (see Algorithm 1) which is a greedy maximum volume approach. For each deterministic *k —* DPP sample, elements with the highest probability are added iteratively.

## DPP-Random Forest and detDPP-Random Forest

The Random Forest is a widely-used ensemble learning model for classification and regression problems. It trains a number of decision trees on different samples from the dataset, and the final prediction of the Random Forest is the average of the decision trees for regression tasks or the class predicted by the most decision trees for classification tasks.

The samples used to train each tree are drawn uniformly with replacement from the original dataset (bootstrapping).

The DPP-Random Forest algorithm (see Figure 4) replaces the uniform sampling with DPP sampling without replacement.

Determinantal sampling for regression and classification tasks with full data has been proposed previously for Linear Regressors [18] and for Random Forest training for a financial data classification use case where it outperformed the standard Random Forest model [26].

We can also use the deterministic version of DPP sampling for the Random Forest algorithm. This requires removing the sample used at each step (which is the one with the highest probability according to the determinantal distribution) in order to create a smaller dataset from which to sample for the next decision tree (see Figure 5). We call this new model detDPP-Random Forest.

Let us note that the distributions of the in-bag DPP samples, which are biased towards diversity, and the out-of-bag (OOB) samples, which reflect the original dataset’s distribution, may be different. This could lead to an inaccuratecalculation of the OOB error that can be in fact overestimated [9]. In the DPP-Random Forest case, the batches are stratified and according to the output variable that follows the same distribution as the original dataset. Thus, sampling from different batches could bridge the gap between the in-bag and the out-of-bag distributions. We leave these considerations for future work.

## Quantum methods for DPPs

Quantum Machine Learning has been a rapidly developing field and many applications have been explored, including with biomedical data, both using quantum algorithms to speedup linear algebraic procedures and through quantum neural networks [1, 3, 4, 15].

In [12], it was shown that there exist quantum algorithms for performing the determinantal sampling with better computational complexity than the best known classical methods. We describe below the quantum circuits that are needed for performing this quantum algorithm on quantum hardware with different connectivity characteristics and provide a resource analysis for the number of qubits, the number of gates and the depth of the quantum circuit.

First, we introduce an important component of the quantum DPP circuit which is the Clifford loader. Given an input state x ∈ R^{n}, it performs the following operation:

, in other words it encodes the vector x as a sum of the mutually anti-commuting operators generating the Clifford algebra.

For implementing this operation with an efficient quantum circuit, we use standard one- and two-qubit gates, such as the X, Z, CZ gates as well as a parameterized two-qubit gate called the Reconfigurable Beam Splitter gate (RBS), which do the following operations:

We provide in Fig. 6 three different versions of the Clifford loader that take advantage of the specific connectivity of the quantum hardware, for example grid connectivity for superconducting qubits or all-to-all connectivity for trapped-ion qubits. These constructions are optimal (up to constant factor) on the number of two-qubit gates. We provide the exact resource analysis in Table VII.

We can now use the Clifford loaders described above to perform *k — DPP* sampling, as described [12].

Given an orthogonal matrix *A* = (*a*^{1},…, *a*), we can apply the qDPP circuit shown in Fig. 7, which is just a sequential application of *d* Clifford loaders, one for each column of the matrix, to the |0^{n}) state, and that leads to the following result:

Directly measuring at the end of the circuit provides a sample from the correct determinantal distribution.

Quantum versions of the imputation methods It is easy to define now a quantum version of the DPP-MICE and DPP-MissForest algorithms, where we use the quantum circuit described above to sample from the corresponding DPP. We can also define a variant of the deterministic algorithms, though here we need to pay attention to the fact that the quantum circuit enables to sample from the determinantal distribution but does not efficiently give us a classical description of the entire distribution. Hence one can instead sample many times from the quantum circuit and output the most frequent element. This provides a sample with less variance but it only becomes deterministic in the limit of infinite measurements.

# References

- [1]Quantum machine learning
*Nature***549**:195–202 - [2]Development of a prognostic model for mortality in covid-19 infection using machine learning
*Modern Pathology***34**:522–531 - [3]Challenges and opportunities in quantum machine learning
*Nature Computational Science***2**:567–576 - [4]Quantum vision transformers
- [5]Determinantal point processes in randomized numerical linear algebra
*Notices of the American Mathematical Society***68**:34–45 - [6]Determinantal point processes in randomized numerical linear algebra
*Notices of the American Mathematical Society***68**:34–45 - [7]Interpretability in healthcare a comparative study of local machine learning interpretability techniques:275–280
- [8]A survey on missing data in machine learning
*Journal of Big Data***8** - [9]On the overestimation of random forest’s out-of-bag error
*PLOS ONE***13**:1–31 - [10]Towards deterministic diverse subset sampling
*Artificial Intelligence and Machine Learning*:137–151 - [11]Mimic-iii, a freely accessible critical care database
*Scientific Data***3** - [12]Quantum machine learning with subspace states
*arXiv:2202.00054* - [13]Determinantal point processes for machine learning
*Foundations and Trends® in Machine Learning***5**:123–286 - [14]k-dpps: fixed-size determinantal point processes
- [15]Quantum Methods for Neural Networks and Application to Medical Image Classification
*Quantum***6** - [16]Evaluating the state of the art in missing data imputation for clinical data
*Briefings in Bioinformatics***23** - [17]Miwae: Deep generative modelling and imputation of incomplete data sets
- [18]Leveraged volume sampling for linear regression
- [19]Minimax experimental design: Bridging the gap between statistical and worst-case approaches to least squares regression:1050–1069
- [20]Handling missing data in clinical trials: An overview
*Drug Information Journal***34**:525–533 - [21]Missing data and multiple imputation in clinical epidemiological research
*Clinical Epidemiology***9**:157–166 - [22]A machine learning methodology for diagnosing chronic kidney disease
*IEEE Access***8**:20991–21002 - [23]Machine learning with the tcga-hnsc dataset: improving usability by addressing inconsistency, sparsity, and high-dimensionality
*BMC bioinformatics***20**:1–9 - [24]Classification of datasets with imputed missing values: Does imputation quality matter?
*arXiv:2206.08478* - [25]MissForest—non-parametric missing value imputation for mixed-type data
*Bioinformatics***28**:112–118 - [26]Quantum machine learning for predictive analytics in finance
*under submission* - [27]mice: Multivariate imputation by chained equations in r
*Journal of Statistical Software***45**:1–67 - [28]Predicting age by mining electronic medical records with deep learning characterizes differences between chronological and physiological age
*Journal of biomedical informatics***76**:59–68 - [29]Gain: Missing data imputation using generative adversarial nets