Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-329

SMOTE Interpolation

Problem

Generate a synthetic SMOTE point by interpolating between two minority samples: a[i] + lam * (b[i] - a[i]) for every coordinate. Return the new vector; empty input returns [].

Hint

SMOTE places new minority points on the segment between a seed and one of its neighbors.

Test cases

case 1
in: [[0,0],[2,4],0.5]
expected: [1,2]
case 2
in: [[1,1,1],[3,5,7],0.25]
expected: [1.5,2,2.5]
case 3
in: [[],[],0.5]
expected: []
case 4
in: [[5,5],[5,5],0.9]
expected: [5,5]
Starter codePython
def smote_interpolate(a, b, lam):
    # Your code here
    pass

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