Description Usage Arguments Details Value Examples
View source: R/Crossval_OmicsPLS.R
Combines CV with R2 optimization
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | crossval_o2m_adjR2(
X,
Y,
a,
ax,
ay,
nr_folds,
nr_cores = 1,
stripped = TRUE,
p_thresh = 3000,
q_thresh = p_thresh,
tol = 1e-10,
max_iterations = 100
)
|
X |
Numeric matrix. Vectors will be coerced to matrix with |
Y |
Numeric matrix. Vectors will be coerced to matrix with |
a |
Vector of positive integers. Denotes the numbers of joint components to consider. |
ax |
Vector of non-negative integers. Denotes the numbers of X-specific components to consider. |
ay |
Vector of non-negative integers. Denotes the numbers of Y-specific components to consider. |
nr_folds |
Positive integer. Number of folds to consider. Note: |
nr_cores |
Positive integer. Number of cores to use for CV. You might want to use |
stripped |
Logical. Use the stripped version of o2m (usually when cross-validating)? |
p_thresh |
Integer. If |
q_thresh |
Integer. If |
tol |
Double. Threshold for which the NIPALS method is deemed converged. Must be positive. |
max_iterations |
Integer. Maximum number of iterations for the NIPALS method. |
This is an alternative way of cross-validating. It is proposed in citation(OmicsPLS)
.
This approach is (much) faster than the standard crossval_o2m
approach and works fine even with two folds.
For each element in n
it looks for nx and ny that maximize the R^2 between T and U in the O2PLS model.
This approach often yields similar integer as the standard approach.
We however suggest to use the standard approach to minimize the prediction error around the found integers.
data.frame with four columns: MSE, n, nx and ny. Each row corresponds to an element in a
.
1 2 3 4 5 6 | local({
X = scale(jitter(tcrossprod(rnorm(100),runif(10))))
Y = scale(jitter(tcrossprod(rnorm(100),runif(10))))
crossval_o2m_adjR2(X, Y, a = 1:4, ax = 1:2, ay = 1:2,
nr_folds = 5, nr_cores = 1)
})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.