Description Usage Arguments Details Value Author(s) References Examples
Function to evaluate clustering results by calculating the correlation between an incidence matrix and distance matrix. Suggested by Tan, P.-N., Steinbach, M., Karpatne, A., & Kumar, V. (2005)
1 | ClusterCor(dist.obj, clusterVector, return_matrices = FALSE)
|
dist.obj |
An object of class 'dist' for dataset |
clusterVector |
A vector with integers indicating which cluster observations belong to |
return_matrices |
Argument to return incidence- and distance matrix for observations |
ClusterCor computes an incidence matrix for observations, given a cluster vector, by creating a n x n matrix where 1 is returned for observations in same cluster and 0 is returned for observations in different clusters. With a distance matrix as input the two matrices are vectorized and correlation is computed. A highly negative correlation indicates that observations in same cluster have small distance to each other, meaning good results with respect to minimizing intra-distance and maximizing inter-distance
incidenceMatrix |
Matrix with 0's and 1's indicating if observations belong to same cluster or not |
distMatrix |
Matrix with distances between observations |
correlation |
The correlation coefficient. The more negative correlation, the better results are achieved with respect to clustering objectives |
Jacob H. Madsen
Tan, P.-N., Steinbach, M., Karpatne, A., & Kumar, V. (2005). Introduction to Data Mining (Second edition). ISBN: 978-03-213-2136-7
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.