This function implements an optimization algorithm that allows
imputing missing values in the label matrix while fitting a
tskrr
model.
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
)
a label matrix
a kernel matrix for the rows
an optional kernel matrix for the columns
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.
a logical value indicating whether symmetry
and the dimensions of the kernel(s) should be tested.
Defaults to TRUE
, but for large matrices
putting this to FALSE
will speed up the function.
a logical value indicating wether the row- and column
names of the matrices have to be checked for consistency. Defaults to
TRUE
, but for large matrices putting this to FALSE
will
speed up the function.
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").
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 FALSE
.
an integer giving the maximum number of iterations
a numeric value indicating the tolerance for convergence of the algorithm. It is the maximum sum of squared differences between to iteration steps.
a numeric value indicating the value with which NA's are replaced in the first step of the algorithm. Defaults to 0.
either a logical value, 1 or 2. 1
means "show the number
of iterations and the final deviation", 2
means "show the deviation
every 10 iterations". A value TRUE
is read as 1
.
A tskrr
model of the class tskrrImputeHeterogeneous
or tskrrImputeHomogeneous
depending on whether or
not g
has a value.
# NOT RUN {
data(drugtarget)
naid <- sample(length(drugTargetInteraction), 30)
drugTargetInteraction[naid] <- NA
impute_tskrr(drugTargetInteraction, targetSim, drugSim)
# }
Run the code above in your browser using DataLab