All problems
Position Bias Correction
Problem
Correct click-through rate for position bias with inverse propensity weighting: the mean of clicks_i / max(examination_prob_i, 1e-6). Empty input returns 0.0.
Hint
Dividing by the probability that a position was examined removes its advantage.
Test cases
case 1
in: [[1,0,1],[1,0.5,0.25]]
expected: 1.6666666666666667
case 2
in: [[1,0],[0.5,0.5]]
expected: 1
case 3
in: [[0,0],[1,1]]
expected: 0
case 4
in: [[],[]]
expected: 0
Starter codePython
def position_bias_corrected_ctr(clicks, examination_probs):
# Your code here
pass4 test cases · run your code against them in the editor