|
|
|
|
|
|
|
|
predictions = predictions.view(-1) |
|
|
predictions = predictions.view(-1) |
|
|
y_true = query_ys.cpu().detach().numpy() |
|
|
y_true = query_ys.cpu().detach().numpy() |
|
|
y_pred = predictions.cpu().detach().numpy() |
|
|
y_pred = predictions.cpu().detach().numpy() |
|
|
|
|
|
|
|
|
# ndcgs1.append(float(mz.metrics.NormalizedDiscountedCumulativeGain(k=1)(y_true, y_pred))) |
|
|
# ndcgs1.append(float(mz.metrics.NormalizedDiscountedCumulativeGain(k=1)(y_true, y_pred))) |
|
|
# ndcgs3.append(float(mz.metrics.NormalizedDiscountedCumulativeGain(k=3)(y_true, y_pred))) |
|
|
# ndcgs3.append(float(mz.metrics.NormalizedDiscountedCumulativeGain(k=3)(y_true, y_pred))) |
|
|
|
|
|
|