Clustering and unsupervised learning
Finding groups or structure in unlabelled data.
Edited by Alex C, EduAlx · Sources cited below
Explanation
k-means (Lloyd, 1957/1982) alternates assigning points to nearest centroids and recomputing centroids. Hierarchical clustering builds a dendrogram. DBSCAN finds density-based clusters and outliers. Dimensionality reduction (PCA, t-SNE, UMAP) visualises high-dimensional data, as in single-cell genomics.
Example
Code
from sklearn.cluster import KMeans labels = KMeans(n_clusters=4, n_init=10).fit_predict(X)
How it works, step by step
- Choose k and initial centroids
- Assign each point to its nearest centroid
- Recompute centroids
- Repeat until assignments stop changing
Open the interactive page with diagrams →
People behind it
- Stuart Lloyd
- Hugo Steinhaus
References
- S. P. Lloyd, IEEE Trans. Inf. Theory 1982, 28, 129–137.
Textbooks
- The Elements of Statistical Learning, Trevor Hastie, Robert Tibshirani, Jerome Friedman (Springer, 2nd ed. 2009; free PDF). Statistical learning reference.
- Pattern Recognition and Machine Learning, Christopher M. Bishop (Springer, 2006). Bayesian machine learning classic.
Related topics
Decision trees and ensemble methodsPython programming essentialsTesting and debuggingReinforcement learningHuman–computer interaction and usabilityNatural language processingError-detecting and error-correcting codesComputer vision and convolutional neural networksAlgorithms and Big-O complexitySearch engines and PageRank