ClassAgree: Calculates the confusion matrix and number of...

Description Usage Arguments Value Examples

View source: R/other.R

Description

Calculates the confusion matrix and number of misclassifications.

Usage

1
ClassAgree(est.id, trueid)

Arguments

est.id

estimated membership vector

trueid

true membership vector

Value

ClassificationTable

confusion table between true and estimated partitions

MisclassificationNum

number of misclassifications

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

ManlyMix documentation built on April 26, 2018, 1:04 a.m.