Skip to main content
. 2021 Jul 2;12:691274. doi: 10.3389/fgene.2021.691274

Table 2.

Pseudocode of the ImputeEHR algorithm.

Algorithm: ImputeEHR algorithm
Require: X is n × m-dimensional data matrix, with stopping criterion γ
1. Make initial guess using mean or median imputation for missing values;
2. kA sorted indices vector according to t he amount of missing values of
column X;
w.r.t. increasing amount of missing values;
3. While not γ do
4.   Xoldimp Store previously imputed matrix;
5.   for s in k do
6.      Fit a LightGBM or Xgboost : yobs(s)~Xobs(s);
7.      Predict ymiss(s) using Xmiss(s);
8.      Xnewimp update imputed matrix from ymiss(s);
9.   end for
10.   Update γ
11.   end while
12. Return Matrix X;