catch_matrix {catch} | R Documentation |
Fits a classifier for matrix data. catch_matrix
is a special case of catch
when each observation \mathbf{X}_i is a matrix. Different from catch
takes list as input, data need to be formed in an array to call the function (see arguments). The function will perform prediction as well.
catch_matrix(x, z = NULL, y, testx = NULL, testz = NULL, ...)
x |
Input matrix array. The array should be organized with dimension p1*p2*N, where \eqn{N} is the number of observations. |
z |
Input covariate matrix of dimension N*q, where q<N. |
y |
Class label. For |
testx |
Input testing matrix array. When |
testz |
Input testing covariate matrix. Can be omitted if there is no covariate. |
... |
Other arguments that can be passed to |
The function fits a matrix classifier as a special case of catch
. The fitted model and predictions should be identical to catch
when matrix data is provided. Input matrix should be organized as three-way array where sample size is the last dimension. If the matrix is organized in a list, users can either reorganize it or use catch
directly to fit model, which takes a matrix or tensor list as input and has the same output as catch_matrix
.
beta |
Output variable coefficients for each |
df |
The number of nonzero variables for each value in sequence |
dim |
Dimension of coefficient array. |
lambda |
The actual |
obj |
Objective function value for each value in sequence |
x |
The matrix list after adjustment in training data. If covariate is absent, this is the original input matrix. |
y |
Class label in training data. |
npasses |
Total number of iterations. |
jerr |
Error flag. |
sigma |
Estimated covariance matrix on each mode. |
delta |
Estimated delta matrix (vec(\widehat{\boldsymbol{μ}}_2-\widehat{\boldsymbol{μ}}_1),\cdots,vec(\widehat{\boldsymbol{μ}}_K-\widehat{\boldsymbol{μ}}_1)). |
mu |
Estimated mean array. |
prior |
Prior proportion of observations in each class. |
call |
The call that produces this object. |
pred |
Predicted categorical response for each value in sequence |
Yuqing Pan, Qing Mai, Xin Zhang
Pan, Y., Mai, Q., and Zhang, X. (2018) Covariate-Adjusted Tensor Classification in High-Dimensions, arXiv:1805.04421.
#without prediction n <- 20 p <- 4 k <- 2 nvars <- p*p x=array(rnorm(n*nvars),dim=c(p,p,n)) x[,,11:20]=x[,,11:20]+0.3 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)) obj <- catch_matrix(x,z,y=y)