本文簡要介紹 python 語言中 scipy.cluster.hierarchy.num_obs_linkage
的用法。
用法:
scipy.cluster.hierarchy.num_obs_linkage(Z)#
返回傳遞的鏈接矩陣的原始觀察數。
- Z: ndarray
執行操作的鏈接矩陣。
- n: int
鏈接中的原始觀察數。
參數 ::
返回 ::
例子:
>>> from scipy.cluster.hierarchy import ward, num_obs_linkage >>> from scipy.spatial.distance import pdist
>>> X = [[0, 0], [0, 1], [1, 0], ... [0, 4], [0, 3], [1, 4], ... [4, 0], [3, 0], [4, 1], ... [4, 4], [3, 4], [4, 3]]
>>> Z = ward(pdist(X))
Z
是使用 Ward 聚類方法與X
後得到的鏈接矩陣,該數據集包含 12 個數據點。>>> num_obs_linkage(Z) 12
相關用法
- Python SciPy hierarchy.ward用法及代碼示例
- Python SciPy hierarchy.maxRstat用法及代碼示例
- Python SciPy hierarchy.set_link_color_palette用法及代碼示例
- Python SciPy hierarchy.fclusterdata用法及代碼示例
- Python SciPy hierarchy.median用法及代碼示例
- Python SciPy hierarchy.DisjointSet用法及代碼示例
- Python SciPy hierarchy.correspond用法及代碼示例
- Python SciPy hierarchy.is_isomorphic用法及代碼示例
- Python SciPy hierarchy.optimal_leaf_ordering用法及代碼示例
- Python SciPy hierarchy.maxinconsts用法及代碼示例
- Python SciPy hierarchy.cut_tree用法及代碼示例
- Python SciPy hierarchy.fcluster用法及代碼示例
- Python SciPy hierarchy.to_tree用法及代碼示例
- Python SciPy hierarchy.average用法及代碼示例
- Python SciPy hierarchy.dendrogram用法及代碼示例
- Python SciPy hierarchy.inconsistent用法及代碼示例
- Python SciPy hierarchy.complete用法及代碼示例
- Python SciPy hierarchy.linkage用法及代碼示例
- Python SciPy hierarchy.maxdists用法及代碼示例
- Python SciPy hierarchy.is_valid_im用法及代碼示例
- Python SciPy hierarchy.centroid用法及代碼示例
- Python SciPy hierarchy.single用法及代碼示例
- Python SciPy hierarchy.is_monotonic用法及代碼示例
- Python SciPy hierarchy.cophenet用法及代碼示例
- Python SciPy hierarchy.leaves_list用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.cluster.hierarchy.num_obs_linkage。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。