8d4fee5d7dc69f82aadb38abc4564dda5cc8580f,rankeval/core/metrics/rbp.py,RBP,eval_per_query,#RBP#Any#Any#,58

Before Change


        // expected_utility
        expected_utility = 0.
        binary_rel = y[idx_y_pred_sorted] > self.threshold
        for i, idx in enumerate(idx_y_pred_sorted):
            expected_utility += binary_rel[i] * pow(self.p, i)

        rbp = (1. - self.p) * expected_utility
        return rbp

After Change


        if self.cutoff is not None:
            idx_y_pred_sorted = idx_y_pred_sorted[:self.cutoff]

        discount = np.power(self.p, np.arange(len(idx_y_pred_sorted)))
        gain = y[idx_y_pred_sorted] > self.threshold

        rbp = (1. - self.p) * (gain * discount).sum()
        return rbp
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: hpclab/rankeval
Commit Name: 8d4fee5d7dc69f82aadb38abc4564dda5cc8580f
Time: 2017-06-14
Author: cristina.i.muntean@gmail.com
File Name: rankeval/core/metrics/rbp.py
Class Name: RBP
Method Name: eval_per_query


Project Name: calico/basenji
Commit Name: 773d9932c4b891800bf254d5cea61159056437f1
Time: 2016-12-26
Author: drk@calicolabs.com
File Name: basenji/rnn.py
Class Name: RNN
Method Name: build


Project Name: Qiskit/qiskit-aqua
Commit Name: e44bb209a41d9f85a0f115b21b3b150bff65ee66
Time: 2020-09-15
Author: jules.gacon@googlemail.com
File Name: test/aqua/test_amplitude_estimation.py
Class Name: TestBernoulli
Method Name: test_qae_circuit