Clusteringof unlabeled data can be performed with the modulesklearn.cluster.
对没有打标签的数据进行聚类,可以使用sklearn的sklearn.cluster模块
Each clustering algorithm comes in two variants: a class, that implements thefitmethod to
每一个聚类算法具有两个变体:一类使用fit的方式,在训练数据上学习聚类;
learn the clusters on train data, and a function, that, given train data, returns an array of
一个功能,给定训练数据,返回数字标签。
integer labels corresponding to the different clusters. For the class, the labels over the training data can be found in thelabels_attribute.
对于这个聚类来说,标签数据在labels_
我的渣渣翻译~
Input data
One important thing to note is that the algorithms implemented in this module can take different kinds of matrix as input. All the methods accept standard data matrices of shape[n_samples,n_features]. These can be obtained from the classes in thesklearn.feature_extractionmodule. ForAffinityPropagation,SpectralClusteringandDBSCANone can also input similarity matrices of shape[n_samples,n_samples]. These can be obtained from the functions in thesklearn.metrics.pairwisemodule.
输入数据
需要注意一点:本算法可以使用不同种类的矩阵作为输入。标准的输入格式是[例子数,特征数]