예제 #1
0
파일: test_brm.py 프로젝트: pyro-ppl/brmp
def test_family_and_response_type_checks(formula_str, non_real_cols, family,
                                         priors):
    formula = parse(formula_str)
    cols = expand_columns(formula, non_real_cols)
    metadata = metadata_from_cols(cols)
    with pytest.raises(Exception, match='not compatible'):
        build_model_pre(formula, metadata, family, {})
예제 #2
0
파일: test_brm.py 프로젝트: pyro-ppl/brmp
def test_prior_checks(formula_str, non_real_cols, family, priors,
                      expected_error):
    formula = parse(formula_str)
    cols = expand_columns(formula, non_real_cols)
    metadata = metadata_from_cols(cols)
    design_metadata = build_model_pre(formula, metadata, family, {})
    with pytest.raises(Exception, match=expected_error):
        build_prior_tree(design_metadata, priors)
예제 #3
0
파일: __init__.py 프로젝트: neerajprad/brmp
def makedesc(formula, metadata, family, priors, code_lengths):
    assert type(formula) == Formula
    assert type(metadata) == Metadata
    assert type(family) == Family
    assert type(priors) == list
    model_desc_pre = build_model_pre(formula, metadata, family, code_lengths)
    prior_tree = build_prior_tree(model_desc_pre, priors)
    return build_model(model_desc_pre, prior_tree)