{"id":526,"date":"2019-01-08T08:25:56","date_gmt":"2019-01-08T08:25:56","guid":{"rendered":"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/?post_type=chapter&#038;p=526"},"modified":"2019-01-08T09:22:44","modified_gmt":"2019-01-08T09:22:44","slug":"cluster-analysis-and-cluster-validity","status":"publish","type":"chapter","link":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/chapter\/cluster-analysis-and-cluster-validity\/","title":{"rendered":"Cluster Analysis and Cluster Validity"},"content":{"raw":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/O7EzPyET4IY\" target=\"_blank\" rel=\"noopener\"><img src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a>\r\n<\/span><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>Learning Objectives:<\/strong>\r\n\r\n&nbsp;\r\n\r\nThe learning objectives of this module are as follows:\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To understand the Cluster Validity and Cluster Validation Process\r\n\r\n\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To\u00a0 discuss the different Measures of Cluster Validity\r\n\r\n\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To understand External, Internal and the Statistical Framework for determining Cluster Validity\r\n\r\n&nbsp;\r\n\r\n<strong>25.1 Cluster Validity<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Let us first give a definition of validation of clustering. \u201cThe validation of clustering structures is the most difficult and frustrating part of cluster analysis. Without a strong effort in this direction, cluster analysis will remain a black art accessible only to those true believers who have experience and great courage.\u201d-[Jain &amp; Dubes]<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">For cluster analysis, the question is how to evaluate the \u201cgoodness\u201d of the resulting clusters? But as it is said the clusters can be defined from different perspectives. However validation is needed to compare clustering algorithms, solve the problem of determining the number of clusters, comparing two clusters, comparing two sets of clusters, and for avoiding finding patterns in noise.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Now let us understand a simple evaluation of clustering using precision and recall. Let us see the example given in Figure 25.1. Here we see that is a total of 5 oranges and 5 apples. The clustering produces two clusters, cluster 1 with 5 oranges and 2 apples and cluster 2 with 3 apples. Precision in this context is\u00a0<span style=\"font-size: 1em;text-align: initial\">defined as the number of items of a particular category (oranges or apples) obtained in the cluster divided by total number of items .of that category. Recall on the other hand is defined as the number of items of a particular category cluster. Accordingly precision and recall of oranges and are given in Figure 25.1. Note that these measures can be determined only if the ground truth is given. We will discuss these measures in detail later in the module.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-530\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17.png\" alt=\"\" width=\"310\" height=\"378\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.1 Precision and Recall of Clustering<\/strong><\/p>\r\n&nbsp;\r\n\r\n<strong>25.2 Good Clustering<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">We will now discuss the issues of good clustering. First we have the internal criterion which defines good clustering as a clustering that produces high quality clusters in which the intra-class similarity is high and the inter-class similarity is low. The measured quality of a clustering depends on both the representation of the items that are to be clustered and the similarity measure used. On the other hand external criterion measures the quality of a clustering by its ability to discover some or all of the hidden patterns or latent classes available, where we compare the clustering results to gold standard data.<\/p>\r\n&nbsp;\r\n\r\n<strong>25.3 Aspects of Cluster Validation<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Cluster validation involves evaluation of the clustering using external index by comparing the clustering results to <em>ground truth<\/em> (externally known results). Evaluation of the quality of clusters <em>without<\/em> reference to external information using only the data is called as evaluation using internal index. Another aspect is determining the <em>reliability<\/em> of clusters, that is the confidence level that the\u00a0<span style=\"font-size: 1em;text-align: initial\">clusters are not formed by chance, normally determined using a statistical framework.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>25.3.1 Cluster Validation process<\/strong>\r\n\r\n&nbsp;\r\n\r\nNow let us discuss the process of cluster validation. The following are the steps involved:\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">1. The first step is to find out whether the set of data has the clustering tendency that is distinguishing whether non-random structures actually exist in the data or whether the set of data is actually one cluster (Figure 25.2). Figure 25.2 shows the clusters obtained for different algorithms for random points.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-531\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18.png\" alt=\"\" width=\"365\" height=\"208\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.2 Clustering of Random Points<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">2. The next step is the comparison of the results of a cluster analysis to the externally known results,that is<\/p>\r\n<p style=\"text-align: justify\">to externally given class labels.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">3. The third step is the evaluation how well the results of a cluster analysis fit the data <em>without<\/em> reference to<\/p>\r\n<p style=\"text-align: justify\">external information. Use only the data.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">4. Then we carry out the comparison of the results of two different sets of cluster analyses to determine<\/p>\r\n<p style=\"text-align: justify\">which is better.<\/p>\r\n&nbsp;\r\n\r\n5. Finally we have the important task of determining the \u201ecorrect\u201f number of clusters for the given data set.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">In cluster validation, the steps 2, 3, and 4, can be further distinguished dependingon whether we want to evaluate the entire clustering or just individual clusters.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">According toJain &amp; Dubes, cluster validation refers to procedures that evaluate the results of clustering in a <strong>quantitative<\/strong> and <strong>objective<\/strong> fashion. In this context evaluation is quantitative when we employ the measures for evaluation while it is objectivewhen wevalidate of the measures.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-532\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19.png\" alt=\"\" width=\"571\" height=\"181\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.3 Clustering and Evaluation<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Figure 25.3 shows that for a given data set X, we can apply the clustering algorithm and given the gold standard in terms of different partitions P and the associated codebook C, determine the validity index. The process is repeated by trying out with different number of clusters.<\/p>\r\n&nbsp;\r\n\r\n<strong>25.3.2 Measures of Cluster Validity<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As we have already discussed, external index is where we validate against ground truth, or compare two clusters to find out the similarity between them (Figure 25.4). Figure 25.4 also illustrates the determination of the internal index where we validate <em>without<\/em>any external information, and if we do the same with different number of clusters we can solve the problem of determining the number of clusters.<\/p>\r\n<img class=\"aligncenter size-full wp-image-533\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20.png\" alt=\"\" width=\"400\" height=\"312\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.4External Index and Internal Index<\/strong><\/p>\r\n&nbsp;\r\n\r\n<strong>25.4Comparing with Ground Truth<\/strong>\r\n\r\n&nbsp;\r\n\r\nNow let notation for comparing with ground truth be as follows:\r\n\r\nN: number of objects in the data set;\r\n\r\n<span style=\"font-size: 1em;text-align: initial\">P={P1,\u2026,Pm}: the set of \u201cground truth\u201d clusters;<\/span>\r\n\r\n<span style=\"text-align: initial;font-size: 1em\">C={C1,\u2026,Cn}: the set of clusters reported by a clustering algorithm.<\/span>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Now we create the \u201cincidence matrix\u201d, which is a N \u00b4 N matrix where both the rows and columns correspond to objects. Pij = 1 if object Oi and object Oj belong to the same \u201cground truth\u201d cluster in P; Pij=0 otherwise. Similarly Cij = 1 if object Oi and object Oj belong to the same cluster in C; Cij=0 otherwise.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\nA pair of data object (Oi,Oj) falls into one of the following categories :\r\n\r\n<img class=\"aligncenter size-full wp-image-534\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21.png\" alt=\"\" width=\"303\" height=\"89\" \/>\r\n<p style=\"text-align: justify\">Now we define two evaluation measures based on this incidence matrix, Rand index and Jaccard coefficient. Rand Index may be dominated by DD, which is about objects not belonging to the same cluster in either the ground truth case or in the clusters obtained through the clustering algorithm.<\/p>\r\n<img class=\"aligncenter size-full wp-image-535\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22.png\" alt=\"\" width=\"536\" height=\"166\" \/>\r\n\r\n<strong>25.5 Purity Based Measures<\/strong>\r\n\r\n&nbsp;\r\n\r\nNow let us discuss another method used to find external index. Here we assume that the class of each object is available. The confusion matrix is given in Figure 25.5\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-536\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23.png\" alt=\"\" width=\"328\" height=\"301\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.5 Confusion Matrix <\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">given in Figure 25.5. Here the details are as follows:<\/p>\r\n\u2022\u00a0 n = the number of points\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0 \u00a0m<sub>i<\/sub>= the points in cluster i\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0 c<sub>j<\/sub> = the points in class j\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0 \u00a0n<sub>ij<\/sub>= the points in cluster i coming from class j\r\n\r\n&nbsp;\r\n\r\n\u2022\u00a0\u00a0\u00a0p<sub>ij<\/sub>=n<sub>ij<\/sub>\/mi\u00a0 = probability of element from cluster i to be assigned in class j\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>25.5.1 Purity Based Measures<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">We can define two measures entropy and purity. Both these measures can be measured for a cluster or for a clustering which is the evaluation of the complete set of clusters. Entropy of a cluster is based on probabilitypijof element from cluster i being assigned to class j. Here L is the total number of classes and K the total number of clusters.<\/p>\r\n<img class=\"aligncenter size-full wp-image-537\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24.png\" alt=\"\" width=\"370\" height=\"83\" \/>\r\n<p style=\"text-align: justify\">Entropy of a clustering is based on average entropy of each cluster as well as the total number of objects in the data set n. This value is highest when objects belong uniformly across clusters and zero when objects belong to a single cluster.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><strong>Purity of a cluster i <\/strong>is the class j for which the probability pijthat is the probability that an element from cluster i is assigned to class j.<\/p>\r\n&nbsp;\r\n\r\nPurity of a cluster: p<sub>i<\/sub>=max<sub>j<\/sub>\u00a0p<sub>ij<\/sub>\r\n\r\n<img class=\"aligncenter size-full wp-image-538\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25.png\" alt=\"\" width=\"370\" height=\"55\" \/>\r\n\r\n<\/div>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">The purity of the clustering C is based on average of the purity of each cluster pi, the points in cluster i and the total number of objects in the data set n.<\/span><\/p>\r\n&nbsp;\r\n\r\n<strong>25.5.2 Precision and Recall<\/strong>\r\n\r\n&nbsp;\r\n\r\n<strong>Precision<\/strong> <strong>of cluster i <\/strong>with respect to class j:prec(i,j)=p<sub>ij<\/sub> where p<sub>ij<\/sub> is theprobability of element from cluster i to be assigned in class j\r\n\r\n&nbsp;\r\n\r\n<strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Recall of cluster i <\/strong><span style=\"text-align: initial;text-indent: 1em;font-size: 1em\">with respect to class j: Rec(i,j) =n<sub>ij\/<\/sub>c<sub>j\u00a0<\/sub>where n<sub>ij<\/sub>\u00a0is the\u00a0<\/span><span style=\"text-align: initial;font-size: 1em\">number of data points in cluster i coming from class j and c<sub>j<\/sub> is the total number of data points in class j<\/span>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n<strong>F-measure <\/strong>is defined as the Harmonic Mean of Precision and Recall:\r\n\r\n<img class=\"aligncenter size-full wp-image-539\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-26.png\" alt=\"\" width=\"293\" height=\"72\" \/>\r\n\r\n<strong>25.5.3 Precision\/Recall for Clusters and Clustering<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">We normally assign to cluster the class which is the class j such that cluster <em>i has the maximum number of data <\/em>points coming from class j<\/p>\r\n<img class=\"aligncenter size-full wp-image-540\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-27.png\" alt=\"\" width=\"149\" height=\"46\" \/>\r\n<p style=\"text-align: justify\">Now we define the <strong>Precision of cluster i as<\/strong>\u00a0 prec(i)= n<sub>i<\/sub>k<sub>i\/<\/sub>m<sub>i<\/sub>\u00a0 where m<sub>i<\/sub>k<sub>i\u00a0<\/sub>is the number of data points in cluster i coming from class and is the total number of data points in cluster i.<\/p>\r\n<img class=\" wp-image-541 alignleft\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28.png\" alt=\"\" width=\"821\" height=\"410\" \/>\r\n\r\n<\/div>\r\n<div><\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n&nbsp;\r\n\r\n<strong>25.5.4 Good and Bad Clustering<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Now let us understand the evaluation using the examples given in Figure 25.6. We had discussed that the p<strong>urity of a cluster i<\/strong> is the class j for which the probability of pij, an element from cluster i being assigned to class j. Purity of a cluster i: = <strong>.<\/strong> In Figure 25.6 (a), the purity of cluster 1 is Max value of cluster divided by the total number of data points in class 1 i.e. 85\/90=0.94, that\u00a0<span style=\"font-size: 1em;text-align: initial\">of cluster 2 is 90\/110=0.81, and that of cluster 3 is 85\/100=0.85. The overall purity of the clustering is 0.86. Similarly we can find the precision and recall for each cluster and for the overall clustering. Figure 25.6 (b) shows another example with the calculated evaluation measures. As we can see in Figure 25.6<\/span><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">a)\u00a0 a good clustering has high values of purity, precision and recall while a bad clustering. of Figure 25.6 (b) has low values of purity, precision and recall is<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-542\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29.png\" alt=\"\" width=\"582\" height=\"275\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.6 Good and Bad Clustering<\/strong><\/p>\r\n&nbsp;\r\n\r\n<strong>25.6 Internal Measure<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">As discussed previously internal measures are used to measure the goodness of a clustering structure without comparing with external information. There are basically two aspects that are considered namely <strong>cohesion<\/strong>whichmeasures how closely related the data points in a cluster are and <strong>separation<\/strong>which measures how distinct or well-separated the data points of a cluster are from the data points of other clusters (Figure 25.7). These aspects can be measured using sum of squares and sum of squared error.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-543\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30.png\" alt=\"\" width=\"513\" height=\"191\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.7 Cohesion and Separation<\/strong><\/p>\r\n&nbsp;\r\n\r\n<strong>25.6.1 Internal Measure -Sum of Squares<\/strong>\r\n\r\n&nbsp;\r\n\r\n<span style=\"font-size: 1em;text-align: initial\">When we measure cluster cohesion, we measure homogeneity measured by the within cluster sum of squares<\/span>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-544\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31.png\" alt=\"\" width=\"573\" height=\"73\" \/>\r\n\r\nCluster Separation is measured by the between cluster sum of squares\r\n\r\n<img class=\"aligncenter size-full wp-image-545\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32.png\" alt=\"\" width=\"550\" height=\"84\" \/>\r\n\r\n&nbsp;\r\n\r\nThe sum of BSS + WSS = constant. In general, a larger number of clusters tend to result in smaller WSS as shown in the example (Figure 25.8)\r\n\r\n<img class=\"aligncenter size-full wp-image-546\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33.png\" alt=\"\" width=\"614\" height=\"381\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.8 Example of WSS an BSS with Different Number of Clusters<\/strong><\/p>\r\n&nbsp;\r\n\r\nInternal Measure SSE curve for a more complicated data set is shown in Figure 25.9.\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-547\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34.png\" alt=\"\" width=\"405\" height=\"247\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.9 SSE for a Complex Data Set 25.6.2 Internal Measure \u2013Average Distance<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">In the same spirit as the sum of squareswe alsodefine <strong><em>Cohesion a<\/em>(<em>x<\/em>)<\/strong>as theaverage distance of <em>x<\/em> to all other vectors in the same cluster. We also define <strong><em>Separation b<\/em>(<em>x<\/em>)<\/strong>as theaverage distance of <em>x <\/em>to the vectors in other clusters. We find the minimum among the clusters<\/p>\r\n&nbsp;\r\n\r\n<strong>25.6.3 Internal Measure -Silhouette coefficient<\/strong>\r\n<p style=\"text-align: justify\">Another important internal measure is the<strong>SilhouetteCoefficients(x)<\/strong>which is defined below. We first define silhouette as:<\/p>\r\n<img class=\"aligncenter size-full wp-image-548\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35.png\" alt=\"\" width=\"585\" height=\"80\" \/>\r\n<p style=\"text-align: justify\">We use the above to define the Silhouette coefficient (SC) to find the silhouette of all the N data points :<\/p>\r\n<img class=\"aligncenter size-full wp-image-549\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-36.png\" alt=\"\" width=\"203\" height=\"102\" \/>\r\n\r\n25.7 <strong>Correlation with Distance Matrix<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">We will down define two matrices, the proximity\/distance matrix and the incidence matrix. The proximity matrix \/distance matrix is a matrix having rows and columns equal to the number of objects where each entry Dij is the similarity between object Oi and Oj. The incidence matrix has one row and one column for each data point and the entry is 1 if the associated pair of points belong to the same cluster and 0 if the associated pair of points belong to different clusters.<\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Now we need to compute the correlation between the two matrices. Here we need to calculate only n(n-1)\/2 entries. High correlation indicates good clustering.<\/span><\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n&nbsp;\r\n\r\nGiven Distance Matrix D <em>= {d<\/em><em>11<\/em><em>,d<\/em><em>12<\/em><em>, \u2026, d<\/em><em>nn<\/em> <em>}<\/em> and Incidence Matrix <em>C= { c<\/em><em>11<\/em><em>,<\/em><em>c<\/em><em>12<\/em><em>,\u2026, c<\/em><em>nn<\/em><em> } <\/em>.\r\n\r\n&nbsp;\r\n\r\n<strong>Correlation <em>r<\/em> <\/strong>between D and C is given by\r\n\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-550\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37.png\" alt=\"\" width=\"407\" height=\"177\" \/>\r\n\r\n&nbsp;\r\n\r\nThis is not a good measure for some density or contiguity based clusters.\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Correlation of incidence and proximity matrices for the K-means clustering of two data sets with different values is shown in Figure 25.10.<\/p>\r\n<img class=\"aligncenter size-full wp-image-551\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38.png\" alt=\"\" width=\"583\" height=\"206\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.10. Correlation Values Using Distance Matrix 25.7.1 Using Similarity Matrix for Cluster Validation<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">We can order the similarity matrix with respect to cluster labels and inspect visually. This is shown in Figure 25.11 which is a good clustering. Clusters in random data are not so crisp and is shown in Figure 25.12.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-552\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39.png\" alt=\"\" width=\"471\" height=\"154\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.11 Good Clustering<\/strong><\/p>\r\n<img class=\"aligncenter size-full wp-image-553\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40.png\" alt=\"\" width=\"556\" height=\"145\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.12Example of Clustering<\/strong><\/p>\r\n&nbsp;\r\n\r\n<strong>25.8 Statistical Framework for SSE<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Now let us discuss some statistical aspects. Now let us consider the example where we compare the SSE (discussed previously) of 0.005 against three clusters in random data. The figure shows the SSE Histogram of 500 sets of random data points of size 100 distributed over the range 0.2 \u2013 0.8 for x and y values.<\/p>\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-554\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41.png\" alt=\"\" width=\"493\" height=\"266\" \/>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Correlation of incidence and distance matrices for the K-means of the following two data sets and the Histogram is shown in Figure 25.14.<\/p>\r\n\r\n<\/div>\r\n<div>\r\n\r\n<img class=\"aligncenter size-full wp-image-555\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42.png\" alt=\"\" width=\"582\" height=\"200\" \/>\r\n<p style=\"text-align: center\"><strong>Figure 25.14 Histogram of Correlation with K means 25.8.1 Empirical p-value<\/strong><\/p>\r\n&nbsp;\r\n<p style=\"text-align: justify\">Another measure of correlation is the empirical p-value. If we have a measurement v (e.g., the SSE value) and we have N measurements on random datasets, the empirical p-value is the fraction of measurements in the random data that have value less or equal than value v (or greater or equal if we want to maximize), in other words the value in the random dataset is at least as good as that in the real data. We usually require that p-value \u2264 0.05. However it is difficult to know the right notion of a random dataset.<\/p>\r\n&nbsp;\r\n\r\n<strong>25.8.2 Hyper Geometric Distribution<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">The next two measures of correlation or association are defined in terms of genes in a random data set. Given that the total number of genes in the data set associated with term T is M, if we randomly draw n genes from the data set N, the probability that m of the selected n genes will be associated with T is given as<\/p>\r\n&nbsp;\r\n\r\n<img class=\"aligncenter size-full wp-image-556\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43.png\" alt=\"\" width=\"449\" height=\"166\" \/>\r\n\r\n<strong>25.8.3 P-Value<\/strong>\r\n\r\n&nbsp;\r\n<p style=\"text-align: justify\">Based on Hyper-geometric distribution given above, the probability of having m genes or fewer associated to T in N can be calculated by summing the probabilities of a random list of N genes having 1, 2, \u2026, m genes associated to T. So the p-value of over-representation is as follows:<\/p>\r\n\r\n<\/div>\r\n<img class=\"aligncenter size-full wp-image-557\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44.png\" alt=\"\" width=\"345\" height=\"159\" \/>\r\n\r\n<strong>Summary<\/strong>\r\n<ul>\r\n \t<li>Explained the different aspects of Cluster Validity and the Cluster Validation Process<\/li>\r\n \t<li>Discussed the roles of the different Measures in determining Cluster Validity<\/li>\r\n \t<li>Explained External, Internal and the Statistical Framework used for determining Cluster Validity<\/li>\r\n<\/ul>\r\n&nbsp;\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td><strong>you can view video on Cluster Analysis and Cluster Validity<\/strong><\/td>\r\n<td><a href=\"https:\/\/youtu.be\/O7EzPyET4IY\" target=\"_blank\" rel=\"noopener\"><img class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<strong>Web Links<\/strong>\r\n<ul>\r\n \t<li>cs.uef.fi\/sipu\/pub\/qinpei-thesis.pdf<\/li>\r\n \t<li>http:\/\/dl.acm.org\/citation.cfm?id=565124&amp;dl=ACM&amp;coll=DL&amp;CFID=714642446&amp;CFTOK EN=70781438<\/li>\r\n \t<li>http:\/\/sigmod.org\/publications\/sigmod-record\/0209\/a1.partii_clvalidity1.pdf<\/li>\r\n \t<li>www.airccse.org\/journal\/ijcses\/papers\/1110ijcses07.pdf<\/li>\r\n \t<li>uniobuda.hu\/conferences\/mtn2005\/KovacsFerenc.pdf<\/li>\r\n \t<li>www.cs.kent.edu\/~jin\/DM08\/ClusterValidation.pdf<\/li>\r\n<\/ul>\r\n&nbsp;\r\n\r\n<strong>Supporting &amp; Reference Materials<\/strong>\r\n<ul>\r\n \t<li>A Bounded Index for Cluster ValiditySandro Saitta, Benny Raphael, Ian F. C. Smith, LNCS 2007<\/li>\r\n \t<li>Cluster Analysis, 5th Edition <a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Brian+S.+Everitt\">Brian S. Everitt, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Sabine+Landau\">Sabine Landau, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Morven+Leese\">MorvenLeese, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Daniel+Stahl\">Daniel <\/a>StahlJanuary 2011, \u00a92010<\/li>\r\n \t<li>Sum-of-Squares Based Cluster Validity Index and Significance Analysis, Qinpei Zhao, Mantao Xu, Pasi Fr\u00e4nti,2014<\/li>\r\n<\/ul>","rendered":"<div><span style=\"float: right\"><a href=\"https:\/\/youtu.be\/O7EzPyET4IY\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"epgp books\" width=\"75px\" height=\"75px;\" \/><\/a><br \/>\n<\/span><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>Learning Objectives:<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>The learning objectives of this module are as follows:<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To understand the Cluster Validity and Cluster Validation Process<\/p>\n<p>\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To\u00a0 discuss the different Measures of Cluster Validity<\/p>\n<p>\u2022\u00a0\u00a0\u00a0\u00a0\u00a0 To understand External, Internal and the Statistical Framework for determining Cluster Validity<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.1 Cluster Validity<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Let us first give a definition of validation of clustering. \u201cThe validation of clustering structures is the most difficult and frustrating part of cluster analysis. Without a strong effort in this direction, cluster analysis will remain a black art accessible only to those true believers who have experience and great courage.\u201d-[Jain &amp; Dubes]<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">For cluster analysis, the question is how to evaluate the \u201cgoodness\u201d of the resulting clusters? But as it is said the clusters can be defined from different perspectives. However validation is needed to compare clustering algorithms, solve the problem of determining the number of clusters, comparing two clusters, comparing two sets of clusters, and for avoiding finding patterns in noise.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Now let us understand a simple evaluation of clustering using precision and recall. Let us see the example given in Figure 25.1. Here we see that is a total of 5 oranges and 5 apples. The clustering produces two clusters, cluster 1 with 5 oranges and 2 apples and cluster 2 with 3 apples. Precision in this context is\u00a0<span style=\"font-size: 1em;text-align: initial\">defined as the number of items of a particular category (oranges or apples) obtained in the cluster divided by total number of items .of that category. Recall on the other hand is defined as the number of items of a particular category cluster. Accordingly precision and recall of oranges and are given in Figure 25.1. Note that these measures can be determined only if the ground truth is given. We will discuss these measures in detail later in the module.<\/span><\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-530\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17.png\" alt=\"\" width=\"310\" height=\"378\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17.png 310w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17-246x300.png 246w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17-65x79.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-17-225x274.png 225w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.1 Precision and Recall of Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.2 Good Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We will now discuss the issues of good clustering. First we have the internal criterion which defines good clustering as a clustering that produces high quality clusters in which the intra-class similarity is high and the inter-class similarity is low. The measured quality of a clustering depends on both the representation of the items that are to be clustered and the similarity measure used. On the other hand external criterion measures the quality of a clustering by its ability to discover some or all of the hidden patterns or latent classes available, where we compare the clustering results to gold standard data.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.3 Aspects of Cluster Validation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Cluster validation involves evaluation of the clustering using external index by comparing the clustering results to <em>ground truth<\/em> (externally known results). Evaluation of the quality of clusters <em>without<\/em> reference to external information using only the data is called as evaluation using internal index. Another aspect is determining the <em>reliability<\/em> of clusters, that is the confidence level that the\u00a0<span style=\"font-size: 1em;text-align: initial\">clusters are not formed by chance, normally determined using a statistical framework.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>25.3.1 Cluster Validation process<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Now let us discuss the process of cluster validation. The following are the steps involved:<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">1. The first step is to find out whether the set of data has the clustering tendency that is distinguishing whether non-random structures actually exist in the data or whether the set of data is actually one cluster (Figure 25.2). Figure 25.2 shows the clusters obtained for different algorithms for random points.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-531\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18.png\" alt=\"\" width=\"365\" height=\"208\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18.png 365w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18-300x171.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18-65x37.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18-225x128.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-18-350x199.png 350w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.2 Clustering of Random Points<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">2. The next step is the comparison of the results of a cluster analysis to the externally known results,that is<\/p>\n<p style=\"text-align: justify\">to externally given class labels.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">3. The third step is the evaluation how well the results of a cluster analysis fit the data <em>without<\/em> reference to<\/p>\n<p style=\"text-align: justify\">external information. Use only the data.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">4. Then we carry out the comparison of the results of two different sets of cluster analyses to determine<\/p>\n<p style=\"text-align: justify\">which is better.<\/p>\n<p>&nbsp;<\/p>\n<p>5. Finally we have the important task of determining the \u201ecorrect\u201f number of clusters for the given data set.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In cluster validation, the steps 2, 3, and 4, can be further distinguished dependingon whether we want to evaluate the entire clustering or just individual clusters.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">According toJain &amp; Dubes, cluster validation refers to procedures that evaluate the results of clustering in a <strong>quantitative<\/strong> and <strong>objective<\/strong> fashion. In this context evaluation is quantitative when we employ the measures for evaluation while it is objectivewhen wevalidate of the measures.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-532\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19.png\" alt=\"\" width=\"571\" height=\"181\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19.png 571w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19-300x95.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19-65x21.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19-225x71.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-19-350x111.png 350w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.3 Clustering and Evaluation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Figure 25.3 shows that for a given data set X, we can apply the clustering algorithm and given the gold standard in terms of different partitions P and the associated codebook C, determine the validity index. The process is repeated by trying out with different number of clusters.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.3.2 Measures of Cluster Validity<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As we have already discussed, external index is where we validate against ground truth, or compare two clusters to find out the similarity between them (Figure 25.4). Figure 25.4 also illustrates the determination of the internal index where we validate <em>without<\/em>any external information, and if we do the same with different number of clusters we can solve the problem of determining the number of clusters.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-533\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20.png\" alt=\"\" width=\"400\" height=\"312\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20.png 400w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20-300x234.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20-65x51.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20-225x176.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-20-350x273.png 350w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.4External Index and Internal Index<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.4Comparing with Ground Truth<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Now let notation for comparing with ground truth be as follows:<\/p>\n<p>N: number of objects in the data set;<\/p>\n<p><span style=\"font-size: 1em;text-align: initial\">P={P1,\u2026,Pm}: the set of \u201cground truth\u201d clusters;<\/span><\/p>\n<p><span style=\"text-align: initial;font-size: 1em\">C={C1,\u2026,Cn}: the set of clusters reported by a clustering algorithm.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Now we create the \u201cincidence matrix\u201d, which is a N \u00b4 N matrix where both the rows and columns correspond to objects. Pij = 1 if object Oi and object Oj belong to the same \u201cground truth\u201d cluster in P; Pij=0 otherwise. Similarly Cij = 1 if object Oi and object Oj belong to the same cluster in C; Cij=0 otherwise.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>A pair of data object (Oi,Oj) falls into one of the following categories :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-534\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21.png\" alt=\"\" width=\"303\" height=\"89\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21.png 303w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21-300x88.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21-65x19.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-21-225x66.png 225w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><\/p>\n<p style=\"text-align: justify\">Now we define two evaluation measures based on this incidence matrix, Rand index and Jaccard coefficient. Rand Index may be dominated by DD, which is about objects not belonging to the same cluster in either the ground truth case or in the clusters obtained through the clustering algorithm.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-535\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22.png\" alt=\"\" width=\"536\" height=\"166\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22.png 536w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22-300x93.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22-65x20.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22-225x70.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-22-350x108.png 350w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/p>\n<p><strong>25.5 Purity Based Measures<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Now let us discuss another method used to find external index. Here we assume that the class of each object is available. The confusion matrix is given in Figure 25.5<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-536\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23.png\" alt=\"\" width=\"328\" height=\"301\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23.png 328w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23-300x275.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23-65x60.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-23-225x206.png 225w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.5 Confusion Matrix <\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">given in Figure 25.5. Here the details are as follows:<\/p>\n<p>\u2022\u00a0 n = the number of points<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0 \u00a0m<sub>i<\/sub>= the points in cluster i<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0 c<sub>j<\/sub> = the points in class j<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0 \u00a0n<sub>ij<\/sub>= the points in cluster i coming from class j<\/p>\n<p>&nbsp;<\/p>\n<p>\u2022\u00a0\u00a0\u00a0p<sub>ij<\/sub>=n<sub>ij<\/sub>\/mi\u00a0 = probability of element from cluster i to be assigned in class j<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.5.1 Purity Based Measures<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We can define two measures entropy and purity. Both these measures can be measured for a cluster or for a clustering which is the evaluation of the complete set of clusters. Entropy of a cluster is based on probabilitypijof element from cluster i being assigned to class j. Here L is the total number of classes and K the total number of clusters.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-537\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24.png\" alt=\"\" width=\"370\" height=\"83\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24.png 370w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24-300x67.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24-65x15.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24-225x50.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-24-350x79.png 350w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p style=\"text-align: justify\">Entropy of a clustering is based on average entropy of each cluster as well as the total number of objects in the data set n. This value is highest when objects belong uniformly across clusters and zero when objects belong to a single cluster.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><strong>Purity of a cluster i <\/strong>is the class j for which the probability pijthat is the probability that an element from cluster i is assigned to class j.<\/p>\n<p>&nbsp;<\/p>\n<p>Purity of a cluster: p<sub>i<\/sub>=max<sub>j<\/sub>\u00a0p<sub>ij<\/sub><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-538\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25.png\" alt=\"\" width=\"370\" height=\"55\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25.png 370w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25-300x45.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25-65x10.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25-225x33.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-25-350x52.png 350w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: justify;font-size: 1em\">The purity of the clustering C is based on average of the purity of each cluster pi, the points in cluster i and the total number of objects in the data set n.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.5.2 Precision and Recall<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Precision<\/strong> <strong>of cluster i <\/strong>with respect to class j:prec(i,j)=p<sub>ij<\/sub> where p<sub>ij<\/sub> is theprobability of element from cluster i to be assigned in class j<\/p>\n<p>&nbsp;<\/p>\n<p><strong style=\"text-align: initial;text-indent: 1em;font-size: 1em\">Recall of cluster i <\/strong><span style=\"text-align: initial;text-indent: 1em;font-size: 1em\">with respect to class j: Rec(i,j) =n<sub>ij\/<\/sub>c<sub>j\u00a0<\/sub>where n<sub>ij<\/sub>\u00a0is the\u00a0<\/span><span style=\"text-align: initial;font-size: 1em\">number of data points in cluster i coming from class j and c<sub>j<\/sub> is the total number of data points in class j<\/span><\/p>\n<div>\n<p>&nbsp;<\/p>\n<p><strong>F-measure <\/strong>is defined as the Harmonic Mean of Precision and Recall:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-539\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-26.png\" alt=\"\" width=\"293\" height=\"72\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-26.png 293w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-26-65x16.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-26-225x55.png 225w\" sizes=\"auto, (max-width: 293px) 100vw, 293px\" \/><\/p>\n<p><strong>25.5.3 Precision\/Recall for Clusters and Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We normally assign to cluster the class which is the class j such that cluster <em>i has the maximum number of data <\/em>points coming from class j<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-540\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-27.png\" alt=\"\" width=\"149\" height=\"46\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-27.png 149w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-27-65x20.png 65w\" sizes=\"auto, (max-width: 149px) 100vw, 149px\" \/><\/p>\n<p style=\"text-align: justify\">Now we define the <strong>Precision of cluster i as<\/strong>\u00a0 prec(i)= n<sub>i<\/sub>k<sub>i\/<\/sub>m<sub>i<\/sub>\u00a0 where m<sub>i<\/sub>k<sub>i\u00a0<\/sub>is the number of data points in cluster i coming from class and is the total number of data points in cluster i.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-541 alignleft\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28.png\" alt=\"\" width=\"821\" height=\"410\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28.png 575w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28-300x150.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28-65x32.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28-225x112.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-28-350x175.png 350w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/p>\n<\/div>\n<div><\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.5.4 Good and Bad Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Now let us understand the evaluation using the examples given in Figure 25.6. We had discussed that the p<strong>urity of a cluster i<\/strong> is the class j for which the probability of pij, an element from cluster i being assigned to class j. Purity of a cluster i: = <strong>.<\/strong> In Figure 25.6 (a), the purity of cluster 1 is Max value of cluster divided by the total number of data points in class 1 i.e. 85\/90=0.94, that\u00a0<span style=\"font-size: 1em;text-align: initial\">of cluster 2 is 90\/110=0.81, and that of cluster 3 is 85\/100=0.85. The overall purity of the clustering is 0.86. Similarly we can find the precision and recall for each cluster and for the overall clustering. Figure 25.6 (b) shows another example with the calculated evaluation measures. As we can see in Figure 25.6<\/span><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">a)\u00a0 a good clustering has high values of purity, precision and recall while a bad clustering. of Figure 25.6 (b) has low values of purity, precision and recall is<\/span><\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-542\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29.png\" alt=\"\" width=\"582\" height=\"275\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29.png 582w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29-300x142.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29-65x31.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29-225x106.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-29-350x165.png 350w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.6 Good and Bad Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.6 Internal Measure<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">As discussed previously internal measures are used to measure the goodness of a clustering structure without comparing with external information. There are basically two aspects that are considered namely <strong>cohesion<\/strong>whichmeasures how closely related the data points in a cluster are and <strong>separation<\/strong>which measures how distinct or well-separated the data points of a cluster are from the data points of other clusters (Figure 25.7). These aspects can be measured using sum of squares and sum of squared error.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-543\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30.png\" alt=\"\" width=\"513\" height=\"191\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30.png 513w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30-300x112.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30-65x24.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30-225x84.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-30-350x130.png 350w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.7 Cohesion and Separation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.6.1 Internal Measure -Sum of Squares<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 1em;text-align: initial\">When we measure cluster cohesion, we measure homogeneity measured by the within cluster sum of squares<\/span><\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-544\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31.png\" alt=\"\" width=\"573\" height=\"73\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31.png 573w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31-300x38.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31-65x8.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31-225x29.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-31-350x45.png 350w\" sizes=\"auto, (max-width: 573px) 100vw, 573px\" \/><\/p>\n<p>Cluster Separation is measured by the between cluster sum of squares<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-545\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32.png\" alt=\"\" width=\"550\" height=\"84\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32.png 550w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32-300x46.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32-65x10.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32-225x34.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-32-350x53.png 350w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>The sum of BSS + WSS = constant. In general, a larger number of clusters tend to result in smaller WSS as shown in the example (Figure 25.8)<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-546\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33.png\" alt=\"\" width=\"614\" height=\"381\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33.png 614w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33-300x186.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33-225x140.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-33-350x217.png 350w\" sizes=\"auto, (max-width: 614px) 100vw, 614px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.8 Example of WSS an BSS with Different Number of Clusters<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p>Internal Measure SSE curve for a more complicated data set is shown in Figure 25.9.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-547\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34.png\" alt=\"\" width=\"405\" height=\"247\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34.png 405w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34-300x183.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34-65x40.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34-225x137.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-34-350x213.png 350w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.9 SSE for a Complex Data Set 25.6.2 Internal Measure \u2013Average Distance<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">In the same spirit as the sum of squareswe alsodefine <strong><em>Cohesion a<\/em>(<em>x<\/em>)<\/strong>as theaverage distance of <em>x<\/em> to all other vectors in the same cluster. We also define <strong><em>Separation b<\/em>(<em>x<\/em>)<\/strong>as theaverage distance of <em>x <\/em>to the vectors in other clusters. We find the minimum among the clusters<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.6.3 Internal Measure -Silhouette coefficient<\/strong><\/p>\n<p style=\"text-align: justify\">Another important internal measure is the<strong>SilhouetteCoefficients(x)<\/strong>which is defined below. We first define silhouette as:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-548\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35.png\" alt=\"\" width=\"585\" height=\"80\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35.png 585w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35-300x41.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35-65x9.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35-225x31.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-35-350x48.png 350w\" sizes=\"auto, (max-width: 585px) 100vw, 585px\" \/><\/p>\n<p style=\"text-align: justify\">We use the above to define the Silhouette coefficient (SC) to find the silhouette of all the N data points :<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-549\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-36.png\" alt=\"\" width=\"203\" height=\"102\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-36.png 203w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-36-65x33.png 65w\" sizes=\"auto, (max-width: 203px) 100vw, 203px\" \/><\/p>\n<p>25.7 <strong>Correlation with Distance Matrix<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We will down define two matrices, the proximity\/distance matrix and the incidence matrix. The proximity matrix \/distance matrix is a matrix having rows and columns equal to the number of objects where each entry Dij is the similarity between object Oi and Oj. The incidence matrix has one row and one column for each data point and the entry is 1 if the associated pair of points belong to the same cluster and 0 if the associated pair of points belong to different clusters.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\"><span style=\"text-align: initial;font-size: 1em\">Now we need to compute the correlation between the two matrices. Here we need to calculate only n(n-1)\/2 entries. High correlation indicates good clustering.<\/span><\/p>\n<\/div>\n<div>\n<p>&nbsp;<\/p>\n<p>Given Distance Matrix D <em>= {d<\/em><em>11<\/em><em>,d<\/em><em>12<\/em><em>, \u2026, d<\/em><em>nn<\/em> <em>}<\/em> and Incidence Matrix <em>C= { c<\/em><em>11<\/em><em>,<\/em><em>c<\/em><em>12<\/em><em>,\u2026, c<\/em><em>nn<\/em><em> } <\/em>.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Correlation <em>r<\/em> <\/strong>between D and C is given by<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-550\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37.png\" alt=\"\" width=\"407\" height=\"177\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37.png 407w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37-300x130.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37-65x28.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37-225x98.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-37-350x152.png 350w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>This is not a good measure for some density or contiguity based clusters.<\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Correlation of incidence and proximity matrices for the K-means clustering of two data sets with different values is shown in Figure 25.10.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-551\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38.png\" alt=\"\" width=\"583\" height=\"206\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38.png 583w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38-300x106.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38-65x23.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38-225x80.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-38-350x124.png 350w\" sizes=\"auto, (max-width: 583px) 100vw, 583px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.10. Correlation Values Using Distance Matrix 25.7.1 Using Similarity Matrix for Cluster Validation<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">We can order the similarity matrix with respect to cluster labels and inspect visually. This is shown in Figure 25.11 which is a good clustering. Clusters in random data are not so crisp and is shown in Figure 25.12.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-552\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39.png\" alt=\"\" width=\"471\" height=\"154\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39.png 471w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39-300x98.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39-65x21.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39-225x74.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-39-350x114.png 350w\" sizes=\"auto, (max-width: 471px) 100vw, 471px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.11 Good Clustering<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-553\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40.png\" alt=\"\" width=\"556\" height=\"145\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40.png 556w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40-300x78.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40-65x17.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40-225x59.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-40-350x91.png 350w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.12Example of Clustering<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.8 Statistical Framework for SSE<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Now let us discuss some statistical aspects. Now let us consider the example where we compare the SSE (discussed previously) of 0.005 against three clusters in random data. The figure shows the SSE Histogram of 500 sets of random data points of size 100 distributed over the range 0.2 \u2013 0.8 for x and y values.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-554\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41.png\" alt=\"\" width=\"493\" height=\"266\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41.png 493w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41-300x162.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41-65x35.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41-225x121.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-41-350x189.png 350w\" sizes=\"auto, (max-width: 493px) 100vw, 493px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Correlation of incidence and distance matrices for the K-means of the following two data sets and the Histogram is shown in Figure 25.14.<\/p>\n<\/div>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-555\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42.png\" alt=\"\" width=\"582\" height=\"200\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42.png 582w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42-300x103.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42-65x22.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42-225x77.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-42-350x120.png 350w\" sizes=\"auto, (max-width: 582px) 100vw, 582px\" \/><\/p>\n<p style=\"text-align: center\"><strong>Figure 25.14 Histogram of Correlation with K means 25.8.1 Empirical p-value<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Another measure of correlation is the empirical p-value. If we have a measurement v (e.g., the SSE value) and we have N measurements on random datasets, the empirical p-value is the fraction of measurements in the random data that have value less or equal than value v (or greater or equal if we want to maximize), in other words the value in the random dataset is at least as good as that in the real data. We usually require that p-value \u2264 0.05. However it is difficult to know the right notion of a random dataset.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>25.8.2 Hyper Geometric Distribution<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">The next two measures of correlation or association are defined in terms of genes in a random data set. Given that the total number of genes in the data set associated with term T is M, if we randomly draw n genes from the data set N, the probability that m of the selected n genes will be associated with T is given as<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-556\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43.png\" alt=\"\" width=\"449\" height=\"166\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43.png 449w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43-300x111.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43-65x24.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43-225x83.png 225w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-43-350x129.png 350w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/p>\n<p><strong>25.8.3 P-Value<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify\">Based on Hyper-geometric distribution given above, the probability of having m genes or fewer associated to T in N can be calculated by summing the probabilities of a random list of N genes having 1, 2, \u2026, m genes associated to T. So the p-value of over-representation is as follows:<\/p>\n<\/div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-557\" src=\"http:\/\/csp15.epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44.png\" alt=\"\" width=\"345\" height=\"159\" srcset=\"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44.png 345w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44-300x138.png 300w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44-65x30.png 65w, https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-content\/uploads\/sites\/65\/2019\/01\/2-44-225x104.png 225w\" sizes=\"auto, (max-width: 345px) 100vw, 345px\" \/><\/p>\n<p><strong>Summary<\/strong><\/p>\n<ul>\n<li>Explained the different aspects of Cluster Validity and the Cluster Validation Process<\/li>\n<li>Discussed the roles of the different Measures in determining Cluster Validity<\/li>\n<li>Explained External, Internal and the Statistical Framework used for determining Cluster Validity<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>you can view video on Cluster Analysis and Cluster Validity<\/strong><\/td>\n<td><a href=\"https:\/\/youtu.be\/O7EzPyET4IY\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-120\" src=\"http:\/\/epgpbooks.inflibnet.ac.in\/wp-content\/uploads\/2018\/11\/download.png\" alt=\"\" width=\"36\" height=\"36\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Web Links<\/strong><\/p>\n<ul>\n<li>cs.uef.fi\/sipu\/pub\/qinpei-thesis.pdf<\/li>\n<li>http:\/\/dl.acm.org\/citation.cfm?id=565124&amp;dl=ACM&amp;coll=DL&amp;CFID=714642446&amp;CFTOK EN=70781438<\/li>\n<li>http:\/\/sigmod.org\/publications\/sigmod-record\/0209\/a1.partii_clvalidity1.pdf<\/li>\n<li>www.airccse.org\/journal\/ijcses\/papers\/1110ijcses07.pdf<\/li>\n<li>uniobuda.hu\/conferences\/mtn2005\/KovacsFerenc.pdf<\/li>\n<li>www.cs.kent.edu\/~jin\/DM08\/ClusterValidation.pdf<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><strong>Supporting &amp; Reference Materials<\/strong><\/p>\n<ul>\n<li>A Bounded Index for Cluster ValiditySandro Saitta, Benny Raphael, Ian F. C. Smith, LNCS 2007<\/li>\n<li>Cluster Analysis, 5th Edition <a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Brian+S.+Everitt\">Brian S. Everitt, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Sabine+Landau\">Sabine Landau, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Morven+Leese\">MorvenLeese, <\/a><a href=\"http:\/\/as.wiley.com\/WileyCDA\/Section\/id-302477.html?query=Daniel+Stahl\">Daniel <\/a>StahlJanuary 2011, \u00a92010<\/li>\n<li>Sum-of-Squares Based Cluster Validity Index and Significance Analysis, Qinpei Zhao, Mantao Xu, Pasi Fr\u00e4nti,2014<\/li>\n<\/ul>\n","protected":false},"author":3,"menu_order":24,"template":"","meta":{"pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"chapter-type":[],"contributor":[],"license":[],"class_list":["post-526","chapter","type-chapter","status-publish","hentry"],"part":3,"_links":{"self":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapters\/526","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapters"}],"about":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/wp\/v2\/types\/chapter"}],"author":[{"embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/wp\/v2\/users\/3"}],"version-history":[{"count":7,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapters\/526\/revisions"}],"predecessor-version":[{"id":561,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapters\/526\/revisions\/561"}],"part":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/parts\/3"}],"metadata":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapters\/526\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/wp\/v2\/media?parent=526"}],"wp:term":[{"taxonomy":"chapter-type","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/pressbooks\/v2\/chapter-type?post=526"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/wp\/v2\/contributor?post=526"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/ebooks.inflibnet.ac.in\/csp15\/wp-json\/wp\/v2\/license?post=526"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}