コード例 #1
0
 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)
コード例 #2
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #3
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #4
0
 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(_ytdist, 'single')
     Z[2,2] = 0.0
     self.assertTrue(is_monotonic(Z) == False)
コード例 #5
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
コード例 #6
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
     assert_equal(is_monotonic(Z), False)
コード例 #7
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
     assert_equal(is_monotonic(Z), False)
コード例 #8
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #9
0
 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)
     self.assertTrue(is_monotonic(Z) == True)
コード例 #10
0
ファイル: met_funcs.py プロジェクト: TadMC/SSAE_Catalog
def Monotone(X):
	return clust.is_monotonic(X)
コード例 #11
0
ファイル: test_hierarchy.py プロジェクト: Kitchi/scipy
 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)
コード例 #12
0
ファイル: test_hierarchy.py プロジェクト: Kitchi/scipy
 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)
コード例 #13
0
ファイル: test_hierarchy.py プロジェクト: Kitchi/scipy
 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)
コード例 #14
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #15
0
 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)
     self.assertTrue(is_monotonic(Z) == False)
コード例 #16
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #17
0
ファイル: test_hierarchy.py プロジェクト: alchemyst/scipy
 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)
コード例 #18
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
     assert_equal(is_monotonic(Z), True)
コード例 #19
0
ファイル: test_hierarchy.py プロジェクト: alchemyst/scipy
 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)
コード例 #20
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
     assert_equal(is_monotonic(Z), True)
コード例 #21
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #22
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
コード例 #23
0
ファイル: test_hierarchy.py プロジェクト: abudulemusa/scipy
 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)
コード例 #24
0
ファイル: test_hierarchy.py プロジェクト: quintusdias/scipy
 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)
コード例 #25
0
 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(_ytdist, 'single')
     self.assertTrue(is_monotonic(Z) == True)