ClassAgree | R Documentation |
Calculates the confusion matrix and number of misclassifications.
ClassAgree(est.id, trueid)
est.id |
estimated membership vector |
trueid |
true membership vector |
ClassificationTable |
confusion table between true and estimated partitions |
MisclassificationNum |
number of misclassifications |
set.seed(123)
K <- 3; p <- 4
X <- as.matrix(iris[,-5])
id.true <- rep(1:K, each = 50)
# Obtain initial memberships based on the K-means algorithm
id.km <- kmeans(X, K)$cluster
ClassAgree(id.km, id.true)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.