PROMISSING: P RUNING M ISSING V ALUES IN N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
While data are the primary fuel for machine learning models, they often suffer from missing values, especially when collected in real-world scenarios.
However, many off-the-shelf machine learning models, including artiﬁcial neural network models, are unable to handle these missing values directly.
Therefore, extra data preprocessing and curation steps, such as data imputation, are inevitable before learning and prediction processes.
In this study, we propose a simple and intuitive yet effective method for pruning missing values (PROMISSING) during learning and inference steps in neural networks.
In this method, there is no need to remove or impute the missing values; instead, the missing values are treated as a new source of information (representing what we do not know).
Our experiments on simulated data, several classiﬁcation and regression benchmarks, and a multi-modal clinical dataset show that PROMISSING results in similar prediction performance compared to various imputation techniques.
In addition, our experiments show models trained using PROMISSING techniques are becoming less decisive in their predictions when facing incomplete samples with many unknowns.
This ﬁnding hopefully advances machine learning models from being pure predicting machines to more realistic thinkers that can also say “I do not know” when facing incomplete sources of information.
I NTRODUCTION
Missing and incomplete data are abundant in real-world problems; however, the learning and inference procedures in machine learning (ML) models highly rely on high-quality and complete data.
Therefore, it is necessary to develop new methods to deal with data imperfections in rugged environments.
Currently, the most popular way to deal with imperfect data is to impute the missing values.
However, if we consider the learning and inference procedures in our brain as a role model for ML algorithms, data imputation barely follows the natural principles of incomplete data processing in our brain.
This is because the imputation is generally based on using a heuristic for replacing missing values.
Our brain does not impute incomplete sensory information but instead uses its incompleteness as a separate source of information for decision making.
For example, by only hearing the rain we can estimate how hard it is raining, and we do not necessarily need to receive visual information.
Instead, we direct our attention more toward our auditory inputs to decide whether to go out with an umbrella.
In addition, the more we miss sensory information, the more cautious we get in decision-making.
That is why we are more careful in darker environments.
Neural networks (NNs) are brain-inspired algorithms that are very popular these days (under the name of deep learning) for learning complex relationships between inputs and target variables.
However, they are in principle unable to handle incomplete data with missing values.
They mainly rely on matrix operations which cannot operate on not-a-number (NaN) values.
Only one NaN in a dataset impairs the forward propagation in a network.
There are three solutions to this problem (Garc´ıaLaencina et al., 2010): i) removing samples or features with missing values, ii) imputing the missing values, and iii) modeling the incomplete data.
Removing the samples with missing values can be very costly, especially in small-sample size and high-dimensional datasets.
For example, data collection in clinical applications is an expensive procedure in terms of time, ﬁnance, and patient burden.
Moreover, removing even a few samples from small datasets can affect negatively the generalization performance of the ﬁnal model.
Removing informative features with missing values is also compensated with lower model performance.
Therefore, ﬁlling the information gaps is inevitable.
There are various techniques for data imputation, ranging from simply imputing missing values with a constant to more sophisticated ML-based imputation approaches (Little & Rubin, 2019; Garc´ıaLaencina et al., 2010).
One can categorize the most common techniques into three main categories: i) constant imputation, ii) regression-based imputation, and iii) ML-based imputation.
In constant imputation, the missing values are replaced with a constant, e.g. , zeros or mean/median of features.
It has been shown that constant imputation is Bayes consistent when the missing features are not informative (Josse et al., 2019).
In the regression-based imputation, a linear or non-linear regression model is derived to predict the missing values.
This method can be used to impute a single or multiple features.
The most popular regression-based imputation is Multiple Imputation by Chained Equations (MICE) (Van Buuren & Groothuis-Oudshoorn, 2011; Azur et al., 2011).
In MICE, an iterative procedure of predicting missing values and re-training regressors with updated predictions is performed for a limited number of cycles.
The central assumption behind the MICE approach is that the missing values are missed at random (see Rubin (1976) and Appendix A.1 for deﬁnitions of missing value mechanisms including missing completely at random (MCAR), missing at random (MAR), and missing not at random (MNAR)).
Applying MICE can result in biased estimations if this assumption is not satisﬁed (Azur et al., 2011).
Another critical limitation of regression-based imputation is its high computational complexity (Caiafa et al., 2021).
If we do not know which feature will be missed at the test time, for d features, we need to train d different regression models.
In the ML-based approach ML algorithms, such as a K-nearest neighbor (KNN), regularized linear model (Jiang et al., 2021), decision trees (Twala et al., 2008), random forest (Xia et al., 2017), neural network (Bengio & Gingras, 1996), or generative model (Yoon et al., 2018;
Ipsen et al., 2020; Collier et al., 2020; Nazabal et al., 2020), are used for handling missing data.
As an alternative solution to data imputation, one can use the elegance of probabilistic modeling to model the incomplete data under certain assumptions.
One seminal work in this direction is presented by Ghahramani & Jordan (1994), where a Gaussian Mixture Model (GMM) is used to estimate the joint density function on incomplete data using an Expectation-Maximization (EM) algorithm.
This approach is later adopted and extended to logistic regression (Williams et al., 2005),
Gaussian processes, support vector machines (Smola et al., 2005), and multi-class non-linear classiﬁcation (Liao et al., 2007).
However, despite their good performance on small-size datasets, their application remained limited on big and high-dimensional data due to the high computational complexity (Caiafa et al., 2021).
To overcome this issue, Caiafa et al.
(2021) proposed a sparse dictionary learning algorithm that is trained end-to-end, and simultaneously learns the parameters of the classiﬁer and sparse dictionary representation.
Le Morvan et al.
(2020) proposed NeuMiss, a neural-network architecture that uses a differentiable imputation procedure in a impute-then-regress scheme (Morvan et al., 2021).
A notable feature of NeuMiss is its robustness to MNAR data.
Inverse probability weighted estimation (Wooldridge, 2007; Seaman & White, 2013) is another probabilistic approach for handling missing values without imputation in which the weights for samples with many missing values are inﬂated based on an estimation of the sampling probability.
Recently, Smieja et al.
(2018) proposed a modiﬁed neuron structure that uses GMM with a diagonal covariance matrix (assuming MAR) to estimate the density of missing data.
GMM parameters are learned with other network parameters.
Conveniently, it handles missing values in the ﬁrst layer of the network, and the rest of the architecture remains unchanged.
Elsewhere, Nowicki et al.
(2016) proposed a new neural network architecture based on rough set theory (Pawlak, 1998) for learning from imperfect data.
It is fascinating that this method can say “I do not know” when a large portion of input values are missing, unlike traditional models trained on imputed data that may predict deﬁnite outcomes even on completely unmeasured samples, i.e. , they run in the absolute darkness. These predictions can be dangerous with catastrophic consequences in more delicate applications of ML for example in autonomous driving, robotic surgery, or clinical decision-making.
In this work, we attack the problem of modeling incomplete data using artiﬁcial neural networks without data imputation.
We propose a simple technique for pruning missing values (PROMISSING) in which the effect of missing values on the activation of a neuron is neutralized.
In this strategy, a missing value is not replaced by arbitrary values ( e.g., through imputation); it is naturally considered a missing piece of the puzzle; we learn a problem-speciﬁc numerical representation for unknowns .
The key feature of PROMISSING is its simplicity; it is plug-and-play; it deals with missing values in the ﬁrst layer of the network without the need to change anything in the rest of the network architecture or optimization process.
PROMISSING in its original form does not add extra parameters to the network, and its computational overhead remains negligible.
Our experiments on simulated data and several classiﬁcation/regression problems show that the proposed pruning method does not negatively affect the model accuracy and provides competitive results compared to several data imputation techniques.
In a clinical application, making prognostic predictions for patients with a psychotic disorder, we present an application of PROMISSING on a multi-modal clinical dataset.
We demonstrate how the NN model trained using PROMISSING becomes indecisive when facing many unknowns.
This is a crucial feature for developing trustworthy prediction models in clinical applications. Furthermore, we show a side application of PROMISSING for counterfactual interpretation (Mothilal et al., 2020) of NNs decisions that can be valuable in clinics.
M ETHODS
Let x ∈ R p represent a vector of an input sample with p features.
We assume that the features in x are divided into two sets of q observed x o ∈ R q and r missing features x m (where p = q + r ).
In this study, we do not put any assumption on the pattern of missing values in x .
Then, the activation of the k th ( k ∈ { 1 , 2 , . .
. , s } ) neuron in the ﬁrst hidden layer of an ordinary NN is:
[Equation]
This activation cannot be computed unless the values in x m are imputed with real numbers.
Here, in PROMISSING, we propose to alternatively replace the missing values with a neutralizer that 1) prunes the missing values from inputs of a neuron, 2) neutralizes the effect of missing values on the neuron’s activation by cancelling the second term in Eq.
and modifying the neuron’s bias. A missing value x j ∈ x m is replaced with its corresponding neutralizer u ( k ) j at the k th neuron, where:
[Equation]
The value of a neutralizer depends on its corresponding weight ( w ( k ) j ), the bias of the corresponding neuron ( b ( k ) ), and the number of features ( p ); thus, it can be computed on the ﬂy during the training or inference procedures.
A small value is added to weights before computing neutralizers to avoid division by zero.
Inserting the neutralizer into Eq. 1, the activation of the k th neuron is rewritten as:
[Equation]
in which the effect of weights of missing values on the activation of the neuron is eliminated, and the neuron’s bias is reduced by a factor of r/p .
If all input values for a speciﬁc sample are missing then the neuron is completely neutralized. Proposition 1 If all input values are missing ( q = 0 and x o = ∅ ) then the activation of a PROMISSING neuron is zero (see Appendix A.2.2 for the proof). Proposition 2 If there are no missing values in inputs ( q = p and x m = ∅ ) then the activation of a
PROMISSING neuron is equal to a normal neuron (see Appendix A.2.3 for the proof).. We should emphasize that, when using PROMISSING, the user does not need to apply any change to the input vectors, and the missing values (generally represented as nan s in the input matrix) are fed directly to the network.
After the training procedure, we eventually learn U ∈ R s × p , a matrix representation for unknowns (or metaphorically the dark matter):
[Equation]
where b ∗ and w ∗ are representing the ﬁnal learned bias and weight.
At the prediction stage, a missing value at j th input feature will be replaced with its corresponding neutralizer from U .
It is worth emphasizing that the missing values are replaced with different neutralizers at different neurons; therefore, it cannot be considered a constant imputation.
In fact, each neuron perceives differently a missing value in the input space.
Metaphorically, the neurons can be seen as blind men in the parable of “the blind men and an elephant” 1 when facing unknowns.
Furthermore, it is different from regression-based imputation and model-based approaches in the sense that a missing value in a speciﬁc feature is not inferred from other observed features, or the distribution of observed values; i.e. , unknowns remain unknowns.
In PROMISSING, we do not assume any certain missing value mechanism ( e.g. , MAR) in advance.
Instead, we try to learn the patterns of missing values from data that maybe advantageous in more difﬁcult scenarios such as MNAR (see results in Sec. 3.1).
One possible drawback of using PROMISSING is in high-dimensional input spaces and when the number of missing values is large, i.e. , when p → ∞ and r (cid:29) q .
In this case, the neuron will undershoot; hence the effect of few non-missing values are ignored.
2 To address this problem, we propose a modiﬁed version of PROMISSING (mPROMISSING) in which the effect of large r can be compensated with a compensatory weight, w c .
The compensatory weight receives a ﬁxed input of r/p for a speciﬁc sample; thus, the activation of the neuron will change to:
[Equation]
w ( k ) c is learned alongside the rest of the network parameters in the optimization process.
On training data with few missing values, data augmentation ( e.g. , by simulating different patterns and size of missing values) is advisable to ensure the sensibility of the learned compensatory weight.
Since the input for this weight ( r/p ) is computed at the run time, no modiﬁcation to input vectors is required.
Proposition 3 If there are no missing values ( q = p , r = 0 , and x m = ∅ ) then the activation of an mPROMISSING neuron is equal to a normal neuron (see Appendix A.2.4 for the proof).
The proposed PROMISSING approach is straightforward to implement and use.
It can be incorporated into the current implementations of different types of NN layers by adding/modifying few lines of code.
We have implemented a nanDense layer, inheriting from Keras (Chollet et al., 2015)
Dense layer, using PROMISSING and mPROMISSING neurons (see appendix A.3).
The nanDense layer can be directly imported and used with any Keras model.
In its general usage, the nanDense layer is only used for the ﬁrst layer of an NN to handle missing values in inputs, unless we expect some missing values in the intermediate layers.
E XPERIMENTS AND R ESULTS
In a set of three experiments, 1) in a simulation study, we investigate the convergence behaviors of (m)PROMISSING on MCAR, MAR, and MNAR data; 2) in a large experiment on real data, we benchmark the reliability of (m)PROMISSING in several classiﬁcation and regression tasks, and 3) on a multi-modal clinical dataset, we demonstrate an application of PROMISSING on an open problem of psychosis prognosis prediction.
3. S IMULATED D ATA
We conducted a simple analysis of synthesized data to better understand the behaviors of PROMISSING.
For data simulation, we simulated the XOR problem with 1000 samples.
Gaussian noise with a variance of 0.25 is added to data.
We simulated the missing data for MCAR, MAR, and MNAR settings. The same procedures as in Schelter et al.
(2021) are used to simulate the MCAR, MAR, and MNAR missing values (see Appendix A.4 for details). The experiments are repeated for 30% and 50% missing samples.
We used scikit-learn (Pedregosa et al., 2011) for implementing different data imputation schemes.
3 We also compared our method with a GAN-based imputation proposed in Yoon et al.
Default conﬁgurations are used for all imputers. To evaluate (m)PROMISSING, we used a simple fully connected NN architecture with four tangenthyperbolic neurons in the hidden layer and a single sigmoid neuron in the output layer.
This simple architecture can reach the performance of the Bayes optimal classiﬁer (AUC= 0 .
99 ± 0 . 01 ) on simulated data without missing values (see the black lines in Fig. 1).
We randomly divided the simulated data into training and test sets with 500 samples in each set.
The pipeline of 1) data simulation, 2) random data corruption with missing values, 3) randomly splitting data into the training and test set, and 4) training the model is repeated 100 times, and the standard deviation of performances across repetitions is reported (shadowed areas in Fig. 1).
We have ﬁxed the random number generator seed in each repetition (randomly selected from [0 , 100000] ) to ensure a fair comparison between models.
A stochastic gradient descent (SGD) optimizer is used to minimize a binary cross-entropy loss function.
We evaluated the network performance as the training procedure proceeds in two different settings i) on the complete test set without missing data, and ii) on the test set with missing values.
The ﬁrst row of plots in Fig.
1 shows the area under the ROC curve (AUC) for models trained on data with 50% missing values (see Fig. 7 for 30% ) and tested on test sets without missing values as the number of epochs progresses.
Here, by comparing the performance gap between the different missing data curation strategies and the optimal Bayes classiﬁer, we can evaluate the training bias imposed by each strategy during the training. A lower training bias indicates a lower effect of data curation strategy on the quality of the trained model.
Our empirical results show that the training bias is modulated by both the strategy and missing data mechanism.
In the MCAR setting, all strategies show less training bias. However, in the MAR and MNAR conditions, the model biases are more pronounced, especially with higher percentages of missing values. The (m)PROMISSING techniques show a competitive performance, especially in the MNAR setting where they perform equivalently with mean, KNN, and MICE imputers (with Wilcoxon rank-sum test p-values of 0.26, 0.02, and 0.15) and better performance than zero and GAIN imputations (p-values ≤ 3 × 10 − 12 ). These results conﬁrm that the (m)PROMISSING models provide the possibility to learn meaningful representations for the unknowns that are at least as informative as imputed data.
The second row of plots in Fig.
1 compares the learning curves of models when tested on the test set with missing values.
By comparing the ﬁnal performance of models in the ﬁrst and second row, we immediately notice the performance drops across almost all strategies. These performance drops show the negative effect of data degradation imposed by each imputation method on the generalization of models when applied to data with missing values. Thus, we refer to this difference as test bias .
While all methods show similar test bias in the MCAR and MAR scenarios, the (m)PROMISSING models show a negligible test bias in the MNAR scenario, i.e. , the performance of (m)PROMISSING models is not affected when they are applied to test data with MNAR missing values. Furthermore, m(PROMISSING) methods show signiﬁcantly better performance on MNAR test data (p-values ≤ 6 × 10 − 6 ). The small training and test biases of the (m)PROMISSING models in the MNAR setting conﬁrm their effectiveness in jointly modeling the data and missing patterns.
We have further analyzed the patterns of neutralizers in U to interpret the learned representations of unknowns in PROMISSING (see Fig. 8 in appendix A.5).
Since U is derived from the network parameters, due to the stochastic nature of parameter initialization and optimization, it may end up with different values in each repetition.
Our visual inspection shows that each neuron learns a different solution for unknowns, ranging from a simple zero or mean imputer to more complex patterns.
This is a unique feature for PROMISSING providing the possibility to learn a neuronspeciﬁc imputation strategy from data.
[Figure]
[Figure]
In the second set of experiments, we benchmarked (m)PROMISSING alongside several imputation techniques on a range of publicly available classiﬁcation and regression datasets from
OpenML (Vanschoren et al., 2014).
We used the same classiﬁcation and regression datasets as in J¨ager et al.
(2021) (see Table 2 and Table 3 in appendix A.6).
Here, we use a simple fullyconnected architecture with two hidden layers, with p/ 2 ReLU neurons in the ﬁrst and two neurons in the second hidden layer, so the architecture changes slightly from one dataset to another depending on the number of features.
A single output neuron with a sigmoid or linear transfer function is used for output layers in classiﬁers or regressors, respectively.
Our quick experiments on benchmark datasets show that this simple architecture provides competitive results with random forest classiﬁers and regressors (see Fig 10 in appendix A.6).
We excluded three classiﬁcation and three regression datasets from our analyses due to the poor performance of baseline models on the complete data (see appendix A.6).
We used MCAR, MAR, and MNAR schemes to simulate different ratios (0.1, 0.25, 0.5, 0.9) of samples with missing values across datasets. The same procedures as in Schelter et al. (2021) are used to simulate the MAR and MNAR missing values.
In the MNAR setting, a random percentile of the most informative feature (based on the mutual information with the target variable) is removed.
In the MAR case, values in the most informative feature are removed based on a random percentile of the second most informative feature (see Appendix A.4 for more details).
An SGD optimizer for 100 epochs with a mini-batch size of 10 samples is used in the training process to minimize a binary cross-entropy or a mean squared error (MSE) loss in the classiﬁcation or regression scenario.
The performances of different methods are evaluated in a 2-fold cross-validation scheme computing the AUC and standardized MSE (SMSE) metrics.
The whole experiment pipeline, including 1) simulating missing values, 2) data imputation (this step does not apply to (m)PROMISSING), 3) data standardization, 4) model training and evaluation, is repeated twenty times with a ﬁxed random number generator seed in each repetition.
When imputing data, the default imputer settings are applied.
We have also included the histogram-based gradient boosting (HGB) (Ke et al., 2017) –that similar to (m)PROMISSING provides a mechanism to directly deal with missing values without imputation– in our experiments.
Fig.
2 compares the performance of different data imputation methods with (m)PROMISSING in classiﬁcation tasks for various missing value mechanisms and missing sample ratios (x-axes).
The AUC drops with respect to the full model (trained and tested on complete data) are plotted.
To summarize the results across datasets and replication runs, we ﬁrst compute the median performance across datasets and then average across twenty replications. While in all settings the HGB is the best performer, the (m)PROMISSING shows competitive performance with the better performing imputers.
A similar overall pattern can be observed when comparing the increase in the SMSE in regression tasks (see Fig.
11 in appendix A.6).
In summary, these results show that (m)PROMISSING can compete with data imputation approaches without the need for ﬁlling the unknowns, thus it is more ﬂexible with underlying missing data mechanisms and all input data types including continuous, binary, and categorical.
3. C LINICAL A PPLICATION : P SYCHOSIS P ROGNOSIS P REDICTION
Missing data are seemingly ubiquitous in the healthcare domain.
In general, clinical datasets contain multi-modal data that are collected through different measurement tools, including patient questionnaires, medical reports and instruments, biological tests [Figure] and imaging data.
Each modality may represent a different aspect of a disease or treatment outcome.
Therefore, employing smart modality fusion techniques is inevitable to best beneﬁt from these rich data.
However, this goal is occluded because these data are collected through different sources and often include missing variables or even missing modalities.
In this section [Figure] we demonstrate an application of PROMISSING in multi-modal data fusion and counterfactual model interpretation for psychosis prognosis prediction (PPP) [Figure]
3.3. OPT I M I SE D ATASET
[Table] [Figure] [Table]
[Figure] We used the OPTiMiSE dataset (Kahn et al., 2018), an antipsychotic threephase switching study: 495 patients with schizophrenia, schizophreniform, or schizoaffective disorder according to DSM-IV diagnosis standards.
The patients received different medications in a three-phase study design.
We used the data from the ﬁrst phase of the study in which the patients were treated with amisulpride for four weeks.
Onlypatients who ﬁnished the ﬁrst phase are used in our experiments.
In a PPP framework, we aimed to predict the probability of patients’ symptomatic remission based on the Positive and Negative
Syndrome Scale (PANSS) as deﬁned by consensus criteria (Andreasen et al., 2005).
We useddifferent data modalities in our experiments (see Table 1).
In total, 13% values in the dataset are missing.
These missing values include complete or partial missed modalities.
The missing values are scattered across patients and measures; somehow, if we remove all subjects with missing values only 17 patients are left.
This observation substantiates, even more, the importance of missing data management in clinical datasets.
We have applied a minimal preprocessing pipeline on the data before the modeling stage.
The input data contains binary, categorical, and continuous variables.
We used 0/1 and one-hot encoding for binary and categorical variables, respectively.
All continuous variables are standardized before feeding them to the model.
Considering the unbalanced class distributions ( 67% of patients get remitted), in each fold of K-fold cross-validation, we resampled the minority class samples in the training data to match its size to the majority class. [Figure] [Figure]
[Figure]
Inspired by Huang et al.
(2020), we used a multi-modal NN architecture with middle and late information fusion.
As depicted in Fig.
3, our model has ﬁve layers: input, representation learning, modality-speciﬁc classiﬁcation, fusion, and classiﬁcation.
The network receives the data from M different modalities in the input layer.
Since input samples may contain missing values, we use nanDense layers right after the input layer in the representation learning phase.
These layers transfer the raw inputs to an intermediate representations.
We roughly (without any optimization and solely based on input feature size) ﬁxed the number of neurons in this layer for each modality (Demographics=10, Diagnosis=10, Lifestyle=5, Somatic=5, Treatment=2, MINI=10, Cytokines=10, PANSS=10, PSP=5, CGI=2, CDSS=5, SWN=5).
In the modality-speciﬁc classiﬁcation layer, we use 2 Softmax neurons to classify the modality-speciﬁc representations into target classes, i.e. , whether a patient remits given a certain amount of medication after four weeks.
These decisions are merged with middle representation and then fed to the fusion layer.
A trivial ReLU Dense layer with ﬁve neurons is used for the fusion layer.
Finally, two Softmax neurons are used to classify the fused data into target classes.
Dropout layers with a probability of 0 .
1 are applied before any weighted layer.
An Adam (Kingma & Ba 2014) optimizer (with learning rate of 0 . 0003 ) is used to minimize the
3.3. E VALUATION AND C OMPARISON
We ﬁrst compared (m)PROMISSING with two alternative strategies: i) removing features with missing values and ii) data imputation.
In the ﬁrst case, we ﬁrst removed subjects that completely missed one data modality; then, we removed features containing missing values.
This procedure ended up losing 67 subjects and 78% of features including two modalities.
In the second case, we used a KNN to impute the missing data.
Note that, due to binary and categorical features, many imputation techniques (such as mean and iterative imputer) cannot be directly applied to our data.
Even in the KNN case, we needed to set the number of neighbors equal to one to avoid ﬂoat numbers for the categorical features.
A 10-fold cross-validation scheme is employed for model evaluations, and all the experiments are repeated ten times to evaluate the variability in performances.
The results support our conclusion in Sec.
3.2 that (m)PROMISSING performs as well as data imputation.
PROMISSING and mPROMISSING result in AUCs of 0 .
67 ± 0 .
02 and 0 .
66 ± 0 .
02 that are on a par with the KNN imputer 0 .
66 ± 0 .
However, as is expected, removing missing features resulted in an impaired model performance of 0 .
61 ± 0 .
The similar performance of (m)PROMISSING and data imputation despite their completely different strategies to deal with missing values raises two questions: “Do the resulting models behave similarly too?”
, “If not, how are they different?”.
Craving to answer these questions, we set up the second set of experiments on the OPTiMiSe data.
In the next experiment, we left all the 17 patients with complete data in the test set and used the other 359 patients (with missing data) for training.
Here, to fully use the capabilities of (m)PROMISSING models, we have augmented the training data by removing different subsets of modalities from data.
Having M = 12 modalities and n = 470 samples (after balancing the training data) in the training set, this procedure resulted in 1 , 919 , 010 samples ( (cid:80) M − 1 m =0 (cid:0) Mm (cid:1) × n ).
We trained three models, one using KNN imputation and two using (m)PROMISSING.
Then, we have used a particular procedure for testing these models on the test set.
In 100 repetitions, we have removed the modalities one by one and in random order.
Fig.
4 shows the trajectories of predictions for 17 test subjects across three models.
The trajectories show the predicted probability of remission when the model has access to less information about the patients (from complete information on the left to no information on the right).
Note that it is impossible to remove all modalities in the KNN imputation case because it impairs the imputation mechanism.
The interesting observation is the difference between the prediction behavior of models when they have less information available.
The model trained and tested on imputed data always reacts to inputs even in an unknown environment.
While the predictions of m(PROMISSING) models monotonically converge to 0.5, i.e. , the models become indecisive in an unknown environment.
As expected, the predictions of the PROMISSING model are slightly below the chance when the number of missing values increases, but this divergence is corrected in mPROMISSING.
This feature is crucial in delicate applications of ML in the medical domain in which the decisions made by machines can signiﬁcantly affect the quality of life of patients.
One possible application of PROMISSING is in counterfactual interpretation (CI) (Mothilal et al., 2020) of model decisions.
CI is an effective method for the causal interpretation of complex models such as NNs.
PROMISSING facilitates the usage of CI; we can simply use artiﬁcially inserted missing values to create the counterfactual examples.
In other words, to evaluate the effect of one variable or modality on the ﬁnal prediction, we assume it is missing in a counterfactual scenario.
To demonstrate this feature, we used this technique on the predictions of an mPROMISSING model.
The ﬁrst and second row of Fig. 5 show respectively the CI results for four example patients with correct and incorrect predictions on their remission.
In the ﬁrst case (Fig. 5a), the model correctly predicts no-remission, and CI shows that the demographic features are the decisive factor by reducing the probability of remission by ∼ 0 .
Similar inference can be used to explain the false decisions.
For example, PANSS and MINI measures are decisive factors in wrong model predictions in Fig.
5c and 5d, respectively.
This extra level of model explainability at the individual patient level is valuable in the clinical settings as it answers the “Why?”
question often asked by the clinicians about decisions of black box models, and hopefully, paves the way towards the new ﬁeld of precision psychiatry (Fernandes et al., 2017).
S UMMARY AND C ONCLUSIONS
In this work, we presented PROMISSING, a promising and novel second thought on dealing with missing data in neural networks.
Unlike previous works, we do not intend to replace missing values based on their relation to other features or the joint distribution of observed data.
Instead, we opt to use the unknowns as an additional source of information by learning a representation for missing data.
The learned representation is used to prune missing values by neutralizing their effect on the neurons’ activation.
The proposed method is convenient, intuitive, and reliable.
It is convenient because it is straightforward in implementation and application; there is no need for extra data preparation, and the missing values are directly fed to the model; and unlike some data imputation methods, it is ﬂexible with all input data types including continuous, binary, and categorical. This feature makes PROMISSING irreplaceable in applications of neural networks on multi-modal datasets with a mixture of diverse features.
It is intuitive because it reacts to unknowns like a living agent; the more the unknowns, the less the actions.
Moreover, it is reliable since it performs as well as its alternatives while its decisions are calibrated with the amount of information it receives.
Furthermore, it provides an embedded mechanism to explain the decisions of complex neural networks models which is favorable for more reliable applications of ML in clinical decision making.
Therefore, we consider PROMISSING as one step ahead towards more naturalistic ML-based decision-making in uncertain environments.
Despite our extensive experiments, some analytical and empirical aspects of PROMISSING remain unexplored.
Exploring the connection between modeling unknowns and model uncertainty, empirical comparison with model-based incomplete data modeling, and applications on more complex and structured data are among the unexplored avenues that we consider as future work.
R EPRODUCIBILITY S TATEMENT
To ensure the reproducibility of conclusions of this work, we have made the core implementation of the proposed method available in appendix A.3.
The nanDense layer can be directly imported and tested by the readers.
Furthermore, anonymized scripts and codes to reproduce the results for experiments on simulated data and OpenML datasets are included in the supplementary materials.
Meanwhile, in case needed, we are open to sharing scripts of the experiments on clinical data with reviewers during the discussion process (the data is not available publicly).
In our largest validation experiments in Sec. 3.2, we have used 52 publicly available ML datasets from OpenML.
We tried our best to be very speciﬁc, descriptive, and precise about the applied parameter settings, model speciﬁcations, and model evaluations in Sec. 3.
We plan to release all the codes and scripts in
Github upon acceptance of the manuscript.
A A PPENDIX A. M ISSING D ATA M ECHANISMS
Let X ∈ R n × p represent the data matrix of n samples with p features. Each sample x ∈ X then can be decomposed into observed x o and missing x m components where the pattern of the missing values can be indicated by a mask vector m ∈ { 0 , 1 } p . Using these notation, the underlying mechanisms for missing values in data can be divided into three categories (Rubin, 1976; Ghahramani &
Jordan, 1995; Schafer & Graham, 2002):
Missing Completely at Random (MCAR): where there is no systematic relationship between the patterns of missingness with either observed or unobserved variables,
i
e. , p ( m | x o , x m ) = p ( m ) .
In this case the missingness patterns are completely at random and do not depend on observed or missing data.
Missing at Random (MAR): is a weaker assumption than MCAR (MCAR data is MAR but not vice-versa), in which the patterns of missingness are independent from missing data but may depend on observed values,
i
e. , p ( m | x o , x m ) = p ( m | x o ) .
Missing Not at Random (MNAR): where the pattern of missingness depends on the values of missing data,
i e. , p ( m | x o , x m ) depends on the values in x . An example of MNAR is censored data in which a certain range of data is missing. A. A CTIVATION OF ( M )PROMISSING N EURONS A.2. D ERIVATION OF E Q .
Eq.
3 can be derived by inserting Eq.
2 in Eq.
1 for missing inputs x j ∈ x m : a ( k ) =
(cid:88) x i ∈ x
o x i w ( k ) i + (cid:88) x
j ∈ x m x j w ( k ) j
+ b ( k ) x
j = − b ( k ) pw ( k )
j −−−−−−→ a ( k ) =
(cid:88) x i ∈ x
o x i w ( k ) i + (cid:88) x
j ∈ x m − b ( k ) w ( k ) j pw ( k ) j + b ( k ) =
(cid:88) x i ∈ x
o x i w ( k ) i + − rb ( k )
+ pb ( k ) p = (cid:88)
x i ∈ x
o x i w ( k ) i
+ ( p − r ) b ( k ) p
=
(cid:88)
x i ∈ x
o x i w ( k ) i + qb ( k ) p .
A.2. P ROOF OF P ROPOSITION
When all input values are missing ( x o = ∅ , q = 0 , and r = p ), then the activation of a PROMISSING neuron is zero: a
[Equation]
x
[Equation]
o x
[Equation]
[Equation]
+
[Equation]
x
[Equation]
x m x
[Equation]
w ( k )
[Equation]
+ b ( k ) x
j = −
[Equation]
( k ) pw ( k ) j −−−−−−→ x o = ∅ a ( k ) = (cid:88)
x
j ∈ x m − b ( k ) w ( k ) j pw ( k ) j
+ b ( k ) =
− rb ( k ) p + b ( k ) r = p −−→ a ( k ) =0 .
A.2. P ROOF OF P ROPOSITION
When there are no missing values in inputs ( x m = ∅ , q = p , and r = 0 ), then the activation of a normal neuron (Eq. 1) is computed as follows:
[Equation]
In this case, the activation of a PROMISSING neuron is exactly equal to an ordinary neuron:
[Equation]
A.2. P ROOF OF P ROPOSITION
When there are no missing values in inputs ( x m = ∅ , q = p , and r = 0 ), the activation of an mPROMISSING neuron is exactly equal to an ordinary neuron:
[Equation]
A. A NAN D ENSE L AYER
A preliminary implementation of a nanDense layer is listed in Listing 1.
This layer is implemented by inheriting and overloading the class constructor, build , and call functions.
A ﬂag, use c , is added to the class constructor to decide whether to use compensatory weights or not (defaulted to False ).
Using this ﬂag, the user can simply switch between PROMISSING and mPROMISSING.
Furthermore, the ﬂag use bias is ﬁxed to True .
In the build function an extra weight is concatenated to the end of the weight vector to implement compensatory weight in the case use c==True .
The matrix of epsilons is also pre-set for usage in the call function.
In the call function, the values for compensatory weights and neutralizers are computed, accordingly.
The current implementation is limited to non-sparse 2-dimensional inputs.
The implementation is preliminary and not optimized for memory and speed efﬁciencies.
This implementation is tested with Python 3.8.3 , TensorFlow 2.4.1 , and Keras 2.4.3 .
A similar guideline may be followed to implement PROMISSING within other types of NN layers.
1 import keras 2 import tensorflow as tf 3 from tensorflow.python.framework import sparse_tensor 4 from tensorflow.python.ops import gen_math_ops 5 from tensorflow.python.ops import math_ops 6 from tensorflow.python.ops import nn_ops 7 from tensorflow.python.keras import backend as K 8 from tensorflow.python.framework import dtypes 9 from tensorflow.python.framework import
10 from tensorflow.python.keras.engine.input_spec import InputSpec 11 from tensorflow.python.keras import activations 12 from tensorflow.python.keras import initializers 13 from tensorflow.python.keras import regularizers 14 from tensorflow.python.keras import constraints 1517 class nanDense
): 18def __init
, units, use
False
# A flag to use compensatory weight or not.
None,
kernel_initializer=’glorot_uniform’, bias_initializer=’zeros’, kernel_regularizer
=
None, bias_regularizer
=
None, activity_regularizer
=
None, kernel_constraint
=
None, bias_constraint=
None, *
: super(nanDense, self).__init__(
, activity_regularizer=
_regularizer
) 33self.use_c =
use_c self.use bias =
True self.units = int if not isinstance int else units self.activation =
) self.
) self.
.supports
True 46def build(
, input
): 48dtype
if not or
): raise TypeError(’Unable to floating point ’ ’dtype
last
if
: raise ValueError(’The last dimension of the inputs to ‘ nanDense‘ ’ ’should be defined.
Found ‘None‘.’)
self.input_spec =
InputSpec( ndim=2, axes last dim}) 60if self.use_c:
# an extra weight if use c is True.
self.kernel =
self.add_weight( ’kernel’, shape=[last_dim+1, self.units], initializer=self.kernel_initializer, regularizer=
self.kernel_regularizer, constraint=self.kernel_constraint, dtype=self.dtype, trainable=
True) else:
self.kernel =
self.add_weight( ’kernel’, shape=[last_dim, self.units], initializer=self.kernel_initializer, regularizer=
self.kernel_regularizer, constraint=self.kernel_constraint, dtype=self.dtype, trainable=
True)
79self.bias = self.add_weight( ’bias’, shape=[self.units,], initializer=self.bias_initializer, regularizer=
self.bias_regularizer, constraint=self.bias_constraint,
dtype=self.dtype, trainable=True) 88self.epsilon = tf.fill(self.kernel.shape, K.epsilon())
# Epsilon Matrix 90self.built =
True 92 def call(self, inputs): 95dtype
= self._compute_dtype_object 97if self.use_c:
# Computing and concatenating the compensatory weight to the weights c = tf.math.reduce_sum(tf.cast(tf.math.is_nan(inputs), dtype) , axis=1)
c
= tf.math.divide(c, inputs.shape[1]) inputs = tf.concat([inputs,tf.expand_dims(c, axis=1)], axis =1) 102kernel =
math_ops.add(self.epsilon, self.kernel)
# Adding epsilon to weights 104if self.dtype: if inputs.dtype.base_dtype !
=
dtype.base_dtype: inputs = math_ops.cast(inputs, dtype=dtype)
108rank = inputs.shape.rank if rank =
= 2 or rank is None: if isinstance(inputs, sparse_tensor.
SparseTensor): raise NotImplementedError else: outputs =
[] for i in range(self.kernel.shape[1]): # Computing Neutralizers and activations for each neuron d = tf.math.divide(-self.bias[i]/self.kernel.shape [0], kernel[:,i]) temp_inputs = tf.where(tf.math.is_nan(inputs), d, inputs)
# replacing nans in inputs with -b/w outputs.append(gen_math_ops.mat_mul(temp_inputs, kernel[:,i:i+1]))
outputs =
tf
else: raise outputs
Listing 1: An implementation of a nanDense layer in Keras.
A. M ISSING D ATA S IMULATIONS
We used the same procedures in Schelter et al.
(2021) to simulate the missing values in our experiments on simulated and OpenML data.
For MAR and MNAR settings, ﬁrst, a random range of a certain feature F 1 is selected.
This random range is decided based on random lower and upper bound percentiles.
In the MAR condition, the values of a second random feature F 2 are removed if the values of F 1 lie in the speciﬁed range, i.e. , the missing values in F 2 depend on the observations
[Figure]
in F 1 (see Fig.
6b for an example).
In contrast in the MNAR case, the values are removed from the same F 1 feature.
In fact, in the MNAR case the values of F 1 are censored for in a certain range (see Fig.
6c for an example).
In the MCAR setting, the samples with missing value are selected completely at random (see Fig.
6a).
Fig.
6b-e illustrate the effect of applying different data imputation methods.
In all cases, imputation may result in the misrepresentation of samples with missing values.
A. S UPPLEMENTARY M ATERIAL FOR THE S IMULATION S TUDY
To better understand the learned representation of unknowns U , we have visualized the elements in
U across 100 simulation replications. Fig. 8 shows the values of U across 100 simulation runs in our simulation study.
In our simulation study, U has eight values (two inputs for each four input neurons).
Markers with similar color and shape represent the neutralizer values for two features (axes) in four neurons in a speciﬁc run.
For example, the four blue circles show the values of four neutralizers in two-dimensional feature space in the ﬁrst run of the experiment.
Since the scatter plot is very crowded, we plotted only the 8 representative runs in Fig.
9 in the main text in Sec. Since
U is derived from the network parameters, due to the stochastic nature of parameter initialization and optimization, it may end up with different values in each run (local minima).
Our visual inspection shows that the network ﬁnds four main groups of solutions for representing unknowns.
Fig.
9 depicts elements in U for 8 selected runs that represent these four groups. In this case, U has eight elements (two inputs for four neurons). Markers with similar colors represent the neutralizer values for two features (axes) and four neurons in a speciﬁc run (legends). The neutralizers in the ﬁrst group (1 and 11) are roughly zero imputers in which the missing values are imputed with close to (but not absolutely) zero values.
These are sub-optimal solutions that happen only in a few runs. In the other cases, the models seem to perform more than a simple imputer. In another minority group, represented by runs 52 and 100, the model turns to a mean imputer for the ﬁrst feature, but it learns diverse representation for the second feature; the neurons see unknowns as borderline samples. In another minority group (represented by run 41 and 81), some neurons see unknowns as samples with extreme values (outside or close to the outer range of inputs).
Run 7 and 10 represent the majority group of solutions in which each neuron has its unique perception of unknowns.
A. S UPPLEMENTARY M ATERIALS FOR E XPERIMENTS ON O PEN ML D ATA
Table 2 and Table 3 summarize the OpenML datasets that are respectively used in our classiﬁcation and regression analyses in Sec. 3.2.
We used exactly the same datasets as in J¨ager et al.
Fig. 10a and Fig.
10b compare the performance of our naive NN architecture (that are used in our experiments in Sec. 3.2) with a random forest (RF) classiﬁer or regressor across (with default settings) benchmark datasets.
The errorbars represent the variation in AUC/SMSE across 10 repetitions.
The models are evaluated in a 2-fold cross-validation scheme.
The random number generator seed is ﬁxed for all algorithms in each repetition.
Our results show that our simple NN architecture with two hidden layers generally performs as well as random forest models.
Both NN and RF models show near the chance performance on ’pollen’, ’egg-eye-state’, and ’numerai28.6’, thus we have removed these datasets from our analyses in Sec. 3.2.
About the regression tasks, again we observed poor performance (SMSE > 1) of both models in the case of ’stock-fardamento02’, ’wine-quality’, and ’Bike-Sharing-Demand’ datasets.
Thus, they are removed from our analysis. [Figure]
Fig.
11 shows the results for experiments in Sec 3.2 in the regression tasks.
Plots show the difference between the SMSE of the full model (trained on complete data) and the model trained on data with missing values.
As expected the difference in SMSE increases with an increase in the ratios of missing samples and features. The (m)PROMISSING shows competitive performance compared to HGB and the better performing imputers, i.e. , the zero, mean, and KNN imputers.
In an extra experiment, we used the MCAR scheme to simulate different ratios of samples (0.1, 0.25, 0.5, 0.9) and features (0.1, 0.25, 0.5, 0.75, 1) with missing values across datasets.
Please bear in mind that applying this setting (with more than one feature with missing values) to the
MAR and MNAR conditions is tricky because guaranteeing the assumptions behind these schemes can be complicated.
Fig. 12 compares the performance of different data imputation methods with (m)PROMISSING on the classiﬁcation tasks for different missing sample ratios (in each panel) and missing feature ratios (x-axes). The AUC drops with respect to the full model (trained on complete data) are averaged across different datasets and ten runs. The (m)PROMISSING shows competitive performance compared to the better performing imputers, i.e. , the mean and KNN imputers.
Especially, mPROMISSING performs slightly better when the ratio of missing features is increasing.
A similar overall pattern can be observed when comparing the increase in the SMSE in the regression tasks (see Fig. 13).
In summary, these results show that (m)PROMISSING can compete with data imputation approaches without the need for ﬁlling the unknowns.
[Figure]
[Table]
numerai28.
[Table]