tLDA | R Documentation |
Performs linear discriminate analysis on a tensor using any discrete transform. Assumes tensor is sorted by classes.
tLDA(tnsr,nClass,nSamplesPerClass,tform)
tnsr |
: a 3-mode tensor |
nClass |
: Number of classes |
nSamplesPerClass |
: Samples in each class |
tform |
: one of six-discrete transforms. Supported transforms are: fft: Fast Fourier Transform dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
a Tensor-class object
Kyle Caudle
Randy Hoover
Jackson Cates
data("Mnist")
T <- Mnist$train$images
myorder <- order(Mnist$train$labels)
# tLDA need to be sorted by classes
T_sorted <- as.tensor(T[,myorder,])
# Using small tensor, 2 images for each class for demonstration
T <- T_sorted[,c(1:2,1001:1002,2001:2002,3001:3002,
4001:4002,5001:5002,6001:6002,7001:7002,
8001:8002,9001:9002),]
tLDA(T,10,2,"dct")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.