Clustering Algorithm Summary

Source: Internet
Author: User

Recently, we want to build a clustering project on spark, with a large amount of data and classes. The kmeans effect is acceptable, but it is a little slow, so I re-read the common algorithms.


Kmeans
Attention: init Centers (randomize vs kmeans ++)

Mini-Batch kmeans
Loops: random samples; find closest for all; update centers for each

Mean Shift
Init: Get centers by bandwidth
Loops: Find neighbors of centers; update centers; dedup

AP Cluster
Init: Get S; Rik = 0, AIK = 0
Loops: Rik = Sik-max_k '! = K (AIK '+ Sik'); AIK = min (0, rkk + sum_ I '! = I, K max (0, RI 'K); Akk = sum_ I '! = K max (0, RI 'K)
End: For any I, max_k rik + AIK as it's exemplar

Spectral clustering
Steps: similarity Matrix s; S = uv; kmeans of u

Ward hierarchical
Init: each sample as center
Loops: merge to minimize RMSE within clusters

DBSCAN
Init: Get densest core samples
Loops: get more core samples nearby old samples

In fact, scikit-learn implements many algorithms, and there are also ready-made datasets that can be used for experiments. For example: there are some http://scikit-learn.org/stable/modules/clustering.html, and algorithm expansion description.

A comparison of the clustering algorithms in scikit-learn



Method Name Parameters Scalability Usecase Geometry (metric used)
K-means Number of clusters Very largeN_samples, MediumN_clustersWithMinibatch code General-purpose, even cluster size, flat geometry, not too many ters Distances between points
Affinity propagation Damping, sample preference Not scalable with n_samples Many clusters, uneven cluster size, non-flat Geometry Graph distance (e.g. nearest-neighbor graph)
Mean-shift Bandwidth Not scalableN_samples Many clusters, uneven cluster size, non-flat Geometry Distances between points
Spectral clustering Number of clusters MediumN_samples, SmallN_clusters Few clusters, even cluster size, non-flat Geometry Graph distance (e.g. nearest-neighbor graph)
Ward hierarchical clustering Number of clusters LargeN_samplesAndN_clusters Many clusters, possibly connectivity constraints Distances between points
Agglomerative Clustering Number of clusters, linkage type, distance LargeN_samplesAndN_clusters Many clusters, possibly connectivity constraints, Non Euclidean distances Any pairwise distance
DBSCAN Neighborhood Size Very largeN_samples, MediumN_clusters Non-flat geometry, uneven cluster sizes Distances between nearest points
Gaussian mixtures Bytes Not scalable Flat geometry, good for Density Estimation Mahalanobis distances to centers

Clustering Algorithm Summary

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.