R/show_clusters.R
show_clusters.Rd
This function reduces a data set to 2 dimensions using principle component analysis (PCA) and colours clusters of points.
show_clusters(X, clusters, centroids)
X | array Data points of dimension (n,d) |
---|---|
clusters | array Cluster assignments for each point in X, dimension (n,1) |
centroids | array Coordinates of cluster centers, dimension (k,d) |
plot A 2d principal components scatter plot coloured by cluster