Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-287

Two-Model Uplift

Problem

Compute two-model uplift: treatment probability minus control probability for each sample.

Empty input returns [].

Hint

The two-model approach trains separate outcome models per treatment arm.

Test cases

case 1
in: [[0.1,0.4,0.8],[0.15,0.35,0.9]]
expected: [0.04999999999999999,-0.050000000000000044,0.09999999999999998]
case 2
in: [[0.5,0.5],[0.5,0.5]]
expected: [0,0]
case 3
in: [[],[]]
expected: []
Starter codePython
def two_model_uplift(p_control, p_treatment):
    # Your code here
    pass

3 test cases · run your code against them in the editor