sklearn.cluster模块提供了常用的非监督聚类算法。
该模块中每一个聚类算法都有两个变体: 一个是类(class)另一个是函数(function)。 类实现了 fit 方法来从训练数据中学习聚类;函数接受训练数据返回对应于不同聚类的一个整数标签数组。 对类来说,训练过程得到的标签数据可以在属性 labels_ 中找到。
class | describe |
---|---|
cluster.AffinityPropagation ([damping, …]) | Perform Affinity Propagation Clustering of data. |
cluster.AgglomerativeClustering ([…]) | Agglomerative Clustering |
cluster.Birch ([threshold, branching_factor, …]) | Implements the Birch clustering algorithm. |
cluster.DBSCAN ([eps, min_samples, metric, …]) | Perform DBSCAN clustering from vector array or distance matrix. |
cluster.FeatureAgglomeration ([n_clusters, …]) | Agglomerate features. |
cluster.KMeans ([n_clusters, init, n_init, …]) | K-Means clustering |
cluster.MiniBatchKMeans ([n_clusters, init, …]) | Mini-Batch K-Means clustering |
cluster.MeanShift ([bandwidth, seeds, …]) | Mean shift clustering using a flat kernel. |
cluster.SpectralClustering ([n_clusters, …]) | Apply clustering to a projection to the normalized laplacian. |
functions | describe |
---|---|
cluster.affinity_propagation (S[, …]) | Perform Affinity Propagation Clustering of data |
cluster.dbscan (X[, eps, min_samples, …]) | Perform DBSCAN clustering from vector array or distance matrix. |
cluster.estimate_bandwidth (X[, quantile, …]) | Estimate the bandwidth to use with the mean-shift algorithm. |
cluster.k_means (X, n_clusters[, …]) | K-means clustering algorithm. |
cluster.mean_shift (X[, bandwidth, seeds, …]) | Perform mean shift clustering of data using a flat kernel. |
cluster.spectral_clustering (affinity[, …]) | Apply clustering to a projection to the normalized laplacian. |
cluster.ward_tree (X[, connectivity, …]) | Ward clustering based on a Feature matrix. |