Imputation with Deep Learning Methods

Imputation of mixed-type and compositional data with neural networks. Each network head is a generalised linear model plus a neural-network correction. Missing values are imputed by point predictions or, for multiple imputation, by predictive draws on bootstrap fits, with pooling through 'mice'. The architecture (number and size of hidden layers, dropout, activation, optimiser) and the training settings are user-configurable. See Templ (2021) .


deepImp

Imputation of missing values with configurable neural networks, for mixed-type data (impNNet()) and compositional data with rounded zeros (impNNetCoDa()). Every network head is a generalised linear model plus a neural-network correction, so the network adds non-linear effects and interactions on top of a GLM fit. Models run on a native torch backend by default (no Python required), or optionally on keras3.

  • Point imputation, or multiple imputation by predictive draws (predictive mean matching or normal draws, softmax sampling for factors) on bootstrap fits, with pooling through mice (as_mids()).
  • Network architecture (deepimp_arch()) and training settings (deepimp_control(): early stopping, learning-rate schedule, warm starts, parallel replicates, device) as validated objects.
  • Diagnostics: summary(), convergence and chain-trace plots, per-fit training history.
  • Stored models impute new data without retraining (keep_models = TRUE, predict()).

Installation

install.packages("deepImp")                      # CRAN release
# remotes::install_github("matthias-da/deepImp") # development version

torch::install_torch()     # the default backend: native libtorch, no Python

# optional: the keras backend (Python + TensorFlow)
# install.packages("keras3"); keras3::install_keras()

impNNetCoDa() also needs the robCompositions package, and as_mids() the mice package.

Quick start

Mixed-type imputation, point mode:

library(deepImp)
data(sleep, package = "VIM")
imp <- impNNet(sleep, arch = deepimp_arch_small(), epochs = 50, seed = 1)
summary(imp)
completed <- getImputed(imp)

Multiple imputation and pooled inference:

mi <- impNNet(sleep, arch = deepimp_arch_small(dropout = 0), m = 5, draw = "pmm",
              epochs = 50, seed = 1)
fit <- with(as_mids(mi), lm(Sleep ~ log(BodyWgt) + Danger))
summary(mice::pool(fit))

Compositional data (rounded zeros below a detection limit):

x <- data.frame(a = runif(50, 5, 10), b = runif(50, 5, 10), c = runif(50, 5, 10))
x$a[1:5] <- 0
imp <- impNNetCoDa(x, dl = c(1, 1, 1), label = 0, arch = deepimp_arch_small(), seed = 1)
getImputed(imp)

See vignette("deepImp") for a full walkthrough.

Reference

Templ, M. (2021). Imputation of rounded zeros for compositional data using neural networks. In: Advances in Compositional Data Analysis (Festschrift). Springer.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("deepImp")

1.2.0 by Matthias Templ, 13 days ago


https://github.com/matthias-da/deepImp


Report a bug at https://github.com/matthias-da/deepImp/issues


Browse source code at https://github.com/cran/deepImp


Authors: Matthias Templ [aut, cre] (ORCID:


Documentation:   PDF Manual  


GPL-2 license


Imports torch, nnet, VIM, stats, utils, graphics

Suggests future, future.apply, keras3, knitr, mice, rmarkdown, robCompositions, testthat


See at CRAN