Esempio n. 1
0
def test_50():
    C = numpy.array([
        [10, 10],
        [10, 10]
        ])
    assert accuracy(C) == .5
    assert waccuracy(C) == .5
Esempio n. 2
0
def test_unbalanced():
    C = numpy.array([
        [20, 10],
        [10,  0]
        ])
    assert accuracy(C) == .5
    assert waccuracy(C) == 1./3
Esempio n. 3
0
def test_0():
    C = numpy.array([
        [0, 10],
        [10, 0]
        ])
    assert waccuracy(C) == 0.
    assert accuracy(C) == 0.
Esempio n. 4
0
def test_100():
    C=numpy.zeros((2,2))
    C[0,0]=100
    C[1,1]=50
    assert accuracy(C) == 1.
    assert waccuracy(C) == 1.
Esempio n. 5
0
def test_100():
    C = numpy.zeros((2, 2))
    C[0, 0] = 100
    C[1, 1] = 50
    assert accuracy(C) == 1.
    assert waccuracy(C) == 1.
Esempio n. 6
0
def test_unbalanced():
    C = numpy.array([[20, 10], [10, 0]])
    assert accuracy(C) == .5
    assert waccuracy(C) == 1. / 3
Esempio n. 7
0
def test_50():
    C = numpy.array([[10, 10], [10, 10]])
    assert accuracy(C) == .5
    assert waccuracy(C) == .5
Esempio n. 8
0
def test_0():
    C = numpy.array([[0, 10], [10, 0]])
    assert waccuracy(C) == 0.
    assert accuracy(C) == 0.