2018.2.13

2018.2.13

# DBSCAN begins
db = cluster.DBSCAN(eps=0.1011, min_samples=115, n_jobs=-1)
db.fit(first_set)
r = pd.concat([first_set, pd.Series(db.labels_, index=first_set.index)], axis=1)
r.columns = list(first_set.columns) + [u'聚类类别']
# print(r)
r.to_excel("../output/dbscanSet_1.xlsx")
p_labels = list(db.labels_)
with open(scoreFile, "a") as sf:
    sf.write("By DBSCAN, the f-m_score of Set_1 is: " + str(
        metrics.fowlkes_mallows_score(tLabel, p_labels)) + "\n")
    sf.write("By DBSCAN, the rand_score of Set_1 is: " + str(
        metrics.adjusted_rand_score(tLabel, p_labels)) + "\n")

2018.2.13_第1张图片

你可能感兴趣的:(琉璃神社)