Maximum Margin Criterion (MMC) is a linear supervised dimension reduction method that
maximizes average margin between classes. The cost function is defined as
do.mmc(
X,
label,
ndim = 2,
preprocess = c("center", "scale", "cscale", "decorrelate", "whiten")
)
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
li_efficient_2006Rdimtools
# NOT RUN {
## generate 3 different groups of data X and label vector
x1 = matrix(rnorm(4*10), nrow=10)-20
x2 = matrix(rnorm(4*10), nrow=10)
x3 = matrix(rnorm(4*10), nrow=10)+20
X = rbind(x1, x2, x3)
label = c(rep(1,10), rep(2,10), rep(3,10))
## perform MVP with different preprocessings
out1 = do.mmc(X, label, ndim=2)
out2 = do.mmc(X, label, ndim=2, preprocess="decorrelate")
## visualize
opar <- par(no.readonly=TRUE)
par(mfrow=c(1,2))
plot(out1$Y, main="MMC::centering")
plot(out2$Y, main="MMC::decorrelating")
par(opar)
# }
Run the code above in your browser using DataLab