This is a repository for Clustering Algorithm in Machine Learning, including K-means, DBSCAN, Spectral clustering, Hierarchical Clustering and a video demo based on K_means.
- Select K initial centroids.
- Assign each data point to the nearest centroid, forming K clusters.
- Compute the centroid of each cluster.
- Repeat steps 2 and 3 until the centroids no longer change or the maximum number of iterations is reached.
- For each point, if the number of points within its neighborhood is greater than or equal to MinPts, mark it as a core point.
- For each core point, expand all directly density-reachable points to form a cluster.
- Repeat step 2 until all core points have been visited.
- Mark all non-core points as noise points.
- Treat each data point as a single cluster.
- Calculate the distance between all clusters and merge the two closest clusters.
- Repeat step 2 until all points are merged into a single cluster or the desired number of clusters is reached.
- Construct a similarity matrix (usually using k-nearest neighbors).
- Compute the eigenvalues and eigenvectors of the Laplacian matrix.
- Select the top k eigenvectors to form a new representation space.
- In the new representation space, use K-means clustering to form clusters.
These steps outline the fundamental logic and processes involved in each clustering algorithm.