def test_matthews_corrcoef(caplog): """Unit test of matthews_correlation_coefficient_scorer.""" caplog.set_level(logging.INFO) metric_dict = matthews_correlation_coefficient_scorer(GOLDS, PROBS, PREDS) assert isequal(metric_dict, {"matthews_corrcoef": 0.4472135954999579}) metric_dict = matthews_correlation_coefficient_scorer(GOLDS, None, PREDS) assert isequal(metric_dict, {"matthews_corrcoef": 0.4472135954999579}) metric_dict = matthews_correlation_coefficient_scorer( PROB_GOLDS, PROBS, PREDS) assert isequal(metric_dict, {"matthews_corrcoef": 0.4472135954999579}) metric_dict = matthews_correlation_coefficient_scorer( PROB_GOLDS, None, PREDS) assert isequal(metric_dict, {"matthews_corrcoef": 0.4472135954999579})
def test_matthews_corrcoef(caplog): """Unit test of matthews_correlation_coefficient_scorer""" caplog.set_level(logging.INFO) golds = np.array([0, 1, 0, 1, 0, 1]) preds = np.array([0, 0, 0, 0, 0, 1]) metric_dict = matthews_correlation_coefficient_scorer(golds, None, preds) assert isequal(metric_dict, {"matthews_corrcoef": 0.4472135954999579})