Ejemplo n.º 1
0
def test_ftrl_set_individual():
    ft = Ftrl()
    ft.alpha = tparams.alpha
    ft.beta = tparams.beta
    ft.lambda1 = tparams.lambda1
    ft.lambda2 = tparams.lambda2
    ft.d = tparams.d
    ft.nepochs = tparams.nepochs
    ft.inter = tparams.inter
    assert ft.params == tparams
Ejemplo n.º 2
0
def test_ftrl_set_wrong_d_value():
    ft = Ftrl()
    with pytest.raises(ValueError) as e:
        ft.d = 0
    assert ("Value should be positive: 0" == str(e.value))
Ejemplo n.º 3
0
def test_ftrl_set_wrong_d_type():
    ft = Ftrl()
    with pytest.raises(TypeError) as e:
        ft.d = "0"
    assert ("Expected an integer, instead got <class 'str'>" == str(e.value))