From 25dcec544d637f5d70894da107dd90cee5e1b2bc Mon Sep 17 00:00:00 2001 From: b-a-n-y-a-n <118.matts@gmail.com> Date: Fri, 1 Apr 2016 13:11:03 -0700 Subject: [PATCH] Updated sum2 to use Xs instead of Xd sum2 in line 52 was referencing x_d[d], though for the second summation in Equation 32 in http://codalism.com/research/papers/wmz10_tois.pdf the authors use Xs, so changing to x_d[s] also, module won't run as __main__, changing call to RBO to score to fix. --- measures/rankedlist/RBO.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/measures/rankedlist/RBO.py b/measures/rankedlist/RBO.py index 33ef23f..41b0fd5 100644 --- a/measures/rankedlist/RBO.py +++ b/measures/rankedlist/RBO.py @@ -49,7 +49,7 @@ def score(l1, l2, p = 0.98): sum2 = 0.0 for i in range(l-s): d = s+i+1 - sum2 += x_d[d]*(d-s)/(d*s)*pow(p,d) + sum2 += x_d[s]*(d-s)/(d*s)*pow(p,d) sum3 = ((x_d[l]-x_d[s])/l+x_d[s]/s)*pow(p,l) @@ -61,8 +61,8 @@ def score(l1, l2, p = 0.98): if __name__ == "__main__": list1 = ['0','1','2','3','4','5'] list2 = ['1','0','2','3','4','5'] - print RBO(list1,list2, p = 0.98) + print score(list1,list2, p = 0.98) list1 = ['012'] list2 = [] - print RBO(list1, list2, p = 0.98) + print score(list1, list2, p = 0.98)