impute_tskrr {xnet} | R Documentation |
Impute missing values in a label matrix
Description
This function implements an optimization algorithm that allows
imputing missing values in the label matrix while fitting a
tskrr
model.
Usage
impute_tskrr(
y,
k,
g = NULL,
lambda = 0.01,
testdim = TRUE,
testlabels = TRUE,
symmetry = c("auto", "symmetric", "skewed"),
keep = FALSE,
niter = 10000,
tol = sqrt(.Machine$double.eps),
start = mean(y, na.rm = TRUE),
verbose = FALSE
)
Arguments
y |
a label matrix |
k |
a kernel matrix for the rows |
g |
an optional kernel matrix for the columns |
lambda |
a numeric vector with one or two values for the hyperparameter lambda. If two values are given, the first one is used for the k matrix and the second for the g matrix. |
testdim |
a logical value indicating whether symmetry
and the dimensions of the kernel(s) should be tested.
Defaults to |
testlabels |
a logical value indicating wether the row- and column
names of the matrices have to be checked for consistency. Defaults to
|
symmetry |
a character value with the possibilities "auto", "symmetric" or "skewed". In case of a homogeneous fit, you can either specify whether the label matrix is symmetric or skewed, or you can let the function decide (option "auto"). |
keep |
a logical value indicating whether the kernel hat
matrices should be stored in the model object. Doing so makes the
model object quite larger, but can speed up predictions in
some cases. Defaults to |
niter |
an integer giving the maximum number of iterations |
tol |
a numeric value indicating the tolerance for convergence of the algorithm. It is the maximum sum of squared differences between to iteration steps. |
start |
a numeric value indicating the value with which NA's are replaced in the first step of the algorithm. Defaults to 0. |
verbose |
either a logical value, 1 or 2. |
Value
A tskrr
model of the class tskrrImputeHeterogeneous
or tskrrImputeHomogeneous
depending on whether or
not g
has a value.
Examples
data(drugtarget)
naid <- sample(length(drugTargetInteraction), 30)
drugTargetInteraction[naid] <- NA
impute_tskrr(drugTargetInteraction, targetSim, drugSim)