def test_validate_tpm_conditional_independence(): tpm = np.array([ [1, 0, 0, 0], [0, .5, .5, 0], [0, .5, .5, 0], [0, 0, 0, 1], ]) with pytest.raises(ValueError): validate.tpm(tpm)
def test_validate_tpm_conditional_independence(): tpm = np.array([ [1, 0.0, 0.0, 0], [0, 0.5, 0.5, 0], [0, 0.5, 0.5, 0], [0, 0.0, 0.0, 1], ]) with pytest.raises(exceptions.ConditionallyDependentError): validate.conditionally_independent(tpm) with pytest.raises(exceptions.ConditionallyDependentError): validate.tpm(tpm) validate.tpm(tpm, check_independence=False)
def test_validate_tpm_conditional_independence(): tpm = np.array([ [1, 0.0, 0.0, 0], [0, 0.5, 0.5, 0], [0, 0.5, 0.5, 0], [0, 0.0, 0.0, 1], ]) with pytest.raises(ValueError): validate.conditionally_independent(tpm) with config.override(VALIDATE_CONDITIONAL_INDEPENDENCE=False): validate.conditionally_independent(tpm) with pytest.raises(ValueError): validate.tpm(tpm) validate.tpm(tpm, check_independence=False)
def test_validate_tpm_nonbinary_nodes(): tpm = np.arange(3 * 3 * 2).reshape(3, 3, 2) with pytest.raises(ValueError): assert validate.tpm(tpm)
def test_validate_tpm_wrong_shape(): tpm = np.arange(3**3).reshape(3, 3, 3) with pytest.raises(ValueError): assert validate.tpm(tpm)
def test_validate_tpm_nonbinary_nodes(): tpm = np.arange(3*3*2).reshape(3, 3, 2) with pytest.raises(ValueError): assert validate.tpm(tpm)