Beispiel #1
0
def test_ftrl_set_wrong_alpha_type():
    ft = Ftrl()
    with pytest.raises(TypeError) as e:
        ft.alpha = "0.0"
    assert ("Expected a float, instead got <class 'str'>" == str(e.value))
Beispiel #2
0
def test_ftrl_set_bad_alpha_value(value):
    ft = Ftrl()
    with pytest.raises(ValueError) as e:
        ft.alpha = value
    assert ("Value should be positive: %s" % str(value) == str(e.value))