def chc(X, K, params=()):
pnames = ['linkage_method', 'distance']
dflts = [ 'ward', 'euclidean']
if isinstance(params, np.ndarray):
paramsloc = params.tolist()
else:
paramsloc = params
(linkage_method, distance) = ds.resolveargumentpairs(pnames, dflts, paramsloc)
Z = sphc.linkage(X, method=linkage_method, metric=distance)
C = sphc.fcluster(Z, K, criterion='maxclust')
return clustVec2partMat(C, K)
# Other related functions
评论列表
文章目录