nDCG / Testing.py
JP-SystemsX
Some tests to better understand compute score
8d7d29c
raw
history blame
535 Bytes
import evaluate as ev
from nDCG import nDCG
metric = nDCG(cache_dir="cache")
a = [1,2,3,4,5]
b = [1,2,3,4,5]
c = [1,2,3,4,0]
#metric.add(prediction=a, reference=b)
metric.add(prediction=c, reference=b)
metric.add(prediction=c, reference=b)
metric.add(prediction=c, reference=b)
print(metric.compute(predictions=[a], references=[b]))
print(metric.compute(predictions=[a], references=[c]))
print(metric.compute(predictions=[a], references=[c]))
print(metric.compute(predictions=[a,a], references=[c,a]))
print(metric.cache_file_name)