Ejemplo n.º 1
0
def test_run_all_regression(model, dataset, split):
    d = ConvertToNamespace({
        'dataset': dataset,
        'model': model,
        'split': split
    })

    if check_needs_run('regression', d):
        run_regression(d, is_test=False)
def test_regression(tuple):
    data, model, correct_result = tuple
    result = run_regression(None, data=data, model=model, is_test=True)

    evaluation_metrics = {
        'test_loglik', 'test_loglik_unnormalized', 'test_mae',
        'test_mae_unnormalized', 'test_rmse', 'test_rmse_unnormalized'
    }
    for evaluation_metric in evaluation_metrics:
        np.testing.assert_almost_equal(correct_result[evaluation_metric],
                                       result[evaluation_metric],
                                       decimal=3)
Ejemplo n.º 3
0
def test_regression(model):
    d = {'dataset': 'boston', 'model': model}

    run_regression(ConvertToNamespace(d), is_test=True)