大概是类间距除以类内距,因此这个值越大越好"""importmatplotlib.pyplot as pltfromsklearn.datasets.samples_generatorimportmake_blobsfromsklearn.clusterimportKMeansfromsklearnimportmetrics"""下面是生成一些样本数据 X为样本特征,Y为样本簇类别, 共1000个样本,每个样本2个特征,共4个簇,簇中心在[-1,-1], [0...
使⽤K-means进⾏聚类,⽤calinski_harabaz_score评价聚类效 果 代码如下:"""下⾯的⽅法是⽤kmeans⽅法进⾏聚类,⽤calinski_harabaz_score⽅法评价聚类效果的好坏 ⼤概是类间距除以类内距,因此这个值越⼤越好 """import matplotlib.pyplot as plt from sklearn.datasets.samples_generator ...