Пример #1
0
 def test_russellrao(self):
     reference = cdist(self.Xb1, self.Xb2, metric='russellrao')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='russellrao')
     eq(reference, testing)
Пример #2
0
 def test_sokalsneath(self):
     reference = cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     eq(reference, testing)
Пример #3
0
 def test_mahalanobis_2(self):
     VI = np.random.randn(self.Xd1.shape[0], self.Xd1.shape[0])
     reference = cdist(self.Xd1, self.Xd2, metric='mahalanobis', VI=VI)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='mahalanobis', VI=VI)
     npt.assert_array_equal(reference, testing)
Пример #4
0
 def test_dice(self):
     reference = cdist(self.Xb1, self.Xb2, metric='dice')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='dice')
     eq(reference, testing)
Пример #5
0
 def test_canberra(self):
     reference = cdist(self.Xd1, self.Xd2, metric='canberra')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='canberra')
     npt.assert_array_equal(reference, testing)
Пример #6
0
 def test_dice(self):
     reference = cdist(self.Xb1, self.Xb2, metric='dice')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='dice')
     npt.assert_array_equal(reference, testing)
Пример #7
0
 def test_hamming_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='hamming')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='hamming')
     npt.assert_array_equal(reference, testing)
Пример #8
0
 def test_sqeuclidean(self):
     reference = cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     npt.assert_array_equal(reference, testing)
Пример #9
0
 def test_sqeuclidean(self):
     reference = cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     npt.assert_array_equal(reference, testing)
Пример #10
0
 def test_chebychev(self):
     reference = cdist(self.Xd1, self.Xd2, metric='chebychev')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='chebychev')
     npt.assert_array_equal(reference, testing)
Пример #11
0
 def test_correlation(self):
     reference = cdist(self.Xd1, self.Xd2, metric='correlation')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='correlation')
     npt.assert_array_equal(reference, testing)
Пример #12
0
 def test_cityblock(self):
     reference = cdist(self.Xd1, self.Xd2, metric='cityblock')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='cityblock')
     npt.assert_array_equal(reference, testing)
Пример #13
0
 def test_minkowski(self):
     p = np.random.randint(10)
     reference = cdist(self.Xd1, self.Xd2, metric='minkowski', p=p)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='minkowski', p=p)
     npt.assert_array_equal(reference, testing)
Пример #14
0
 def test_mahalanobis_2(self):
     VI = np.random.randn(self.Xd1.shape[0], self.Xd1.shape[0])
     reference = cdist(self.Xd1, self.Xd2, metric='mahalanobis', VI=VI)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='mahalanobis', VI=VI)
     npt.assert_array_equal(reference, testing)
Пример #15
0
 def test_jaccard_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='jaccard')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='jaccard')
     npt.assert_array_equal(reference, testing)
Пример #16
0
 def test_cityblock(self):
     reference = cdist(self.Xd1, self.Xd2, metric='cityblock')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='cityblock')
     npt.assert_array_equal(reference, testing)
Пример #17
0
 def test_canberra(self):
     reference = cdist(self.Xd1, self.Xd2, metric='canberra')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='canberra')
     npt.assert_array_equal(reference, testing)
Пример #18
0
 def test_hamming_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='hamming')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='hamming')
     npt.assert_array_equal(reference, testing)
Пример #19
0
 def test_braycurtis(self):
     reference = cdist(self.Xd1, self.Xd2, metric='braycurtis')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='braycurtis')
     npt.assert_array_equal(reference, testing)
Пример #20
0
 def test_matching(self):
     reference = cdist(self.Xb1, self.Xb2, metric='matching')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='matching')
     npt.assert_array_equal(reference, testing)
Пример #21
0
 def test_matching(self):
     reference = cdist(self.Xb1, self.Xb2, metric='matching')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='matching')
     npt.assert_array_equal(reference, testing)
Пример #22
0
 def test_russellrao(self):
     reference = cdist(self.Xb1, self.Xb2, metric='russellrao')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='russellrao')
     npt.assert_array_equal(reference, testing)
Пример #23
0
 def test_kulsinski(self):
     reference = cdist(self.Xb1, self.Xb2, metric='kulsinski')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='kulsinski')
     npt.assert_array_equal(reference, testing)
Пример #24
0
 def test_kulsinski(self):
     reference = cdist(self.Xb1, self.Xb2, metric='kulsinski')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='kulsinski')
     eq(reference, testing)
Пример #25
0
 def test_dice(self):
     reference = cdist(self.Xb1, self.Xb2, metric='dice')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='dice')
     npt.assert_array_equal(reference, testing)
Пример #26
0
 def test_rogerstanimoto(self):
     reference = cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     eq(reference, testing)
Пример #27
0
 def test_rogerstanimoto(self):
     reference = cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     npt.assert_array_equal(reference, testing)
Пример #28
0
 def test_sokalmichener(self):
     reference = cdist(self.Xb1, self.Xb2, metric='sokalmichener')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalmichener')
     eq(reference, testing)
Пример #29
0
 def test_russellrao(self):
     reference = cdist(self.Xb1, self.Xb2, metric='russellrao')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='russellrao')
     npt.assert_array_equal(reference, testing)
Пример #30
0
 def test_seuclidean_2(self):
     V = np.random.randn(self.Xd1.shape[1])
     reference = cdist(self.Xd1, self.Xd2, metric='seuclidean', V=V)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='seuclidean', V=V)
     npt.assert_array_equal(reference, testing)
Пример #31
0
 def test_sokalsneath(self):
     reference = cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     npt.assert_array_equal(reference, testing)
Пример #32
0
 def test_minkowski(self):
     p = np.random.randint(10)
     reference = cdist(self.Xd1, self.Xd2, metric='minkowski', p=p)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='minkowski', p=p)
     npt.assert_array_equal(reference, testing)
Пример #33
0
 def test_sqeuclidean(self):
     reference = cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='sqeuclidean')
     eq(reference, testing)
Пример #34
0
 def test_correlation(self):
     reference = cdist(self.Xd1, self.Xd2, metric='correlation')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='correlation')
     npt.assert_array_equal(reference, testing)
Пример #35
0
 def test_chebychev(self):
     reference = cdist(self.Xd1, self.Xd2, metric='chebychev')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='chebychev')
     eq(reference, testing)
Пример #36
0
 def test_chebychev(self):
     reference = cdist(self.Xd1, self.Xd2, metric='chebychev')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='chebychev')
     npt.assert_array_equal(reference, testing)
Пример #37
0
 def test_hamming_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='hamming')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='hamming')
     eq(reference, testing)
Пример #38
0
 def test_jaccard_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='jaccard')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='jaccard')
     npt.assert_array_equal(reference, testing)
Пример #39
0
 def test_jaccard_2(self):
     reference = cdist(self.Xb1, self.Xb2, metric='jaccard')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='jaccard')
     eq(reference, testing)
Пример #40
0
 def test_braycurtis(self):
     reference = cdist(self.Xd1, self.Xd2, metric='braycurtis')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='braycurtis')
     npt.assert_array_equal(reference, testing)
Пример #41
0
 def test_canberra(self):
     reference = cdist(self.Xd1, self.Xd2, metric='canberra')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='canberra')
     eq(reference, testing)
Пример #42
0
 def test_kulsinski(self):
     reference = cdist(self.Xb1, self.Xb2, metric='kulsinski')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='kulsinski')
     npt.assert_array_equal(reference, testing)
Пример #43
0
 def test_braycurtis(self):
     reference = cdist(self.Xd1, self.Xd2, metric='braycurtis')
     testing = fast_cdist(self.Xd1, self.Xd2, metric='braycurtis')
     eq(reference, testing)
Пример #44
0
 def test_rogerstanimoto(self):
     reference = cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='rogerstanimoto')
     npt.assert_array_equal(reference, testing)
Пример #45
0
 def test_matching(self):
     reference = cdist(self.Xb1, self.Xb2, metric='matching')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='matching')
     eq(reference, testing)
Пример #46
0
 def test_sokalsneath(self):
     reference = cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalsneath')
     npt.assert_array_equal(reference, testing)
Пример #47
0
 def test_seuclidean_2(self):
     V = np.random.randn(self.Xd1.shape[1])
     reference = cdist(self.Xd1, self.Xd2, metric='seuclidean', V=V)
     testing = fast_cdist(self.Xd1, self.Xd2, metric='seuclidean', V=V)
     npt.assert_array_equal(reference, testing)