has_imputed_values {xnet} | R Documentation |
Getters for tskrrImpute objects
Description
The functions described here are convenience functions to get
information out of a tskrrImpute
object.
Usage
has_imputed_values(x)
which_imputed(x)
is_imputed(x)
Arguments
x |
a |
Value
For has_imputed_values
: a logical value indicating whether
the model has imputed values. If x
is not some form of a
tskrr
model, the function will return an error.
For which_imputed
: a integer vector with the positions
for which the values are imputed.
for is_imputed
: a matrix of the same dimensions as the
label matrix. It contains the value FALSE
at positions that
were not imputed, and TRUE
at positions that were.
Examples
data(drugtarget)
mod <- tskrr(drugTargetInteraction, targetSim, drugSim)
naid <- sample(length(drugTargetInteraction), 30)
drugTargetInteraction[naid] <- NA
impmod <- impute_tskrr(drugTargetInteraction, targetSim, drugSim)
has_imputed_values(mod)
has_imputed_values(impmod)
# For illustration: extract imputed values
id <- is_imputed(impmod)
fitted(impmod)[id]
[Package xnet version 0.1.11 Index]