Example #1
0
def test_fuzzy_compare():
    pair = np.r_[[[1, 0.6, 0.7, 0.5], [0.2, 1, 0.8, 0.6], [0.3, 0.2, 1, 0.4],
                  [0.9, 0.5, 0.8, 1]]]

    test = fuzzy_compare(pair)
    expected = np.r_[[[63., 21., 27., 63.], [63., 63., 15.75, 52.5],
                      [63., 63., 63., 63.], [35., 63., 31.5, 63.]]] / 63.
    assert_allclose(test, expected)
def test_fuzzy_compare():
    pair = np.r_[[[1, 0.6, 0.7, 0.5],
                  [0.2, 1, 0.8, 0.6],
                  [0.3, 0.2, 1, 0.4],
                  [0.9, 0.5, 0.8, 1]]]

    test = fuzzy_compare(pair)
    expected = np.r_[[[63., 21., 27.  , 63. ],
                      [63., 63., 15.75, 52.5],
                      [63., 63., 63.  , 63. ],
                      [35., 63., 31.5 , 63. ]]] / 63.
    assert_allclose(test, expected)