úÎ0,¡<      !"#$%&'()*+,-./0123456789:;None:rearrange the rows of a matrix(c) 2015 Kai ZhangMITkai@kzhang.org experimentalportableNone  Different initialization methodspThe Forgy method randomly chooses k unique observations from the data set and uses these as the initial means.K-means++ algorithm.Provide a set of k centroidsResults from running kmeansYA vector of integers (0 ~ k-1) indicating the cluster to which each point is allocated.A matrix of cluster centers. !Seed for random number generation/Wether to return clusters, may use a lot memory      None:<RGenerate N non-duplicated uniformly distributed random variables in a given range.The number of clusters Input dataFeature extraction functionThe number of clusters Input dataFeature extraction function<<None:Perform K-means clustering?Perform K-means clustering, using a feature extraction function=K-means algorithm>.Assign data to clusters based on KMeans resultThe number of clusters%Input data stored as rows in a matrixThe number of clusters Input data=Initial set of k centroids Input dataFeature extraction function>    =>None$O(1) Return the size of a dendrogram!compute distance matrix"#compute distance matrix in parallel !"#$  !"  !"  !"#$(c) 2015 Kai ZhangMITkai@kzhang.org experimentalportableNone( nearest neighbor chain algorithm)^all update functions perform destructive updates, and hence should not be called by end userssingle linkage update formula*complete linkage update formula+average linkage update formula,weighted linkage update formula-ward linkage update formula ?@(Adistance matrixquery;this would be selected if it achieves the minimal distance)*+,-()*+,-()*+,- ?@(A)*+,-(c) 2015 Kai ZhangMITkai@kzhang.org experimentalportableNone:.*Different hierarchical clustering schemes./>O(n^2) Single linkage, $d(A,B) = min_{a in A, b in B} d(a,b)$.0@O(n^2) Complete linkage, $d(A,B) = max_{a in A, b in B} d(a,b)$.1YO(n^2) Average linkage or UPGMA, $d(A,B) = frac{sum_{a in A}sum_{b in B}d(a,b)}{|A||B|}$.2O(n^2) Weighted linkage.3O(n^2) Ward's method.4)O(n^3) Centroid linkage, not implemented.5'O(n^3) Median linkage, not implemented.6 Perform hierarchical clustering.7!Cut a dendrogram at given height.81Return the elements of a dendrogram in pre-order.9%2-dimensional drawing of a dendrogram:.Compute euclidean distance between two points.;Hamming distance../0123456789:;./0123456789:;./0123456789:;./0123456789:;B       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFG'clustering-0.3.0-5AYpUVbdaojEp6vKBYWdfiAI.Clustering.UtilsAI.Clustering.KMeans.TypesAI.Clustering.KMeans.InternalAI.Clustering.KMeans AI.Clustering.Hierarchical.Types#AI.Clustering.Hierarchical.InternalAI.Clustering.HierarchicalorderByMethodForgyKMeansPPCentersKMeans membershipcentersclusters KMeansOpts kmeansMethod kmeansSeedkmeansClustersdefaultKMeansOpts $fShowKMeansforgykmeansPP sumSquareskmeanskmeansBy DistanceMat DendrogramLeafBranchSizeDistFnDistancesize!idx computeDists computeDists'$fFunctorDendrogram$fBinaryDendrogram$fShowDendrogram$fEqDendrogram$fShowDistanceMatnnChainsinglecompleteaverageweightedwardLinkageSingleCompleteAverageWeightedWardCentroidMedianhclustcutAtflattendrawDendrogram euclideanhamming uniformRNkmeans'decode DistUpdateFn ActiveNodeSetnearestNeighbor