Skip to content
C

Problem 2: Manually Calculate MAE and MSE

Easypython

Problem Description

Write a Python program that manually calculates MAE and MSE for a set of actual and predicted values, without using any built-in metric functions.

Input

Two lists: actual values and predicted values.

Output

The manually calculated MAE and MSE.

Constraints

  • Both lists must have the same length.

Example Input

text
actual=[10,20,30], predicted=[12,18,33]

Example Output

text
MAE: 2.33 MSE: 5.67

Concepts Covered

Loops, absolute value, manual formula implementation.

Input (stdin)

Output

Run your code to see output here...