powered by
Generate confusion matrix and convert from raw counts to percentage of each label
calculateConfusion(labels, clusters)
A vector with countable unique items, usually a factor variable in a data frame, labeling each observation.
A vector with countable unique items, usually is the clustering results returned by kmeans(), No NA's.
A confusion matrix of percentages.
http://healthcare.ai
healthcareai
# NOT RUN { data(iris) head(iris) kmeans.fit <- kmeans(iris[,1:4],3) labs <- iris[,5] cls <- kmeans.fit[["cluster"]] calculateConfusion(labels = labs, clusters = cls) # }
Run the code above in your browser using DataLab