Skip to content
DeepForgeby svx
All problems
MediumML Fundamentalsml-267

Retraining Cost-Benefit

Problem

Compute the expected net benefit of retraining: drift_prob * daily_loss * days_saved - retrain_cost.

Hint

Retrain only when expected avoided loss exceeds the retraining cost.

Test cases

case 1
in: [0.8,100,3,200]
expected: 40
case 2
in: [0.1,100,2,500]
expected: -480
case 3
in: [0,5,1,10]
expected: -10
Starter codePython
def retraining_cost_benefit(drift_prob, daily_loss, days_saved, retrain_cost):
    # Your code here
    pass

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