Ejemplo n.º 1
0
def test_mean_overprediction_unweighted_single():
    y_pred = [1]
    y_true = [0]

    result = metrics._mean_overprediction(y_true, y_pred)

    assert result == 1
Ejemplo n.º 2
0
def test_mean_overprediction_unweighted():
    y_pred = [0, 1, 2, 3, 4]
    y_true = [1, 1, 5, 0, 2]

    result = metrics._mean_overprediction(y_true, y_pred)

    assert result == 1
Ejemplo n.º 3
0
def test_mean_overprediction_weighted():
    y_pred = [0, 1, 2, 3, 4]
    y_true = [1, 1, 5, 0, 2]
    weight = [3, 1, 7, 1, 2]

    result = metrics._mean_overprediction(y_true, y_pred, weight)

    assert result == 0.5