Skip to content
DeepForgeby svx
All problems
MediumML Fundamentalsml-190

Novelty Effect

Problem

Estimate the novelty effect as the change in lift from the first k days to the remaining days: mean(lifts[k:]) - mean(lifts[:k]).

Return 0.0 if k is not within (0, len(lifts)).

Hint

A large drop after the first days suggests the early lift was a novelty spike.

Test cases

case 1
in: [[5,4,2,1],1]
expected: -2.6666666666666665
case 2
in: [[1,2,3,4],2]
expected: 2
case 3
in: [[3],1]
expected: 0
case 4
in: [[],1]
expected: 0
Starter codePython
def novelty_effect(lifts, k):
    # Your code here
    pass

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