Beispiel #1
0
def test_fbeta_update1():
    x = Tensor(np.array([[0.2, 0.5, 0.7], [0.3, 0.1, 0.2], [0.9, 0.6, 0.5]]))
    y = Tensor(np.array([1, 0]))
    metric = Fbeta(2)
    metric.clear()

    with pytest.raises(ValueError):
        metric.update(x, y)
Beispiel #2
0
def test_fbeta_update2():
    x1 = Tensor(np.array([[0.2, 0.5, 0.7], [0.3, 0.1, 0.2], [0.9, 0.6, 0.5]]))
    y1 = Tensor(np.array([1, 0, 2]))
    x2 = Tensor(np.array([[0.2, 0.5], [0.3, 0.1], [0.9, 0.6]]))
    y2 = Tensor(np.array([1, 0, 2]))
    metric = Fbeta(2)
    metric.clear()
    metric.update(x1, y1)

    with pytest.raises(ValueError):
        metric.update(x2, y2)