def test_root_CfEvaluator_evaluate_on_split():
    evaluator = CfEvaluator()

    #Test with invalid metric
    assert_raises(ValueError, evaluator.evaluate_on_split, recsys, 'rank')

    #Test with specified metric
    rmse = evaluator.evaluate_on_split(recsys, 'rmse', permutation=False)
    for p in rmse[0]['error']:
        assert_true(p['rmse'] >= 0.0 and p['rmse'] <= 1.0)
    assert_true(rmse[1]['final_error']['avg']['rmse'] >= 0.0 and
                rmse[1]['final_error']['stdev']['rmse'] <= 1.0)

    mae = evaluator.evaluate_on_split(recsys, 'mae', permutation=False)
    for p in mae[0]['error']:
        assert_true(p['mae'] >= 0.0 and p['mae'] <= 1.0)
    assert_true(mae[1]['final_error']['avg']['mae'] >= 0.0 and
                mae[1]['final_error']['stdev']['mae'] <= 1.0)

    nmae = evaluator.evaluate_on_split(recsys, 'nmae', permutation=False)
    for p in nmae[0]['error']:
        assert_true(p['nmae'] >= 0.0 and p['nmae'] <= 1.0)
    assert_true(nmae[1]['final_error']['avg']['nmae'] >= 0.0 and
                nmae[1]['final_error']['stdev']['nmae'] <= 1.0)

    #Test with IR statistics
    precision = evaluator.evaluate_on_split(recsys, 'precision', permutation=False)
    for p in precision[0]['ir']:
        assert_true(p['precision'] >= 0.0 and p['precision'] <= 1.0)
    assert_true(precision[1]['final_error']['avg']['precision'] >= 0.0 and
                precision[1]['final_error']['stdev']['precision'] <= 1.0)

    recall = evaluator.evaluate_on_split(recsys, 'recall', permutation=False)
    for p in recall[0]['ir']:
        assert_true(p['recall'] >= 0.0 and p['recall'] <= 1.0)
    assert_true(recall[1]['final_error']['avg']['recall'] >= 0.0 and
                recall[1]['final_error']['stdev']['recall'] <= 1.0)

    f1score = evaluator.evaluate_on_split(recsys, 'f1score', permutation=False)
    for p in f1score[0]['ir']:
        assert_true(p['f1score'] >= 0.0 and p['f1score'] <= 1.0)
    assert_true(f1score[1]['final_error']['avg']['f1score'] >= 0.0 and
                f1score[1]['final_error']['stdev']['f1score'] <= 1.0)

    all_scores = evaluator.evaluate_on_split(recsys, permutation=False)
    for p in all_scores[0]['ir']:
        assert_true(p['f1score'] >= 0.0 and p['f1score'] <= 1.0)
        assert_true(p['recall'] >= 0.0 and p['recall'] <= 1.0)
        assert_true(p['precision'] >= 0.0 and p['precision'] <= 1.0)
    for p in all_scores[0]['error']:
        assert_true(p['mae'] >= 0.0 and p['mae'] <= 1.0)
        assert_true(p['rmse'] >= 0.0 and p['rmse'] <= 1.0)
        assert_true(p['nmae'] >= 0.0 and p['nmae'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['f1score'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['f1score'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['recall'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['recall'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['precision'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['precision'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['rmse'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['rmse'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['mae'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['mae'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['nmae'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['nmae'] <= 1.0)

    #Test with boolean model
    #Test with invalid metric
    assert_raises(ValueError, evaluator.evaluate_on_split, boolean_recsys, 'rank')

    #Test with specified metric
    rmse = evaluator.evaluate_on_split(boolean_recsys, 'rmse', permutation=False)
    for p in rmse[0]['error']:
        assert_true(p['rmse'] >= 0.0 and p['rmse'] <= 1.0)
    assert_true(rmse[1]['final_error']['avg']['rmse'] >= 0.0 and
                rmse[1]['final_error']['stdev']['rmse'] <= 1.0)

    mae = evaluator.evaluate_on_split(boolean_recsys, 'mae', permutation=False)
    for p in mae[0]['error']:
        assert_true(p['mae'] >= 0.0 and p['mae'] <= 1.0)
    assert_true(mae[1]['final_error']['avg']['mae'] >= 0.0 and
                mae[1]['final_error']['stdev']['mae'] <= 1.0)

    nmae = evaluator.evaluate_on_split(boolean_recsys, 'nmae', permutation=False)
    for p in nmae[0]['error']:
        assert_true(p['nmae'] >= 0.0 and p['nmae'] <= 1.0)
    assert_true(nmae[1]['final_error']['avg']['nmae'] >= 0.0 and
                nmae[1]['final_error']['stdev']['nmae'] <= 1.0)

    #Test with IR statistics
    precision = evaluator.evaluate_on_split(boolean_recsys, 'precision', permutation=False)
    for p in precision[0]['ir']:
        assert_true(p['precision'] >= 0.0 and p['precision'] <= 1.0)
    assert_true(precision[1]['final_error']['avg']['precision'] >= 0.0 and
                precision[1]['final_error']['stdev']['precision'] <= 1.0)

    recall = evaluator.evaluate_on_split(boolean_recsys, 'recall', permutation=False)
    for p in recall[0]['ir']:
        assert_true(p['recall'] >= 0.0 and p['recall'] <= 1.0)
    assert_true(recall[1]['final_error']['avg']['recall'] >= 0.0 and
                recall[1]['final_error']['stdev']['recall'] <= 1.0)

    f1score = evaluator.evaluate_on_split(boolean_recsys, 'f1score', permutation=False)
    for p in f1score[0]['ir']:
        assert_true(p['f1score'] >= 0.0 and p['f1score'] <= 1.0)
    assert_true(f1score[1]['final_error']['avg']['f1score'] >= 0.0 and
                f1score[1]['final_error']['stdev']['f1score'] <= 1.0)

    all_scores = evaluator.evaluate_on_split(boolean_recsys, permutation=False)
    for p in all_scores[0]['ir']:
        assert_true(p['f1score'] >= 0.0 and p['f1score'] <= 1.0)
        assert_true(p['recall'] >= 0.0 and p['recall'] <= 1.0)
        assert_true(p['precision'] >= 0.0 and p['precision'] <= 1.0)

    for p in all_scores[0]['error']:
        assert_true(p['mae'] >= 0.0 and p['mae'] <= 1.0)
        assert_true(p['rmse'] >= 0.0 and p['rmse'] <= 1.0)
        assert_true(p['nmae'] >= 0.0 and p['nmae'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['f1score'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['f1score'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['recall'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['recall'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['precision'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['precision'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['rmse'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['rmse'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['mae'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['mae'] <= 1.0)
    assert_true(all_scores[1]['final_error']['avg']['nmae'] >= 0.0 and
                all_scores[1]['final_error']['stdev']['nmae'] <= 1.0)
Return a dict of default headers (including authentication).
dataset/ETHPy150Open muricoca/crab/scikits/crab/metrics/tests/test_classes.py/test_root_CfEvaluator_evaluate_on_split--crossover with--dataset/ETHPy150Open Kitware/minerva/server/utility/bsve/bsve_utility.py/BsveUtility._headers