Exemplo n.º 1
0
def test_50():
    C = numpy.array([
        [10, 10],
        [10, 10]
        ])
    assert accuracy(C) == .5
    assert waccuracy(C) == .5
Exemplo n.º 2
0
def test_unbalanced():
    C = numpy.array([
        [20, 10],
        [10,  0]
        ])
    assert accuracy(C) == .5
    assert waccuracy(C) == 1./3
Exemplo n.º 3
0
def test_0():
    C = numpy.array([
        [0, 10],
        [10, 0]
        ])
    assert waccuracy(C) == 0.
    assert accuracy(C) == 0.
Exemplo 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.
Exemplo 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.
Exemplo n.º 6
0
def test_unbalanced():
    C = numpy.array([[20, 10], [10, 0]])
    assert accuracy(C) == .5
    assert waccuracy(C) == 1. / 3
Exemplo n.º 7
0
def test_50():
    C = numpy.array([[10, 10], [10, 10]])
    assert accuracy(C) == .5
    assert waccuracy(C) == .5
Exemplo n.º 8
0
def test_0():
    C = numpy.array([[0, 10], [10, 0]])
    assert waccuracy(C) == 0.
    assert accuracy(C) == 0.