tLDA: Linear Discriminate Analysis of a 3-mode Tensor Using any...

View source: R/tLDA.R

tLDAR Documentation

Linear Discriminate Analysis of a 3-mode Tensor Using any Discrete Transform

Description

Performs linear discriminate analysis on a tensor using any discrete transform. Assumes tensor is sorted by classes.

Usage

tLDA(tnsr,nClass,nSamplesPerClass,tform)

Arguments

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

Value

a Tensor-class object

Author(s)

Kyle Caudle

Randy Hoover

Jackson Cates

Examples

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")

rTensor2 documentation built on May 29, 2024, 8:34 a.m.