Beispiel #1
0
def test_warp_precision_max_sampled():

    model = LightFM(learning_rate=0.05, max_sampled=1, loss='warp')

    # This is equivalent to a no-op pass
    # over the training data
    model.max_sampled = 0

    model.fit_partial(train, epochs=1)

    full_train_auc = full_auc(model, train)
    full_test_auc = full_auc(model, test)

    # The AUC should be no better than random
    assert full_train_auc < 0.55
    assert full_test_auc < 0.55
Beispiel #2
0
def test_warp_precision_max_sampled():

    model = LightFM(learning_rate=0.05,
                    max_sampled=1,
                    loss='warp')

    # This is equivalent to a no-op pass
    # over the training data
    model.max_sampled = 0

    model.fit_partial(train,
                      epochs=1)

    full_train_auc = full_auc(model, train)
    full_test_auc = full_auc(model, test)

    # The AUC should be no better than random
    assert full_train_auc < 0.55
    assert full_test_auc < 0.55