本文整理汇总了Python中DBUtil.select_all_normalized_features方法的典型用法代码示例。如果您正苦于以下问题:Python DBUtil.select_all_normalized_features方法的具体用法?Python DBUtil.select_all_normalized_features怎么用?Python DBUtil.select_all_normalized_features使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBUtil
的用法示例。
在下文中一共展示了DBUtil.select_all_normalized_features方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DBSCAN
# 需要导入模块: import DBUtil [as 别名]
# 或者: from DBUtil import select_all_normalized_features [as 别名]
db = DBSCAN().fit(feature_vectors)
cluster_labels = db.labels_
result_folder_path = "../../results/dbscan/"
if not os.path.isdir(result_folder_path):
os.makedirs(result_folder_path)
with open(result_folder_path + "dbscan.txt", "w") as output:
for label in cluster_labels:
output.write(str(label) + "\n")
if __name__ == "__main__":
normalized_vectors = DBUtil.select_all_normalized_features()
normalized_vectors = numpy.asarray(normalized_vectors)
print "normalized_vectors:" + str(len(normalized_vectors))
for k in range(2, 101):
print k
kmeans_clustering(normalized_vectors, k)
# for W in range(20, 60, 10):
# print W
# single_linkage(normalized_vectors, W)
# _DBSCAN(normalized_vectors)