def test_multiclass_label_example(): n = 4 model = pyvw.vw(loss_function="logistic", oaa=n, quiet=True) ex = model.example("1 | a b c d", 2) ml2 = pyvw.multiclass_label(ex) assert ml2.label == 1 assert ml2.weight == 1.0 assert ml2.prediction == 0 assert str(ml2) == "1"
def test_multiclass_label(): ml = pyvw.multiclass_label(2, weight=0.2) assert ml.label == 2 assert ml.weight == 0.2 assert ml.prediction == 1 assert str(ml) == "2:0.2"