Description
Imputation with Deep Learning Methods.
Description
Imputation of mixed-type and compositional data with neural networks. The architecture (number and size of hidden layers, dropout, activation, optimiser) is user-configurable. See Templ (2021) <doi:10.1007/978-3-030-71175-7>.
README.md
deepImp
Imputation of missing values with configurable neural networks, for mixed-type data (impNNet()) and compositional data with rounded zeros (impNNetCoDa()). The network architecture is described by a deepimp_arch() object. Models run on a native torch backend by default (no Python required), or optionally on keras3.
Installation
# from the repository
remotes::install_bitbucket("matthias-da/deepimp")
# the default backend (native libtorch; no Python)
torch::install_torch()
# optional: the keras backend (Python + TensorFlow)
# install.packages("keras3"); keras3::install_keras()
Quick start
Mixed-type imputation:
library(deepImp)
data(sleep, package = "VIM")
imp <- impNNet(sleep, arch = deepimp_arch_small(), epochs = 50, seed = 1)
completed <- getImputed(imp)
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.