nbclust package finding the relevant number of clusters
play

NbClust Package : finding the relevant number of clusters in a - PowerPoint PPT Presentation

Introduction NbClust package Examples Conclusion NbClust Package : finding the relevant number of clusters in a dataset Malika Charrad, Nadia Ghazzali, V eronique Boiteau, Azam Niknafs Laval University, Quebec, Canada June 13th, 2012


  1. Introduction NbClust package Examples Conclusion NbClust Package : finding the relevant number of clusters in a dataset Malika Charrad, Nadia Ghazzali, V´ eronique Boiteau, Azam Niknafs Laval University, Quebec, Canada June 13th, 2012 UseR !2012, Nashville NbClust Package

  2. Introduction NbClust package Examples Conclusion Outline 1 Introduction 2 NbClust package 3 Examples 4 Conclusion UseR !2012, Nashville NbClust Package

  3. Introduction NbClust package Examples Conclusion Outline 1 Introduction 2 NbClust package 3 Examples 4 Conclusion UseR !2012, Nashville NbClust Package

  4. Introduction NbClust package Examples Conclusion Introduction Clustering is the task of assigning a set of objects into groups (clusters) so that the objects in the same cluster are more similar to each other than objects in other clusters. Most of the clustering algorithms depend on input parameters such as the number of clusters , the minimum number of objects in a cluster, or the diameter of a cluster .. ⇒ The selection of different parameters leads to different clusters of data. UseR !2012, Nashville NbClust Package

  5. Introduction NbClust package Examples Conclusion How many clusters are there in the dataset ? UseR !2012, Nashville NbClust Package

  6. Introduction NbClust package Examples Conclusion How to select the best number of clusters in a dataset ? If the clustering algorithm parameters are assigned improper values, the clustering method may result in a partitioning scheme that’s not optimal ⇒ Wrong decisions. The user is faced with the dilemma of selecting the number of clusters in the dataset. The problem of deciding the number of clusters better fitting a dataset as well as the evaluation of the clustering results is known under the term cluster validity . UseR !2012, Nashville NbClust Package

  7. Introduction NbClust package Examples Conclusion Related work (Milligan and Cooper, 1985) examined 30 indices with simulated data. There are other criteria which were not examined in Milligan and Cooper study such as : Dunn index (Dunn, 1974) Silhouette statistic (Rousseeuw, 1987) Gap statistic (Tibshirani, 2001) Dindex (Lebart, 2000) SD index and SDbw index (Halkidi et al., 2000, 2001) Statistic of Hubert ((Hubert and Arabie, 1985)) UseR !2012, Nashville NbClust Package

  8. Introduction NbClust package Examples Conclusion Related work ⇒ 19 among all existing indices are implemented in SAS and R packages : cclust , clusterSim , clv and clvalid . UseR !2012, Nashville NbClust Package

  9. Introduction NbClust package Examples Conclusion 1 Introduction 2 NbClust package 3 Examples 4 Conclusion UseR !2012, Nashville NbClust Package

  10. Introduction NbClust package Examples Conclusion NbClust package 1. NbClust package provides 30 indices to determine the number of clusters : 11 other indices : ”duda” Duda and Hart (1973) ”beale” Beale (1969) ”gplus” Rohlf (1974), Milligan (1981) ”frey” Frey and Van Groenewoud (1972) ”tau” Rohlf (1974), Milligan (1981) ”mcclain” McClain and Rao (1975), ”gap” Tibshirani (2001), ”dindex” Lebart (2000), ”hubert” Hubert and Arabie (1985), ”sdindex” Halkidi et al. (2000), ”sdbw” Halkidi et al. (2001). 2. NbClust offers the user the best clustering scheme among different results. UseR !2012, Nashville NbClust Package

  11. Introduction NbClust package Examples Conclusion NbClust function NbClust(data, diss=”NULL”, distance=”euclidean”, min.nc=2, max.nc=15, method=”ward”, index=”all”, alphaBeale=0.1) Arguments : data matrix or data set diss dissimilarity matrix to be used. By default, diss=”NULL”, but if it is replaced by a dissimilarity matrix, distance should be ”NULL”. distance the distance measure to be used to compute the dissimilarity matrix. This must be one of : ”euclidean” , ”maximum” , ”manhattan” , ”canberra” , ”binary” , ”minkowski” or ”NULL”. UseR !2012, Nashville NbClust Package

  12. Introduction NbClust package Examples Conclusion NbClust function NbClust(data, diss=”NULL”, distance=”euclidean”, min.nc=2, max.nc=15, method=”ward”, index=”all”, alphaBeale=0.1) Arguments : min.nc minimum number of clusters, between 2 and (number of objects - 1). max.nc maximum number of clusters, between 2 and (number of objects - 1), greater or equal to min.nc. method the cluster analysis method to be used. Available methods are : ”ward” , ”single” , ”complete” , ”average” , ”mcquitty” , ”median” , ”centroid” ”kmeans” UseR !2012, Nashville NbClust Package

  13. Introduction NbClust package Examples Conclusion NbClust function Nb.clusters(data, diss=”NULL”, distance=”euclidean”, min.nc=2, max.nc=15, method=”ward”, index=”all”, alphaBeale=0.1) Arguments : index the index to be calculated. This should be one of : ”kl” , ”ch” , ”hartigan” , ”ccc” , ”scott” , ”marriot” , ”trcovw” , ”tracew” , ”friedman” , ”rubin” , ”cindex” , ”db” , ”silhouette” , ”duda” , ”pseudot2” , ”beale” , ”ratkowsky” , ”ball” , ”ptbiserial” , ”gap” , ”frey” , ”mcclain” , ”gamma” , ”gplus” , ”tau” , ”dunn” , ”hubert” , ”sdindex” , ”dindex” , ”sdbw” , ”alllong” : all indices included ”all” : all indices except GAP, Gamma, Gplus and Tau. alphaBeale significance value for Beale’s index. UseR !2012, Nashville NbClust Package

  14. Introduction NbClust package Examples Conclusion 1 Introduction 2 NbClust package 3 Examples 4 Conclusion UseR !2012, Nashville NbClust Package

  15. Introduction NbClust package Examples Conclusion Example1 : Simulated dataset with 2 variables and 4 clusters UseR !2012, Nashville NbClust Package

  16. Introduction NbClust package Examples Conclusion NbClust output : Gap index UseR !2012, Nashville NbClust Package

  17. Introduction NbClust package Examples Conclusion NbClust output : ”alllong” option [All.index] Values of indices for each partition of the dataset obtained with a number of clusters between min.nc and max.nc . UseR !2012, Nashville NbClust Package

  18. Introduction NbClust package Examples Conclusion NbClust output : Critical values [All.CriticalValues] Critical values of some indices for each partition obtained with a number of clusters between min.nc and max.nc . UseR !2012, Nashville NbClust Package

  19. Introduction NbClust package Examples Conclusion NbClust output : Best number of clusters [Best.nc] Best number of clusters proposed by each index and the corresponding index value. UseR !2012, Nashville NbClust Package

  20. Introduction NbClust package Examples Conclusion NbClust output : Best number of clusters UseR !2012, Nashville NbClust Package

  21. Introduction NbClust package Examples Conclusion NbClust output : Hubert index and Dindex UseR !2012, Nashville NbClust Package

  22. Introduction NbClust package Examples Conclusion NbClust output : Hubert index and Dindex UseR !2012, Nashville NbClust Package

  23. Introduction NbClust package Examples Conclusion Example2 : Iris dataset (Fisher 1936) Iris dataset is composed of 3 species : ”Setosa”, ”Virginica” and ”Versicolor” UseR !2012, Nashville NbClust Package

  24. Introduction NbClust package Examples Conclusion Clustering of Iris dataset (1) UseR !2012, Nashville NbClust Package

  25. Introduction NbClust package Examples Conclusion Clustering of Iris dataset (2) UseR !2012, Nashville NbClust Package

  26. Introduction NbClust package Examples Conclusion Clustering of Iris dataset (3) UseR !2012, Nashville NbClust Package

  27. Introduction NbClust package Examples Conclusion 1 Introduction 2 NbClust package 3 Examples 4 Conclusion UseR !2012, Nashville NbClust Package

  28. Introduction NbClust package Examples Conclusion How to decide on the correct number of clusters ? UseR !2012, Nashville NbClust Package

  29. Introduction NbClust package Examples Conclusion How to decide on the correct number of clusters ? 1. Majority rule : User can select the number of clusters proposed by the majority of indices. ex : 4 in 1st example and 3 in 2nd example. 2. User can consider only indices that performed best in simulations studies. Top-5 indices in Milligan and Cooper study are : CH index, Duda index, Cindex, Gamma and Beale index. UseR !2012, Nashville NbClust Package

  30. Introduction NbClust package Examples Conclusion Conclusion NbClust package provides a large list of indices, many of them are not implemented anywhere. The current version contains up to 30 indices. NbClust package permits the user to simultaneously vary the number of clusters, the clustering method and the indices to decide how best to group observations in his dataset or to compare all indices or clustering methods. NbClust package is available at http ://cran.r-project.org/web/packages/NbClust/index.html UseR !2012, Nashville NbClust Package

  31. Introduction NbClust package Examples Conclusion Thank you ! UseR !2012, Nashville NbClust Package

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend