Example #1
0
def test_pearson_spearman(caplog):
    """Unit test of pearson_spearman_scorer"""

    caplog.set_level(logging.INFO)

    golds = np.array([1, 0, 1, 0, 1, 0])
    probs = np.array([0.8, 0.6, 0.9, 0.7, 0.7, 0.2])

    metric_dict = pearson_spearman_scorer(golds, probs, None)
    assert isequal(metric_dict, {"pearson_spearman": 0.7342997297919428})
Example #2
0
def test_pearson_spearman(caplog):
    """Unit test of pearson_spearman_scorer"""

    caplog.set_level(logging.INFO)

    golds = np.array([1, 0, 1, 0, 1, 0])
    probs = np.array([0.8, 0.6, 0.9, 0.7, 0.7, 0.2])

    metric_dict = pearson_spearman_scorer(golds, probs, None)

    assert isequal(
        metric_dict,
        {
            "pearson_correlation": 0.6764814252025461,
            "pearson_pvalue": 0.14006598491201774,
            "spearman_correlation": 0.7921180343813395,
            "spearman_pvalue": 0.06033056705743058,
            "pearson_spearman": 0.7342997297919428,
        },
    )
Example #3
0
def test_pearson_spearman(caplog):
    """Unit test of pearson_spearman_scorer."""
    caplog.set_level(logging.INFO)

    metric_dict = pearson_spearman_scorer(GOLDS, UNARY_PROBS, None)
    assert isequal(metric_dict, {"pearson_spearman": 0.5804143674717547})