Orthogonal LDA (OLDA) is an extension of classical LDA where the discriminant vectors are orthogonal to each other.
do.olda(
X,
label,
ndim = 2,
preprocess = c("center", "scale", "cscale", "whiten", "decorrelate")
)
an
a length-
an integer-valued target dimension.
an additional option for preprocessing the data.
Default is "center". See also aux.preprocess
for more details.
a named list containing
an
a list containing information for out-of-sample prediction.
a
ye_characterization_2005Rdimtools
# NOT RUN {
## use iris data
data(iris)
X = as.matrix(iris[,1:4])
label = as.integer(iris$Species)
## compare with LDA
out1 = do.lda(X, label)
out2 = do.olda(X, label)
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
plot(out1$Y, col=label, main="LDA")
plot(out2$Y, col=label, main="Orthogonal LDA")
par(opar)
# }
Run the code above in your browser using DataLab