Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个数据集,其中包含每一行的分类和数字特征。我想为每个特征(列)选择不同的相似度指标,并对数据进行层次聚类。有没有办法在 Matlab 中做到这一点?
是的,这实际上相当简单:linkage,它创建了树,将一个相异矩阵作为输入。因此,在下面的示例工作流程中
linkage
Y = pdist(X,'cityblock'); Z = linkage(Y,'average'); T = cluster(Z,'cutoff')
您只需将调用替换为pdist对您自己的函数的调用,该函数计算行之间的成对差异,其他一切都保持不变。
pdist