c11b2a426b89aad1e8da244e2a12fdec032adb9e,entity2rec/node2vec_recommender.py,,,#,70
Before Change
print("Finished computing features after %s seconds" % (time.time() - start_time))
evaluat.evaluate(node2vec_rec, x_test, y_test, qids_test, items_test) // evaluates the recommender on the test set
print("--- %s seconds ---" % (time.time() - start_time))
After Change
args.test = "datasets/" + args.dataset + "/test.dat"
if not args.validation:
args.validation = "datasets/" + args.dataset + "/val.dat"
if args.dataset == "LastFM":
implicit = True
else:
implicit = args.implicit
if args.dataset == "LibraryThing":
threshold = 8
else:
threshold = args.threshold
// initialize node2vec recommender
node2vec_rec = Node2VecRecommender(args.dataset, p=args.p, q=args.q,
walk_length=args.walk_length, num_walks=args.num_walks,
dimensions=args.dimensions, window_size=args.window_size,
iterations=args.iter)
// initialize evaluator
evaluat = Evaluator(implicit=args.implicit, threshold=args.threshold, all_unrated_items=args.all_unrated_items)
// compute e2rec features
x_train, y_train, qids_train, items_train, x_test, y_test, qids_test, items_test, \
x_val, y_val, qids_val, items_val = evaluat.features(node2vec_rec, args.train, args.test,
validation=False, n_users=args.num_users,
n_jobs=args.workers, supervised=False)
print("Finished computing features after %s seconds" % (time.time() - start_time))
evaluat.evaluate(node2vec_rec, x_test, y_test, qids_test, items_test,
write_to_file="results/%s/node2vec/num%d_p%d_q%d_l%d_d%d_iter%d_winsize%d.csv"
% (args.dataset, args.num_walks, args.p, args.q, args.walk_length,
args.dimensions, args.iter, args.window_size),
baseline=True) // evaluates the recommender on the test set
print("--- %s seconds ---" % (time.time() - start_time))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: D2KLab/entity2rec
Commit Name: c11b2a426b89aad1e8da244e2a12fdec032adb9e
Time: 2018-07-26
Author: enricopalumbo0@gmail.com
File Name: entity2rec/node2vec_recommender.py
Class Name:
Method Name:
Project Name: deepchem/deepchem
Commit Name: 152460eb236a72a86c8f53f42c07ca6a01513b24
Time: 2017-09-05
Author: lilleswing@gmail.com
File Name: examples/qm7/qm7_ANI.py
Class Name:
Method Name:
Project Name: explosion/thinc
Commit Name: f59cb0be597e0cbdb4dd915eb112a8e90d2b005f
Time: 2017-01-14
Author: honnibal+gh@gmail.com
File Name: examples/mnist_mlp.py
Class Name:
Method Name: main