예제 #1
0
def test_vw_init_del():
    model = VW()
    tempdir = model.tempdir.name
    assert os.path.exists(tempdir)

    del model
    assert not os.path.exists(tempdir)
def model():
    model = VW(col_user="******",
               col_item="item",
               col_prediction="prediction",
               q="ui")
    yield model
    del model
예제 #3
0
def test_to_vw_cmd():
    expected = [
        "vw",
        "-l",
        "0.1",
        "--l1",
        "0.2",
        "--loss_function",
        "logistic",
        "--holdout_off",
        "--rank",
        "3",
        "-t",
    ]
    params = dict(
        l=0.1,
        l1=0.2,
        loss_function="logistic",
        holdout_off=True,
        quiet=False,
        rank=3,
        t=True,
    )
    assert VW.to_vw_cmd(params=params) == expected