tLDA | R Documentation |
Linear discriminate analysis (LDA) on a 3D tensor
tLDA(tnsr, nClass, nSamplesPerClass, tform)
tnsr |
a 3-mode tensor S3 class object |
nClass |
Number of classes |
nSamplesPerClass |
Samples in each class |
tform |
Any discrete transform. fft: Fast Fourier Transorm dwt: Discrete Wavelet Transform (Haar Wavelet) dct: Discrete Cosine transform dst: Discrete Sine transform dht: Discrete Hadley transform dwht: Discrete Walsh-Hadamard transform |
S3 class tensor
Kyle Caudle
Randy Hoover
Jackson Cates
Everett Sandbo
Xanthopoulos, P., Pardalos, P. M., Trafalis, T. B., Xanthopoulos, P., Pardalos, P. M., & Trafalis, T. B. (2013). Linear discriminant analysis. Robust data mining, 27-33.
data("Mnist")
T <- Mnist$train$images
myorder <- order(Mnist$train$labels)
# tLDA need to be sorted by classes
T_sorted <- T$data[,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(as.Tensor(T),10,2,"dct")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.