Skip to content
DeepForgeby svx
All problems
MediumML Fundamentalsml-307

LOCO Delta

Problem

Compute leave-one-covariate-out importance as the change in MSE: mse_without - mse_full.

Empty input returns 0.0.

Hint

A large positive delta means the feature was important for prediction quality.

Test cases

case 1
in: [[1,2,3],[1,2,3],[1,1,1]]
expected: 1.6666666666666667
case 2
in: [[1,2,3],[2,2,2],[3,3,3]]
expected: 1
case 3
in: [[],[],[]]
expected: 0
Starter codePython
def loco_delta(y_true, preds_full, preds_without):
    # Your code here
    pass

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