MCPcopy Create free account
hub / github.com/HKUDS/DCCF / test_one_batch

Function test_one_batch

utility/batch_test.py:40–49  ·  view source on GitHub ↗
(X, topks)

Source from the content-addressed store, hash-verified

38
39
40def test_one_batch(X, topks):
41 sorted_items = X[0].numpy()
42 groundTrue = X[1]
43 r = getLabel(groundTrue, sorted_items)
44 recall, ndcg = [], []
45 for k in topks:
46 recall.append(Recall_ATk(groundTrue, r, k))
47 ndcg.append(NDCGatK_r(groundTrue, r, k))
48 return {'recall': np.array(recall),
49 'ndcg': np.array(ndcg)}
50
51
52def eval_PyTorch(model, data_generator, Ks):

Callers 1

eval_PyTorchFunction · 0.85

Calls 3

getLabelFunction · 0.85
Recall_ATkFunction · 0.85
NDCGatK_rFunction · 0.85

Tested by

no test coverage detected