示例#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)