Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-351

MAE from Absolute Errors

Problem

The mean absolute error is the average of the absolute prediction errors.

Given the list of signed errors, return the mean absolute error.

Hint

Take magnitudes before averaging.

Test cases

case 1
in: [[1,-2,3]]
expected: 2
case 2
in: [[0,0]]
expected: 0
case 3
in: [[-1,-1,-1,-1]]
expected: 1
Starter codePython
def mae_from_absolute_errors(errors):
    # Your code here
    pass

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