70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3,tests/sequence/test_implicit.py,,test_implicit_cnn_synthetic,#Any#Any#,80

Before Change


])
def test_implicit_cnn_synthetic(randomness, expected_mrr):

    interactions = synthetic.generate_sequential(num_users=1000,
                                                 num_items=1000,
                                                 num_interactions=10000,
                                                 concentration_parameter=randomness,
                                                 random_state=RANDOM_STATE)
    train, test = user_based_train_test_split(interactions,
                                              random_state=RANDOM_STATE)

    train = train.to_sequence(max_sequence_length=10)
    test = test.to_sequence(max_sequence_length=10)

    model = ImplicitSequenceModel(loss="bpr",
                                  representation="cnn",
                                  embedding_dim=64,
                                  batch_size=128,
                                  learning_rate=1e-2,
                                  l2=1e-7,
                                  n_iter=10,
                                  random_state=RANDOM_STATE)
    model.fit(train, verbose=True)
    mrr = sequence_mrr_score(model, test)

    print("MRR {} randomness {}".format(mrr.mean(), randomness))

    assert mrr.mean() > expected_mrr

After Change


])
def test_implicit_cnn_synthetic(randomness, expected_mrr):

    random_state = np.random.RandomState(RANDOM_SEED)
    train, test = _get_synthetic_data(randomness=randomness,
                                      random_state=random_state)

    model = ImplicitSequenceModel(loss=LOSS,
                                  representation=CNNNet(train.num_items,
                                                        embedding_dim=EMBEDDING_DIM,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: tests/sequence/test_implicit.py
Class Name:
Method Name: test_implicit_cnn_synthetic


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: tests/sequence/test_implicit.py
Class Name:
Method Name: test_implicit_pooling_synthetic


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: tests/sequence/test_implicit.py
Class Name:
Method Name: test_implicit_cnn_synthetic


Project Name: maciejkula/spotlight
Commit Name: 70e4d7fe60a9658bb27b9f5fb67592a1222b2ec3
Time: 2017-07-06
Author: maciej.kula@gmail.com
File Name: tests/sequence/test_implicit.py
Class Name:
Method Name: test_implicit_lstm_synthetic