コード例 #1
0
ファイル: test_metrics.py プロジェクト: stegben/drain
def test_precision():
    y_true = np.array([True, True, False])
    y_score = np.array([1, 0, .5])

    assert precision(y_true, y_score, 2) == .5
コード例 #2
0
ファイル: test_metrics.py プロジェクト: dean12/drain
def test_precision():
    y_true = np.array([True, True, False])
    y_score = np.array([1, 0, .5])

    assert precision(y_true, y_score,2) == .5
コード例 #3
0
ファイル: test_metrics.py プロジェクト: stegben/drain
def test_precision_nan():
    y_true = np.array([True, False, np.nan])
    y_score = np.array([1, 0, .5])

    p = precision(y_true, y_score, None, return_bounds=True)
    assert p == (.5, 2, (1.0 / 3, 2.0 / 3))
コード例 #4
0
ファイル: test_metrics.py プロジェクト: dean12/drain
def test_precision_nan():
    y_true = np.array([True, False, np.nan])
    y_score = np.array([1, 0, .5])

    p = precision(y_true, y_score,None, return_bounds=True)
    assert p == (.5, 2, (1.0/3, 2.0/3))