data(zip.train)
x <- zip.train
rows <- which(x[, 1] == 0 | x[, 1] == 1)
x0 <- x[rows, 2:257]
y0 <- x[rows, 1] + 1
x0 <- t(x0)
dim(x0) <- c(16, 16, 2199)
tucker <- tTUCKER(x0, ranks = c(2, 2), eps=1e-03)
pairs(t(apply(tucker$S, 3, c)), col=y0)
# To approximate the original data one uses then
x0r <- tensorTransform2(tucker$S, tucker$U)
Run the code above in your browser using DataLab