当前位置: 首页>>代码示例>>Python>>正文


Python hierarchy.is_monotonic函数代码示例

本文整理汇总了Python中scipy.cluster.hierarchy.is_monotonic函数的典型用法代码示例。如果您正苦于以下问题:Python is_monotonic函数的具体用法?Python is_monotonic怎么用?Python is_monotonic使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_monotonic函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_is_monotonic_iris_linkage

 def test_is_monotonic_iris_linkage(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # Iris data set. Expecting True.
     X = eo['iris']
     Y = pdist(X)
     Z = linkage(X, 'single')
     self.assertTrue(is_monotonic(Z) == True)
开发者ID:FrankZhao66,项目名称:scipy,代码行数:7,代码来源:test_hierarchy.py

示例2: test_is_monotonic_Q_linkage

 def test_is_monotonic_Q_linkage(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # Q data set. Expecting True.
     X = hierarchy_test_data.Q_X
     Z = linkage(X, 'single')
     self.assertTrue(is_monotonic(Z) == True)
开发者ID:abudulemusa,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例3: test_is_monotonic_tdist_linkage2

 def test_is_monotonic_tdist_linkage2(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # tdist data set. Perturbing. Expecting False.
     Z = linkage(hierarchy_test_data.ytdist, 'single')
     Z[2,2] = 0.0
     self.assertTrue(is_monotonic(Z) == False)
开发者ID:abudulemusa,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例4: test_is_monotonic_tdist_linkage1

 def test_is_monotonic_tdist_linkage1(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # tdist data set. Expecting True.
     Z = linkage(hierarchy_test_data.ytdist, 'single')
     self.assertTrue(is_monotonic(Z) == True)
开发者ID:abudulemusa,项目名称:scipy,代码行数:5,代码来源:test_hierarchy.py

示例5: test_is_monotonic_3x4_F3

 def test_is_monotonic_3x4_F3(self):
     # Tests is_monotonic(Z) on 3x4 linkage (case 3). Expecting False
     Z = np.asarray([[0, 1, 0.3, 2],
                     [2, 3, 0.4, 2],
                     [4, 5, 0.2, 4]], dtype=np.double)
     self.assertTrue(is_monotonic(Z) == False)
开发者ID:abudulemusa,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例6: test_is_monotonic_3x4_T

 def test_is_monotonic_3x4_T(self):
     # Tests is_monotonic(Z) on 3x4 linkage. Expecting True.
     Z = np.asarray([[0, 1, 0.3, 2],
                     [2, 3, 0.4, 2],
                     [4, 5, 0.6, 4]], dtype=np.double)
     self.assertTrue(is_monotonic(Z) == True)
开发者ID:abudulemusa,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例7: test_is_monotonic_2x4_F

 def test_is_monotonic_2x4_F(self):
     # Tests is_monotonic(Z) on 2x4 linkage. Expecting False.
     Z = np.asarray([[0, 1, 0.4, 2],
                     [2, 3, 0.3, 3]], dtype=np.double)
     self.assertTrue(is_monotonic(Z) == False)
开发者ID:abudulemusa,项目名称:scipy,代码行数:5,代码来源:test_hierarchy.py

示例8: test_is_monotonic_1x4

 def test_is_monotonic_1x4(self):
     # Tests is_monotonic(Z) on 1x4 linkage. Expecting True.
     Z = np.asarray([[0, 1, 0.3, 2]], dtype=np.double)
     self.assertTrue(is_monotonic(Z) == True)
开发者ID:abudulemusa,项目名称:scipy,代码行数:4,代码来源:test_hierarchy.py

示例9: test_is_monotonic_3x4_F2

 def test_is_monotonic_3x4_F2(self):
     # Tests is_monotonic(Z) on 3x4 linkage (case 2). Expecting False.
     Z = np.asarray([[0, 1, 0.8, 2],
                     [2, 3, 0.4, 2],
                     [4, 5, 0.6, 4]], dtype=np.double)
     assert_equal(is_monotonic(Z), False)
开发者ID:alchemyst,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例10: test_is_monotonic_2x4_T

 def test_is_monotonic_2x4_T(self):
     # Tests is_monotonic(Z) on 2x4 linkage. Expecting True.
     Z = np.asarray([[0, 1, 0.3, 2],
                     [2, 3, 0.4, 3]], dtype=np.double)
     assert_equal(is_monotonic(Z), True)
开发者ID:alchemyst,项目名称:scipy,代码行数:5,代码来源:test_hierarchy.py

示例11: Monotone

def Monotone(X):
	return clust.is_monotonic(X)
开发者ID:TadMC,项目名称:SSAE_Catalog,代码行数:2,代码来源:met_funcs.py

示例12: test_is_monotonic_Q_linkage

 def test_is_monotonic_Q_linkage(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # Q data set. Expecting True.
     X = hierarchy_test_data.Q_X
     Z = linkage(X, "single")
     assert_equal(is_monotonic(Z), True)
开发者ID:Kitchi,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例13: test_is_monotonic_tdist_linkage2

 def test_is_monotonic_tdist_linkage2(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # tdist data set. Perturbing. Expecting False.
     Z = linkage(hierarchy_test_data.ytdist, "single")
     Z[2, 2] = 0.0
     assert_equal(is_monotonic(Z), False)
开发者ID:Kitchi,项目名称:scipy,代码行数:6,代码来源:test_hierarchy.py

示例14: test_is_monotonic_tdist_linkage1

 def test_is_monotonic_tdist_linkage1(self):
     # Tests is_monotonic(Z) on clustering generated by single linkage on
     # tdist data set. Expecting True.
     Z = linkage(hierarchy_test_data.ytdist, "single")
     assert_equal(is_monotonic(Z), True)
开发者ID:Kitchi,项目名称:scipy,代码行数:5,代码来源:test_hierarchy.py


注:本文中的scipy.cluster.hierarchy.is_monotonic函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。