本文整理汇总了Python中sklearn.cluster.AffinityPropagation.append方法的典型用法代码示例。如果您正苦于以下问题:Python AffinityPropagation.append方法的具体用法?Python AffinityPropagation.append怎么用?Python AffinityPropagation.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sklearn.cluster.AffinityPropagation
的用法示例。
在下文中一共展示了AffinityPropagation.append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: spectral
# 需要导入模块: from sklearn.cluster import AffinityPropagation [as 别名]
# 或者: from sklearn.cluster.AffinityPropagation import append [as 别名]
)
elif AUXILIAR_METHOD == "spectral":
nparts = spectral(get_number_of_clusters(dataset_now, DT_MAP["NUM_CLUSTERS"]), sim_h)
elif AUXILIAR_METHOD == "all":
nparts = []
for metric in SIM_METRIC:
for desc in VISUAL_DESCRIPTORS:
h = [h for h in header if re.match(desc + "\d+$", h)]
# Agglomerative
sim_h = create_similarity_matrix(dataset_now, h, metric)
nclusters = get_number_of_clusters(dataset_now, DT_MAP["NUM_CLUSTERS"])
nparts.append(agglomerative(nclusters, sim_h, dataset_now, header))
try:
# Spectral
nparts.append(spectral(nclusters, sim_h))
except ValueError:
print "Ignoring spectral"
# Metis
G = createGraph(sim_h, SIM_KEEP_ABOVE, GRAPH_RULE)
nparts.append(metis_clusters(G, DT_MAP["NUM_CLUSTERS"]))
# nparts.append( AffinityPropagation(convergence_iter=20, damping=0.50, max_iter=500, verbose=True).fit_predict(sim_h) )
if USE_TEXT_SIM:
print "USING TEXT SIM"
textSimDT_now = textSimDT[textSimDT["tid"] == topic_map[poi]]
sim_h = get_text_similarity(textSimDT_now, ids)