c43310c317f67f13d7a80c1b1cdbc10abf28301b,matchzoo/metrics/rank_evaluations.py,rank_eval,ndcg,#rank_eval#Any#Any#Any#,64

Before Change


        c_g = sorted(c, key=lambda x:x[0], reverse=True)
        c_p = sorted(c, key=lambda x:x[1], reverse=True)
        idcg = [0. for i in range(k)]
        dcg = [0. for i in range(k)]
        for i, (g,p) in enumerate(c_g):
            if g > self.rel_threshold:
                idcg[i:] += (np.pow(2., g) - 1.) / np.log(2. + i)

After Change


        c_p = sorted(c, key=lambda x:x[1], reverse=True)
        //idcg = [0. for i in range(k)]
        idcg = np.zeros([k], dtype=np.float32)
        dcg = np.zeros([k], dtype=np.float32)
        //dcg = [0. for i in range(k)]
        for i, (g,p) in enumerate(c_g):
            if g > self.rel_threshold:
                idcg[i:] += (math.pow(2., g) - 1.) / math.log(2. + i)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: NTMC-Community/MatchZoo
Commit Name: c43310c317f67f13d7a80c1b1cdbc10abf28301b
Time: 2017-06-18
Author: fanyixing111@hotmail.com
File Name: matchzoo/metrics/rank_evaluations.py
Class Name: rank_eval
Method Name: ndcg


Project Name: chainer/chainercv
Commit Name: d8627f9057fd69b48c758be5468480a3bb04b81e
Time: 2017-05-28
Author: yuyuniitani@gmail.com
File Name: examples/segnet/calc_weight.py
Class Name:
Method Name:


Project Name: ray-project/ray
Commit Name: 244aafdcf89ae814975c8c4e3faf0bd4995c7878
Time: 2020-09-05
Author: sven@anyscale.io
File Name: rllib/utils/exploration/tests/test_curiosity.py
Class Name: OneHotWrapper
Method Name: observation