All problems
Retrain Cadence
Problem
Decide whether a model should be retrained: return True when the model age in periods is at least the retraining threshold.
The comparison is inclusive, so age equal to the threshold triggers retraining.
Hint
A negative threshold means retrain immediately on any age.
Test cases
case 1
in: [10,10]
expected: true
case 2
in: [9,10]
expected: false
case 3
in: [0,0]
expected: true
case 4
in: [5,-1]
expected: true
Starter codePython
def retrain_cadence(age, threshold):
# Your code here
pass4 test cases · run your code against them in the editor