Пример #1
0
def test_canberra_distance():
    x = np.asarray([1, 2])
    y = np.asarray([3, 4])

    dist = distance.canberra_distance(x, y)

    assert dist == 0.8333333333333333
Пример #2
0
def test_canberra_distance():
    x = np.asarray([5.1, 3.5, 1.4, 0.3])
    y = np.asarray([5.4, 3.4, 1.7, 0.2])

    dist = distance.canberra_distance(x, y)

    assert dist == 0.33983837574300413