本文簡要介紹 python 語言中 scipy.cluster.hierarchy.inconsistent
的用法。
用法:
scipy.cluster.hierarchy.inconsistent(Z, d=2)#
計算鏈接矩陣的不一致性統計量。
- Z: ndarray
linkage
文檔。 由 4 個矩陣編碼鏈接(分層聚類)。有關其形式的更多信息,請參閱- d: 整數,可選
每個非單例集群下最多 d 級的鏈接數。
- R: ndarray
一個
i
'th 行包含非單例集群i
的鏈接統計信息。鏈接統計信息是在集群i
之下的鏈接 級別的鏈接高度上計算的。R[i,0]
和R[i,1]
分別是鏈接高度的均值和標準差;R[i,2]
是計算中包含的鏈接數;而R[i,3]
是不一致係數, by 4 矩陣,其中
參數 ::
返回 ::
注意:
此函數的行為類似於 MATLAB(TM)
inconsistent
函數。例子:
>>> from scipy.cluster.hierarchy import inconsistent, linkage >>> from matplotlib import pyplot as plt >>> X = [[i] for i in [2, 8, 0, 4, 1, 9, 9, 0]] >>> Z = linkage(X, 'ward') >>> print(Z) [[ 5. 6. 0. 2. ] [ 2. 7. 0. 2. ] [ 0. 4. 1. 2. ] [ 1. 8. 1.15470054 3. ] [ 9. 10. 2.12132034 4. ] [ 3. 12. 4.11096096 5. ] [11. 13. 14.07183949 8. ]] >>> inconsistent(Z) array([[ 0. , 0. , 1. , 0. ], [ 0. , 0. , 1. , 0. ], [ 1. , 0. , 1. , 0. ], [ 0.57735027, 0.81649658, 2. , 0.70710678], [ 1.04044011, 1.06123822, 3. , 1.01850858], [ 3.11614065, 1.40688837, 2. , 0.70710678], [ 6.44583366, 6.76770586, 3. , 1.12682288]])
相關用法
- Python SciPy hierarchy.is_isomorphic用法及代碼示例
- Python SciPy hierarchy.is_valid_im用法及代碼示例
- Python SciPy hierarchy.is_monotonic用法及代碼示例
- Python SciPy hierarchy.is_valid_linkage用法及代碼示例
- 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.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.num_obs_linkage用法及代碼示例
- Python SciPy hierarchy.complete用法及代碼示例
- Python SciPy hierarchy.linkage用法及代碼示例
- Python SciPy hierarchy.maxdists用法及代碼示例
- Python SciPy hierarchy.centroid用法及代碼示例
- Python SciPy hierarchy.single用法及代碼示例
- Python SciPy hierarchy.cophenet用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.cluster.hierarchy.inconsistent。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。