Description Usage Arguments Details Value Author(s) References See Also Examples
Performs k-fold cross validation for CATCH and returns the best tuning parameter λ in the user-specified or automatically generated choices.
1 2 |
x |
Input tensor or matrix list of length N, where N is the number of observations. Each element of the list is a tensor or matrix. The order of tensor can be any number and not limited to three. |
z |
Input covariate matrix of dimension N*q, where q<N. |
y |
Class label. For |
nfolds |
Number of folds. Default value is |
lambda |
User-specified |
lambda.opt |
The optimal criteria when multiple elements in |
... |
Other arguments that can be passed to |
The function cv.catch
runs function catch
nfolds+1
times. The first one fits model on all data. If lambda
is specified, it will check if all lambda
satisfies the constraints of dfmax
and pmax
in catch
. If not, a lambda
sequence will be generated according to lambda.factor
in catch
. Then the rest nfolds
many replicates will fit model on nfolds-1
many folds data and predict on the omitted fold, repectively. Return the lambda
with minimum average cross validation error and the largest lambda
within one standard error of the minimum.
lambda |
The actual |
cvm |
The mean of cross validation errors for each |
cvsd |
The standard error of cross validaiton errors for each |
lambda.min |
The |
lambda.1se |
The largest |
catch.fit |
The fitted |
Yuqing Pan, Qing Mai, Xin Zhang
Pan, Y., Mai, Q., and Zhang, X. (2018), "Covariate-Adjusted Tensor Classification in High-Dimensions." Journal of the American Statistical Association, accepted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | n <- 20
p <- 4
k <- 2
nvars <- p*p*p
x <- array(list(),n)
vec_x <- matrix(rnorm(n*nvars), nrow=n, ncol=nvars)
vec_x[1:10,] <- vec_x[1:10,]+2
z <- matrix(rnorm(n*2),nrow=n,ncol=2)
z[1:10,] <- z[1:10,]+0.5
y <- c(rep(1,10),rep(2,10))
for (i in 1:n){
x[[i]] <- array(vec_x[i,], dim=c(p,p,p))
}
objcv <- cv.catch(x, z, y=y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.