def test_russellrao(self): reference = cdist(self.Xb1, self.Xb2, metric='russellrao') testing = fast_cdist(self.Xb1, self.Xb2, metric='russellrao') eq(reference, testing)
def test_sokalsneath(self): reference = cdist(self.Xb1, self.Xb2, metric='sokalsneath') testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalsneath') eq(reference, testing)
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)
def test_dice(self): reference = cdist(self.Xb1, self.Xb2, metric='dice') testing = fast_cdist(self.Xb1, self.Xb2, metric='dice') eq(reference, testing)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
def test_kulsinski(self): reference = cdist(self.Xb1, self.Xb2, metric='kulsinski') testing = fast_cdist(self.Xb1, self.Xb2, metric='kulsinski') eq(reference, testing)
def test_rogerstanimoto(self): reference = cdist(self.Xb1, self.Xb2, metric='rogerstanimoto') testing = fast_cdist(self.Xb1, self.Xb2, metric='rogerstanimoto') eq(reference, testing)
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)
def test_sokalmichener(self): reference = cdist(self.Xb1, self.Xb2, metric='sokalmichener') testing = fast_cdist(self.Xb1, self.Xb2, metric='sokalmichener') eq(reference, testing)
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)
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)
def test_sqeuclidean(self): reference = cdist(self.Xd1, self.Xd2, metric='sqeuclidean') testing = fast_cdist(self.Xd1, self.Xd2, metric='sqeuclidean') eq(reference, testing)
def test_chebychev(self): reference = cdist(self.Xd1, self.Xd2, metric='chebychev') testing = fast_cdist(self.Xd1, self.Xd2, metric='chebychev') eq(reference, testing)
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)
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)
def test_canberra(self): reference = cdist(self.Xd1, self.Xd2, metric='canberra') testing = fast_cdist(self.Xd1, self.Xd2, metric='canberra') eq(reference, testing)
def test_braycurtis(self): reference = cdist(self.Xd1, self.Xd2, metric='braycurtis') testing = fast_cdist(self.Xd1, self.Xd2, metric='braycurtis') eq(reference, testing)
def test_matching(self): reference = cdist(self.Xb1, self.Xb2, metric='matching') testing = fast_cdist(self.Xb1, self.Xb2, metric='matching') eq(reference, testing)