Пример #1
0
def test_simple_label():
    sl = pyvw.simple_label(2.0, weight=0.5)
    assert sl.label == 2.0
    assert sl.weight == 0.5
    assert sl.prediction == 0.0
    assert sl.initial == 0.0
    assert str(sl) == "2.0:0.5"
Пример #2
0
def test_simple_label_example():
    vw_ex = vw(quiet=True)
    ex = vw_ex.example("1 |a two features |b more features here")
    sl2 = pyvw.simple_label(ex)
    assert sl2.label == 1.0
    assert sl2.weight == 1.0
    assert sl2.prediction == 0.0
    assert sl2.initial == 0.0
    assert str(sl2) == "1.0"