Beispiel #1
0
def test_build_weight_matrix_linear():
    weighted = kappa.build_weight_matrix(3, 'linear')
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 2
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 2
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0
Beispiel #2
0
def test_build_weight_matrix_squared():
    weighted = kappa.build_weight_matrix(3, 'squared')
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 4
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 4
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0
Beispiel #3
0
def test_build_weight_matrix_linear():
    weighted = kappa.build_weight_matrix(3, 'linear')
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 2
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 2
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0
Beispiel #4
0
def test_build_weight_matrix_squared():
    weighted = kappa.build_weight_matrix(3, 'squared')
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 4
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 4
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0
Beispiel #5
0
def test_build_weight_matrix_unweighted():
    weighted = kappa.build_weight_matrix(3, "unweighted")
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 1
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 1
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0
Beispiel #6
0
def test_build_weight_matrix_unweighted():
    weighted = kappa.build_weight_matrix(3, 'unweighted')
    print weighted
    assert weighted.size == 9
    assert weighted[0][0] == 0
    assert weighted[0][1] == 1
    assert weighted[0][2] == 1
    assert weighted[1][0] == 1
    assert weighted[1][1] == 0
    assert weighted[1][2] == 1
    assert weighted[2][0] == 1
    assert weighted[2][1] == 1
    assert weighted[2][2] == 0