python机器学习API介绍20: 密度聚类及其用法( 四 )

APIs = [

core_nums = [

for epsilon in epsilons:

clst = cluster.DBSCAN(eps=epsilon)

predicted_labels = clst.fit_predict(x)

APIs.append(adjusted_rand_score(labels_true predicted_labels))

core_nums.append(len(clst.core_sample_indices_))

#绘图

fig = plt.figure()

ax = fig.add_subplot(121)

ax.plot(core_nums APIs marker=\"+\")

ax.set_xscale(\"log\")

ax.set_xlabel(\"epsilon\")

ax.set_ylim(01)

ax.set_ylabel(\"DBSCAN API\")

推荐阅读