vampire.analysis.cluster_contours#
- vampire.analysis.cluster_contours(pc, n_clusters=5, n_pcs=20, random_state=None)[source]#
K-means clustering of contour principal components.
- Parameters:
- pcndarray
Principal components of contours.
- n_clustersint, optional
Number of clusters.
- n_pcsint, optional
Number of principal components used for approximation.
- random_stateNone or int, optional
Random state for K-means clustering.
- Returns:
- cluster_id_dfDataFrame
DataFrame of objects’ cluster id and min distance to centroid.
- centroidsndarray
Coordinates of cluster centers of K-means clusters.
- inertiafloat
Sum of squared distances of samples to their closest cluster center.
See also
sklearn.cluster.KMeansImplementation of K-means clustering.