1 | VClassifier(Face)
|
Face |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (Face)
{
Dat <- data.matrix(Face)
cat("Major Feature Description", "\n")
cat(">>>>>>>>>>>>>>>> 20% finished >>>>>>>>>>>>>>>>>>", "\n")
M_0 <- prcomp(Dat[, -1])
Score_1 <- M_0$x[, 1]
Score_2 <- M_0$x[, 2]
dev.new()
plot(Score_1 ~ Score_2, pch = 19, col = as.numeric(Dat[,
1] + 1))
cat("Implement LDA and QDA", "\n")
cat(">>>>>>>>>>>>>>>> 40% finished >>>>>>>>>>>>>>>>>>", "\n")
M_1 <- lda(Target ~ ., data = as.data.frame(Dat), CV = TRUE)
(table(M_1$class, Dat[, 1]))
(sum(diag(table(M_1$class, Dat[, 1])))/sum(table(M_1$class,
Dat[, 1])))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.